Create n symbolic variables

24 ビュー (過去 30 日間)
one plus one is two
one plus one is two 2018 年 10 月 25 日
コメント済み: madhan ravi 2018 年 11 月 20 日
Hi, I would like to know if there's a way to create n differente symbolic variables (n is an input). Thank's in advanced

採用された回答

madhan ravi
madhan ravi 2018 年 10 月 25 日
編集済み: madhan ravi 2018 年 10 月 25 日
EDITED
n=input('value of n?')
syms(sym('a',[1 n]))
a=(sym('a',[1 n])) %storing symbolic variables in a vector for convenience and also to use indexing
command window displays:
value of n?10
n =
10
a =
[ a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]
>> a(1:6)
ans =
[ a1, a2, a3, a4, a5, a6]
>>
  9 件のコメント
one plus one is two
one plus one is two 2018 年 11 月 20 日
Sorry for the late, thank you so much for your help!
madhan ravi
madhan ravi 2018 年 11 月 20 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by