The following error occurred converting from sym to double: Unable to convert expression into double array.
1 回表示 (過去 30 日間)
古いコメントを表示
Gülçin Tekin Özkan
2021 年 9 月 22 日
コメント済み: Gülçin Tekin Özkan
2021 年 9 月 22 日
The following error occurred converting from sym to double:
Unable to convert expression into double array. main purpose is to create a matrix which has unknowns x and y which will be calculated later. So I already created ONM matrix( size 4x1)
After that I tried to assign the elements of ONM matrix to 3rd column of another matrix that is called NM (size 4x1). But the error occured.
How can I fix it?
Thanks for your help
syms x y real
ONM1=[0 x y 0]
ONM=ONM1'
NM(:,3)=(ONM(:,2))
採用された回答
Walter Roberson
2021 年 9 月 22 日
When you created NM, you created it as a numeric array. You cannot "upgrade" a numeric array to be symbolic by assigning symbolic elements in the middle of it.
Before doing that last assignment, do
NM = sym(NM);
or arrange for NM to be constructed as sym when it is created.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Number Theory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!