converting sym to double
显示 更早的评论
i have been working on this code
syms k
K = zeros(8);
K(1,1) = 0.7499*k
MATLAB shows the error "unable to convert expression into double array"
Also in general How do I create a matrix with symbolic expressions as element values for any given matrix.
采纳的回答
更多回答(1 个)
Steven Lord
2020-3-19
Make K a sym array from the start. Then MATLAB doesn't need to convert the symbolic expression 0.7499*k when assigning into an element of K.
K = sym(zeros(8));
类别
在 帮助中心 和 File Exchange 中查找有关 Operations on Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!