blp82
Electrical
- May 19, 2006
- 1
Hi everybody!
here is my problem
I have two matix 3rows x 120cols (foto1 and foto2).
I need to plot this function (axes a, b, y)
y=exp(-disab/100);
knowing that:
disab=((va(1,1)-vb(1,1))^2+(va(1,2)-vb(1,2))^2+(va(1,3)-vb(1,3))^2);
where va and vb are two vector 1x3:
va=[foto1(3,a-1) foto1(3,a) foto1(3,a+1)];
vb=[foto2(3,b-1) foto2(3,b) foto2(3,b+1)];
and axes a and b are 1:1:120
I have tried the following code:
[ a, b ] = meshgrid(1 : 1 : 120);
va=[foto1(3,a-1) foto1(3,a) foto1(3,a+1)];
vb=[foto2(3,b-1) foto2(3,b) foto2(3,b+1)];
disab=((va(1,1)-vb(1,1))^2+(va(1,2)-vb(1,2))^2+(va(1,3)-vb(1,3))^2);
y=exp(-(disab));
mesh(a,b,y);
but it doesn't work, I got this error:
Subscript indices must either be real positive integers or logicals.
How can I solve my problem???
Thankyou so much for your help!
blp
here is my problem
I have two matix 3rows x 120cols (foto1 and foto2).
I need to plot this function (axes a, b, y)
y=exp(-disab/100);
knowing that:
disab=((va(1,1)-vb(1,1))^2+(va(1,2)-vb(1,2))^2+(va(1,3)-vb(1,3))^2);
where va and vb are two vector 1x3:
va=[foto1(3,a-1) foto1(3,a) foto1(3,a+1)];
vb=[foto2(3,b-1) foto2(3,b) foto2(3,b+1)];
and axes a and b are 1:1:120
I have tried the following code:
[ a, b ] = meshgrid(1 : 1 : 120);
va=[foto1(3,a-1) foto1(3,a) foto1(3,a+1)];
vb=[foto2(3,b-1) foto2(3,b) foto2(3,b+1)];
disab=((va(1,1)-vb(1,1))^2+(va(1,2)-vb(1,2))^2+(va(1,3)-vb(1,3))^2);
y=exp(-(disab));
mesh(a,b,y);
but it doesn't work, I got this error:
Subscript indices must either be real positive integers or logicals.
How can I solve my problem???
Thankyou so much for your help!
blp