DOUBLE cannot convert the input expression into double array

Click For Summary
The discussion centers around an issue with populating a numerical matrix from a symbolic array in MATLAB. The user encounters an error when attempting to assign a symbolic expression to a numerical variable, specifically receiving a conversion error from sym to double. Suggestions include using the VPA function to convert symbolic expressions to numerical values, but the user reports unsuccessful attempts. Another participant recommends the "subs" function as a potential solution for substituting symbolic values. The conversation highlights the challenges of handling symbolic data types in numerical contexts within MATLAB.
bugatti79
Messages
786
Reaction score
4
Hi Folks,

I have a symbolic A=18*1*18 array containing symbols/expressions. I want to populate certain entries of this array into another matrix. For example

K(1,1)=A(1,1,1)

I get the following

? The following error occurred converting from sym to double:
Error using ==> mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.

If the input expression contains a symbolic variable, use the VPA function instead.

I have tried
K(1,1)=vpa(A(1,1,1)) and other forms but no luck
Is there a workaround?
Thanks
 
Physics news on Phys.org

Similar threads

Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
6K
Replies
1
Views
3K
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
6K
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K