Skip to content

Instantly share code, notes, and snippets.

@seawaveT
Forked from yongsun/lr_circles.m
Created June 14, 2012 06:49
Show Gist options
  • Save seawaveT/2928495 to your computer and use it in GitHub Desktop.
Save seawaveT/2928495 to your computer and use it in GitHub Desktop.
count the circles of numbers
X = [
1,0,3,0,0,0,0,0,1,0,0; % 7111
1,1,0,0,0,0,0,0,0,2,1; % 8809
1,0,1,2,0,0,0,0,1,0,0; % 2172
1,0,0,0,0,0,0,4,0,0,0; % 6666
1,0,4,0,0,0,0,0,0,0,0; % 1111
1,0,0,4,0,0,0,0,0,0,0; % 2222
1,0,0,1,0,0,0,2,1,0,0; % 7662
1,0,1,0,2,0,0,0,0,0,1; % 9313
1,4,0,0,0,0,0,0,0,0,0; % 0000
1,0,0,0,0,0,4,0,0,0,0; % 5555
1,0,1,0,1,0,0,0,0,1,1; % 8193
1,1,0,0,0,0,0,1,0,1,1; % 8096
1,0,0,0,1,1,0,0,0,1,1; % 4398
1,0,0,0,0,1,1,0,1,0,1; % 9475
1,1,0,0,1,0,0,0,0,1,1; % 9038
1,0,1,0,1,1,0,0,0,1,0; % 3148
];
y = [
0;
6;
0;
4;
0;
0;
2;
1;
4;
0;
3;
5;
3;
1;
4;
2;
];
theta = pinv (X' * X) * X' * y;
x = [
1,0,0,1,0,0,0,0,0,2,1; % 2889
1,0,0,1,0,1,0,1,1,0,0; % 2467
];
x * theta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment