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 日

0 投票

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 件のコメント

Hoi Tsim
Hoi Tsim 2015 年 10 月 28 日
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 2015 年 10 月 28 日
would you know how to do the vertical dotted lines?
Adam
Adam 2015 年 10 月 28 日
編集済み: Adam 2015 年 10 月 28 日
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 ExchangeLine Plots についてさらに検索

質問済み:

2015 年 10 月 28 日

編集済み:

2015 年 10 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by