I have this equation
with the variables
and i'm trying to get this plot
I keep getting a straight line.I'm not sure what I have done wrong.
Can anyone help me and copy and paste the input which is needed to form this plot.
thanks for the help in advance.

 채택된 답변

Star Strider
Star Strider 2015년 10월 14일

0 개 추천

This plots correctly for me:

aeq = @(T,Ts,dT,a) a(1) - 0.5*a(2).*(1 + tanh((T - Ts)./dT));
a = [0.58; 0.47];
Ts = 283;
dT = 24;
T = linspace(250, 310);
figure(1)
plot(T, aeq(T,Ts,dT,a))
hold on
plot(288, aeq(288,Ts,dT,a), '+r')
hold off

댓글 수: 11

Hoi Tsim
Hoi Tsim 2015년 10월 14일
thanks a lot for your answer. Helped very much!
My pleasure!
If you want to calculate the value of ‘T’ corresponding to aeq=0.3, use the fzero function:
Ta3 = fzero(@(T) aeq(T,Ts,dT,a)-0.3, 1)
Ta3 =
287.6532
Hoi Tsim
Hoi Tsim 2015년 10월 16일
thanks! I'm struggling because I'm doing a maths project but never used matlab and plotted these sorts of functions before.
Hoi Tsim
Hoi Tsim 2015년 10월 16일
I've also got another 2 graphs which include plotting 2 curves in the same graph and another really difficult one. Hopefully someone helps me.
My pleasure!
To plot 2 (or more) curves on the same plot, the easiest way is to use the hold function:
figure(1)
plot(x, y1)
hold on
plot(x, y2)
hold off
grid
Star Strider
Star Strider 2015년 10월 16일
I looked at those, but cannot figure out what Q is. you need to know what it is or how to calculate it before you can proceed. (Meteorology and Climatology are not areas of my expertise. I know what albedo is, but I am not familiar with those equations.)
Hoi Tsim
Hoi Tsim 2015년 10월 16일
thanks very much for having a look!
Star Strider
Star Strider 2015년 10월 16일
My pleasure!
Hoi Tsim
Hoi Tsim 2015년 10월 17일
i have looked at my notes and i see that σ = 5.670367 × 10-8 kg s-3 K-4
does this help with continuing the question?
do i just set it out like the first plot you helped me with, defining each equation and then after >> figure i type.. plot(T, aeq(T,Ts,dT,a),Ri,Ro)?
Star Strider
Star Strider 2015년 10월 17일
I still don’t know what Q is, or how to calculate it. (It seems to be a variable, and could be either data a function. It is necessary to calculate at least one other variable in your other two Questions, and in one is the essence of the Question.)
Sorry, but full stop until I get a definition for Q!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Thorsten
Thorsten 2015년 10월 14일
편집: Thorsten 2015년 10월 14일

0 개 추천

a1 = 0.58;
a2 = 0.47;
Tstar = 283;
dT = 24;
aeq = @(T) a1 - 0.5*a2 *(1 + tanh((T-Tstar)/dT))
T = 250:310;
plot(T, aeq(T))

댓글 수: 1

Hoi Tsim
Hoi Tsim 2015년 10월 14일
thanks very much for your answer! loads of help

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

질문:

2015년 10월 14일

댓글:

2015년 10월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by