subs in matrix with zero elements
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have a matrix Psym, say, 7-by-7. Some of elements of the matrix contains symbolic expressions of variable z. I have a vector w, say X-by-1.
I do the following code:
function Pfr = myfreqresp(Psym, w)
syms z;
Pfr = subs(Psym, z, exp(1i * w), 0);
end
I want to obtain Pfr as a matrix with dimensions X*7-by-7. To be more concrete this approach works perfect if the matrix Psym has variable z in ALL elements. But if Psym does not has z in at least one element then the before-mentioned code produces an error:
Error using mupadmex
Error in MuPAD command: Number of elements in NEW must match number in OLD
Error in sym/subs>mupadsubs (line 151)
G = mupadmex('symobj::fullsubs',F.s,X2,Y2);
Error in sym/subs (line 127)
G = mupadsubs(F,X,Y);
Error in mycov>myfreqresp (line 204)
Pfr = subs(Psym, z, exp(1i * w), 0);
It seems to me that smart guys who written this code did't take into account that some users may have such situation.
Is there are any solution to this bug?
Thank you in advance!
Respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!