How do I insert variables into a matrix???

13 ビュー (過去 30 日間)
Tarou Seki
Tarou Seki 2016 年 1 月 21 日
編集済み: Tarou Seki 2016 年 1 月 28 日
I'm a beginner at matlab and cannot figure out how to insert variables into a matrix. In my circuits class, I'm trying to find the voltage in terms of the many resistors, which I want to call r1 r2 r3 ..... When I put these variables into my matrix I get this error message "The following error occurred converting from sym to double;Double cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use VPA." I've been trying to find answers on youtube or here, but I haven't found something that works. Any tips? Thank you

採用された回答

Walter Roberson
Walter Roberson 2016 年 1 月 21 日
You initialized your matrix numerically, such as
ABC = zeros(5,11);
You need to initialize your matrix symbolically, such as
ABC = sym(zeros(5,11));
  1 件のコメント
Tarou Seki
Tarou Seki 2016 年 1 月 21 日
編集済み: Tarou Seki 2016 年 1 月 28 日
Thank you very much. I got it to work. This saves so much time.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by