创建N个变量的问题。

1 Ansicht (letzte 30 Tage)
新锦江娱乐现场开户【微8785092】
已知n的数值,怎么去创建n个变量就是如果n=4,需要建立n1 n2 n3 n4,有没有函数可以解决这个问题呢,求大佬解答

Akzeptierte Antwort

新锦江娱乐注册官网【微8785092】
syms函数(超链接,自己点进去看) 里面就有示例,比如 syms n [ 1 4 ]
但实际使用中,除非真的需要四个符号变量做符号计算,这种搞n1 n2 n3 n4的写法,在数值运算中,一般直接写作向量n,然后调用n( 1 )到n( 4 )

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!