How to plot this function ? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to plot this function ?

aredy29aredy29 Posts: 4Member
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.


  • giuggiug Posts: 217Member
    You can define
    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
    plot(x,y); hold on;
Sign In or Register to comment.