创建N个变量的问题。

1 view (last 30 days)
已知n的数值,怎么去创建n个变量就是如果n=4,需要建立n1 n2 n3 n4,有没有函数可以解决这个问题呢,求大佬解答

Accepted Answer

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

More Answers (0)

Categories

Find more on Symbolic Math Toolbox 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!