×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Need help with 3d plot!!!

Need help with 3d plot!!!

Need help with 3d plot!!!

(OP)
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

RE: Need help with 3d plot!!!

are you sure you got this massage from the function here and not from the foto function?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources