how to replace variable by another variable
古いコメントを表示
Hn=-2*P/(Mu*exp(n^2*pi^2*T/Mu))
I want to replace T by t and want to do calculation
2 件のコメント
Venkat Siddarth
2023 年 2 月 8 日
Can you elaborate the query,on whats the result you are getting when you replace "T" with "t" in the equation itself i.e
Hn=-2*P/(Mu*exp(n^2*pi^2*t/Mu))?
vikas singh
2023 年 2 月 10 日
回答 (3 件)
Walter Roberson
2023 年 2 月 8 日
0 投票
if you are using the symbolic toolbox then subs()
6 件のコメント
vikas singh
2023 年 2 月 10 日
syms L Mu n P T t
Pi = sym(pi);
Hn=-2*P/(Mu*exp(n^2*Pi^2*T/Mu))
Hn_new = subs(Hn, T, t/L)
subs(Hn_new, t, (1:5).')
vikas singh
2023 年 2 月 11 日
vikas singh
2023 年 2 月 11 日
vikas singh
2023 年 2 月 13 日
Walter Roberson
2023 年 2 月 13 日
subs(Hn_new, t, (5:5:1000).')
vikas singh
2023 年 2 月 15 日
0 投票
4 件のコメント
Walter Roberson
2023 年 2 月 16 日
I think you are getting some underflow, exp(-number) terms that evaluate in floating point to zero even though mathematically they are not zero.
vikas singh
2023 年 3 月 6 日
vikas singh
2023 年 4 月 25 日
Walter Roberson
2023 年 4 月 25 日
r.*f
vikas singh
2023 年 4 月 25 日
編集済み: Walter Roberson
2023 年 4 月 25 日
5 件のコメント
Walter Roberson
2023 年 4 月 25 日
for n=1:M
for i=1:N
if x(i)>=250 && x(i)<=350
r(i)=w2;
else
r(i)=w1;
end
end
r is a vector of length N after that for i loop.
if t(n)<=182.5
f(n)=sin(2*pi*t(n)/365).^2;
else
f(n)=0;
end
f is a vector of length n after that if test -- it is being expanded as do more interations of for n
f2=r.*f
r is 1 x N vector. f is a 1 x n vector. They can only be .* together if the changing variable n == N or n == 1 (in which case 1 x N .* 1 x 1 would be scalar expansion.)
vikas singh
2023 年 4 月 26 日
vikas singh
2023 年 4 月 28 日
編集済み: Walter Roberson
2023 年 4 月 28 日
Walter Roberson
2023 年 4 月 28 日
I want to plot between x and -(z(n+1,i)).^0.5
Do you mean that you have an independent variable 1:N on the x axis, and you want to treat the variable x and that particular expression as dependent variables to be drawn and you want to fill the area between the two lines?
Or is your x variable to be treated as the x axis and you want to draw -(z(n+1,i)).^0.5 even though that appears to be independent of x?
vikas singh
2023 年 4 月 29 日
カテゴリ
ヘルプ センター および File Exchange で Code Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


