Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1467
Number of posts: 2144

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

Report
How to plot this function ? Posted by aredy29 on 31 Jan 2012 at 10:27 AM
My function is;

y(x,s)= 1-(cos[(s-1)arctan(x)]*gamma(s-1))/(1+x^2)^(s-1)/2

varible x will have range from 0 to 10. At one time the s value will be constant e.g. s = 3 but I want to change s for different values( is there any commands in matlab that will allow me to do this ?). I tried many time but can't get it.

Report
Re: How to plot this function ? Posted by giug on 1 Feb 2012 at 12:36 AM
You can define
x=0:0.01:10

and y=....
if s is constant you can plot this by using the plot(x,y) function.

If s changes, probably you will have different curves to plot in the same plot (probably with different colors).
So, insert the y definition in a for loop:
for s=3:6
y=...
plot(x,y); hold on;
end



 

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.