Output of previous command into input

I wrote a code and I have found these values when I run. Now, how can I convert this outputs as inputs in the next code. I tried in this code but it doesn't work. I want to define these Ca1 Ca2 Ca3 Ca4 Cb1 Cb2 Cb3 Cb4 outputs as my x0 inputs in this function. Ca1 Ca2 Ca3 Ca4 Cb1 Cb2 Cb3 Cb4 values are given below.
x0=[Ca1 Ca2 Ca3 Ca4 Cb1 Cb2 Cb3 Cb4];
x=fsolve(@functiondescription,x0)
Ca2 =
1421/3468
Ca3 =
217/2312
Ca4 =
91/1156
Cb1 =
1/8
Cb2 =
2047/3468
Cb3 =
2095/2312
Cb4 =
1065/1156

 採用された回答

madhan ravi
madhan ravi 2020 年 12 月 13 日
編集済み: madhan ravi 2020 年 12 月 13 日

0 投票

If those variables are in the workspace, it should run without any problems.
Ca1 = ...;
Ca2 = ...;
Ca3 = ...;
Ca4 = ...;
Cb1 = ...;
Cb2 = ...;
Cb3 = ...;
Cb4 = ...;
x0 = [Ca1 Ca2 Ca3 Ca4 Cb1 Cb2 Cb3 Cb4];
x = fsolve(@functiondescription, x0)

3 件のコメント

Carey n'eville
Carey n'eville 2020 年 12 月 13 日
These output are result of this:
syms Ca1 Ca2 Ca3 Ca4 Cb1 Cb1 Cb2 Cb3 Cb4
[Ca1, Ca2, Ca3, Ca4, Cb1, Cb2, Cb3, Cb4]=solve(Eqns_1st_Order)
It gives this error:
FSOLVE requires the following inputs to be of data type double: 'X0'.
madhan ravi
madhan ravi 2020 年 12 月 13 日
Ca1 = double(Ca1); % same for others
Carey n'eville
Carey n'eville 2020 年 12 月 13 日
編集済み: Carey n'eville 2020 年 12 月 13 日
It works!! Thank you so much!! Also I need tabulate my data. How can I do this?

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

その他の回答 (0 件)

カテゴリ

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

製品

リリース

R2020b

質問済み:

2020 年 12 月 13 日

編集済み:

2020 年 12 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by