DOUBLE cannot convert the input expression into double array

In summary, the conversation is about using an array of symbolic expressions and populating certain entries into another matrix. The person encountered an error when trying to convert the symbolic values to numerical values and asked for a workaround. Another person suggested using the "subs" function for this task.
  • #1
bugatti79
794
1
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
  • #3

Related to DOUBLE cannot convert the input expression into double array

1. What does the error message "DOUBLE cannot convert the input expression into double array" mean?

This error message means that the input expression provided cannot be converted into an array of double data type. This could be due to an incorrect data type or format of the input expression.

2. How do I fix the "DOUBLE cannot convert the input expression into double array" error?

To fix this error, you will need to check the data type and format of the input expression. Make sure it is compatible with a double array. You may also need to use a conversion function or change the input expression to a different type.

3. Why am I getting the "DOUBLE cannot convert the input expression into double array" error?

This error could be occurring because the input expression is not compatible with a double array. It could also be due to an error in your code, such as using the wrong data type or format.

4. Can I convert a non-numeric input expression into a double array?

No, a non-numeric input expression cannot be converted into a double array. Double arrays only accept numerical values, so trying to convert a non-numeric input will result in the "DOUBLE cannot convert the input expression into double array" error.

5. Are there any alternatives to using a double array to avoid the "DOUBLE cannot convert the input expression into double array" error?

Yes, there are alternative data types that can be used instead of a double array, such as string arrays or integer arrays. You may also need to use a different type of conversion function or change the formatting of your input expression to avoid this error.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
Replies
1
Views
6K
  • Programming and Computer Science
Replies
7
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
0
Views
2K
Back
Top