我自己定义的多元函数输入向量报错。
Mostra commenti meno recenti
代码如下:y{1}=@(x1,x2,x3)x1^2+x2^2+x3^2;
syms x1 x2 x3;
x0=[1,2,3];
out=y{1}(x0);
错误信息如下:[size=13.3333px]用于对矩阵求幂的维度不正确。请检查并确保矩阵为方阵并且幂为标量。要单独对矩阵的每个元素进行运算,请使用 POWER (.^)执行按元素求幂。
[size=13.3333px]有没有办法能解决这个问题?十分感谢。
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Number Theory in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!