[SOLVED] Help me solve errors when plotting with Matlab

Status
Not open for further replies.

nanock

Member level 1
Joined
Mar 13, 2011
Messages
40
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Visit site
Activity points
1,564
hi,
i will be thankful if you tell me what's the problem with this function?
"
function [t] = fun1(i)
tms=1;
is=100;
i=101:1:501;
k=0.14;
n=0.02;
t=(k*tms)/(((i/is)^n)-1)
loglog(i,t)
hold on
grid on
"
matlab says:"??? Error using ==> mpower
Matrix must be square.

Error in ==> fun1 at 7
t=(k*tms)/(((i/is)^n)-1)
"
thank you
 

Re: plotting with matlab


Code:
function [t] = fun1(i)
tms=1;
is=100;
i=101:1:501;
k=0.14;
n=0.02;
[B]t=(k*tms)./(((i./is).^n)-1)[/B]
loglog(i,t)
hold on
grid on

 
Reactions: nanock

    nanock

    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…