非常感谢您提供的任何帮助...
我正在使用 Matlab 编写一般案例场景,因此函数的输入数量会有所不同。输入采用输入矩阵中元素数量的形式。
(我在下面提供了一个简单的玩具示例,以使我的问题更清楚):
%# The code generates as many symbolic variables as necessary...
P1 = sym('P1')
P2 = sym('P2')
.
.
.
PN = sym('Pn')
%# I create a symbolic function of all the variables...
this = (P1^2+P2^3+...+Pn^2)
%# I convert the symbolic function into a function...
that = matlabFunction(this)
%# Now I want to provide values for use in the calculation
%# (I have a list of starting values for each P1...Pn)
other = that(???) -->
%# ***Want to provide list of inputs that has as many values as the number
%# of symbolic values I have created (which varies according to each case)****
我查看了其他问题,但也许我没有使用正确的搜索词。当我使用句柄时,是否有一种优雅的方式来提供可变数量的输入that
?
非常感谢你的帮助。我是菜鸟,感激不尽!!