フィルターのクリア

Extract a row as a function of a variable

1 回表示 (過去 30 日間)
AtoZ
AtoZ 2018 年 12 月 6 日
コメント済み: madhan ravi 2018 年 12 月 6 日
I have a numerical solution, which comes as a symbolic 6x51 matrix when I assign the values to T as T=[0:0.1:5].
I want to extract the first row (1x51) as a function of T, how to do it? The `rows2vars` prescription doesn't seem to work.
syms a T
v3=-2.375; g=1; b=0.00001; e2=0.5; k=pi/2;
w=-2*cos(k);
eqn = sin(3*k+a)/sin(2*k+a)==v3-w+(g.*T.^2)./(1+b.*T.^2)+(e2.*T.^2.*sin(k)^2)./(sin(2*k+a)^2+b*T.^2*sin(k)^2);
sol = solve(eqn,a,[0 pi]);
solutions = vpa(subs(sol),3);
xx=subs(solutions,T,[0:0.1:5])
% xx(1,:)
T2 = rows2vars(xx); %does not work

採用された回答

madhan ravi
madhan ravi 2018 年 12 月 6 日
編集済み: madhan ravi 2018 年 12 月 6 日
T=linspace(0,5,numel(xx(1,:)));
y=T.^2+sin(P+xx(1,:));
plot(T,y)
  17 件のコメント
AtoZ
AtoZ 2018 年 12 月 6 日
編集済み: AtoZ 2018 年 12 月 6 日
@madhan Thanks :) Could you please update your answer?, I'll accept it.
madhan ravi
madhan ravi 2018 年 12 月 6 日
Anytime :) , updated my answer.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by