No BSD License  

Highlights from
Introduction à Matlab (deuxième édition)

from Introduction à Matlab (deuxième édition) by Jean-Thierry
tous les m-fichiers relatifs à la deuxième édition de l'Introduction à Matlab

main5.m
clear all
data = rand(2,100)*100;
x = [pi/3 1 -1]; 
r = [cos(x(1)) -sin(x(1)); sin(x(1)) cos(x(1))];
t = [x(2);x(3)];
data1 = zeros(2,0);
for i = 1:size(data,2)
   data1 = [ data1 (r*data(:,i)+t+0.1*randn(2,1))];
end;
ia =  [1 1 1];
sol = [0 10 0];
plot(data(1,:),data(2,:),'r+')
hold on
plot(data1(1,:),data1(2,:),'go')

%options = optimset('TolCon',1.0E-7,'TolX',1.0E-5);
[sol1, chisq, fvec, ok, iter] = levmar('rottr2',sol,ia,[],data, data1)
%fminsearch('srottr2',sol,[], data, data1);
data2 = zeros(2,0);
for i = 1:size(data,2)
   data2 = [ data2 (r*data(:,i)+t+0.01*randn(2,1))];
end;
plot(data2(1,:),data2(2,:),'bx')
axis([-90 110 -10 140 ]);

Contact us at files@mathworks.com