I'm tying to plot this graph>
and so far i have done this>
>>T = linspace(250,310)
>>Q = (4*5.670367*10.^-8*0.61757*T.^4)/(1-(0.58-0.235*(1+tanh((T-283)/24))))
>>figure
>>plot(T,Q)
I'm trying to plot the graph the wrong way first and then tun it the right way because it is easier.
It is giving me the correct limits byt no graph appears and after insert the values for Q it comes up "Q =
1.3971e+03"
I'm wondering what I have done wrong.

 Akzeptierte Antwort

Adam
Adam am 28 Okt. 2015

0 Stimmen

You need to use
./
to do point-wise division rather than matrix division ( / ). This will give you 100 Q values:
Q = (4*5.670367*10.^-8*0.61757*T.^4)./(1-(0.58-0.235*(1+tanh((T-283)/24))));

3 Kommentare

Hoi Tsim
Hoi Tsim am 28 Okt. 2015
THANKSS SO MUCH!
first time using matlab so a lot of basic things I'm not aware of.
Helped me save a lot of time and worry!
Hoi Tsim
Hoi Tsim am 28 Okt. 2015
would you know how to do the vertical dotted lines?
Adam
Adam am 28 Okt. 2015
Bearbeitet: Adam am 28 Okt. 2015
plot( hAxes, [1370 1370], [250 290], ':' );
should give you a start. The help page for plot should tell you the other options than ':' for dotted, dashed lines etc.
That is just saying you want a line with two points, both the same in x (i.e. vertical) and the two ends at 250 and 290 on the y-axis
hAxes is an existing axes handle. You can just leave that out to plot on the 'current' axes, but I don't like to do that as it is too prone to potential errors so I always give answers that include an explicit axes handle.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 28 Okt. 2015

Bearbeitet:

am 28 Okt. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by