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.

 采纳的回答

Adam
Adam 2015-10-28
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 个评论

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!
would you know how to do the vertical dotted lines?
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.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by