# solving symbolic array to output a numerical solution

3 ビュー (過去 30 日間)
Samuel Casallas 2021 年 3 月 26 日
コメント済み: madhan ravi 2021 年 3 月 27 日
Hi there, I was wondering if I could get some feedback on a potential solution for this problem. I am trying to solve for ma3 and obtain a numerical value for each value used in the FLcD3 array. However, the output of Ma3 is a struct with fields. How do I get it so the solution is an array with the numerical values? I'm guessing I would need some form of a for loop but i'm not quite sure how to set it up.
PSW = 0.36:0.03:0.69;
L12 = PSW*TL;
D = 0.03;
Ma4 = 1;
P4 = 1.013;
Lc3 = TL-L12;
FLcD3 = 4*f*Lc3/D;
ma3 = sym('ma3', [1 length(PSW)]) ;
eqn1 = (-1./G).*(1-ma3.^-2)+((G+1)./(2.*G)).*log((((G+1)./2).*ma3.^2)./(1+((G-1)./2).*ma3.^2)) == FLcD3;
Ma3 = vpasolve(eqn1,ma3)
%This is the output I get
Ma3 =
ma31: [1×1 sym]
ma32: [1×1 sym]
ma33: [1×1 sym]
ma34: [1×1 sym]
ma35: [1×1 sym]
ma36: [1×1 sym]
ma37: [1×1 sym]
ma38: [1×1 sym]
ma39: [1×1 sym]
ma310: [1×1 sym]
ma311: [1×1 sym]
ma312: [1×1 sym]

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

### 回答 (1 件)

madhan ravi 2021 年 3 月 26 日

struct2array(Ma3)
##### 2 件のコメント表示非表示 1 件の古いコメント
madhan ravi 2021 年 3 月 27 日

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

### カテゴリ

Find more on Assumptions in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!