Simple problem with MATLAB code

Status
Not open for further replies.

mouzid

Full Member level 5
Joined
Jun 22, 2007
Messages
248
Helped
9
Reputation
18
Reaction score
0
Trophy points
1,296
Activity points
2,876
MATLAB Stupid Question

Hello,

Ho can say me what's wrong with my code:

r=1:.1:10
y=atan(5*r)-2*atan(r^-9)
plot(r,y)

Matlab says

??? Error using ==> mpower
Matrix must be square.

Error in ==> PM at 2
y=atan(5*r)-2*atan(r^-9)
 

Re: MATLAB Stupid Question

Add a dot before the expenential
r=1:.1:10
y=atan(5*r)-2*atan(r.^-9)
plot(r,y)
 

    mouzid

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…