Graph looks like a dotted straight line

2 Ansichten (letzte 30 Tage)
Abhinandana R
Abhinandana R am 24 Jan. 2019
Kommentiert: Abhinandana R am 24 Jan. 2019
I need a exponential curve. but it looks like a horizontal dotted line. how could I get it?
u=0.01; i=22/7; g=716; l=0.1;
d=50; p=45; r=linspace(0,1,100);
m=tand(p)
a=(r-m*(d+l)).^-2-((r-m*l).^-2)
q=(i*r.^4*g)/(8*u*l)
tl=(2*u*q.*a)./(i*m)
tb=(i*m*tl)/(2*u*q.*a)
plot(r,tb)

Akzeptierte Antwort

madhan ravi
madhan ravi am 24 Jan. 2019
tb=(I*m*tl)./(2*u*q.*a) % is equivalent to (I*m*(2*u*q.*a))/(I*m*2*u*q.*a))
so everything gets cancelled out , you will have a question why the first value of tb is NaN because when you divide zero by zero in matlab you get a NaN ( https://www.mathworks.com/help/matlab/ref/nan.html#f91-998317 )
  2 Kommentare
madhan ravi
madhan ravi am 24 Jan. 2019
If you have symbolic math toolbox try the below
syms u q a I m tl
tl=(2*u*q.*a)./(I*m);
tb=(I*m*tl)./(2*u*q.*a) % will give you one the reason as described above
Note: I have changed variable i because matlab interprets it as complex number so to avoid confusion it's better to avoid naming a variable i and j.
Abhinandana R
Abhinandana R am 24 Jan. 2019
thank you so much sir!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by