2D plot of a function WITH MATLAB

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 5K views
aredy29
Messages
10
Reaction score
0
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.
 
Physics news on Phys.org
how should I define my function ? I keep getting 'm power error'
 
Here's an example I did in Freemat, a MATLAB clone, as I don't use MATLAB much anymore

for i = 1:5
s=i
x=0:10
y=s*x
plot(x,y)
hold('on')
end

It draws five plots on one chart with varying s values.