Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1494
Number of posts: 2174

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Mesh / surf in Matlab - color Posted by dlichu on 4 Feb 2013 at 9:46 AM
Hi all,

I have some question regarding using functions from subject.

I have vectors:
size(x) = [379 1] % Created by x = 1:379; x = x';
size(y) = [579 1] % Created like above
and I have matrix of values:
size(z) = [379 579]

I read that to do mesh I need to do something like that:
meshgrid(x,y);
mesh(z);

I got result like in attachment.
In figuree.jpg you can see some chart. Matlab colors it from blue to red for z axis, so everything is blue because of peak in first few values in y axis.

My question: how to change color direction? I would like to color mesh in direction of x axis, meaning x(1) would be red and x(379) blue. Is it possible?

Best regards,
Marcin

Attachment: Zipp.rar (175123 Bytes | downloaded 12 times)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.