how can I use syms with spdiags function?

1 次查看(过去 30 天)
hi how can I fix the following error ? % The following error occurred converting from sym to double: Error using symengine (line 58) DOUBLE cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use VPA. % here's my code : U = sym('u', [20 1]); w=zeros(20,20); w = sym('w', [20 20]); % w = diag(1./sqrt(U)); w = spdiags(1./sqrt(U),0, 20,20); %% I want to have a matrix w of size 20*20 with the diagonals of u1,u2,...u20. thanks alot

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by