I'm trying to code these equations. This is my attempt. I would like to plot Cf vs x/L, but x/L as I have it shows me an error..the same with delta/x, not sure why? any help will be greatly appreciated. Thanks much.
Re = 0:500:1000;
x/L = 0:0.2:1;
Cf = 0.664*(Re)^-0.5;
delta/x = 5.0*(Re)^-0.5;

1 件のコメント

Les Beckham
Les Beckham 2023 年 2 月 3 日
編集済み: Les Beckham 2023 年 2 月 3 日
What are x, L, and delta?
Also, you can't put an expression like x/L on the left hand side of an assignment statement, only a variable name (optionally indexed).

サインインしてコメントする。

 採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 2 月 3 日

0 投票

Here is the corrected code:
Re = 0:50:1000;
xL = linspace(0,1, numel(Re));
Cf = 0.664*(Re).^(-0.5);
deltaX = 5.0*(Re).^(-0.5);
plot(Cf, xL, 'ro', 'markerfacecolor', 'y')
xlabel('C_f')
ylabel('x_L')
grid on

4 件のコメント

Cesar Cardenas
Cesar Cardenas 2023 年 2 月 4 日
Thanks much for your help. Just a quick question, I coded this simple equation. I got a plot. It shows a straight line, buyt I think it should be some kind of curve, is it right? or is there is something wrong? Thanks.
Ue = @(x)2*(1-x);
x = (0:0.1:1);
plot(Ue(x),x)
grid on
Walter Roberson
Walter Roberson 2023 年 2 月 5 日
syms x
Ue(x) = 2*(1-x)
Ue(x) = 
diff(Ue,x)
ans(x) = 
The derivative of the function is constant; therefore the function must be a straight line, not a curve.
Cesar Cardenas
Cesar Cardenas 2023 年 2 月 17 日
Hello I would like to plot, q, h and Re in the same graph, no sure about it, any help will be appreciated. Thanks
1 = 30;
T2 = 40;
v = 0.5;
x1 = 0.01;
x2 = 0.05;
Pr = 5.18;
nu = 7.708;
k = 0.6184;
d = 995;
Re = v*(x2-x1)/nu
h = 0.3314*(Re.^(0.5))*(Pr.^(0.3))*(k/x2 - x1)
q = h*(x2 - x1)*1*(T2-T1)
plot (h, q, Re)
Walter Roberson
Walter Roberson 2023 年 2 月 17 日
Your h, q, and Re are all scalars, so plotting them on the same graph is not going to be interesting.
T1 = 30;
T2 = 40;
v = 0.5;
x1 = 0.01;
x2 = 0.05;
Pr = 5.18;
nu = 7.708;
k = 0.6184;
d = 995;
Re = v*(x2-x1)/nu
Re = 0.0026
h = 0.3314*(Re.^(0.5))*(Pr.^(0.3))*(k/x2 - x1)
h = 0.3417
q = h*(x2 - x1)*1*(T2-T1)
q = 0.1367
plot([h, q, Re],'r*')

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by