- Comment out A = double(A) and observe all the outputs in symbolic variables
- Provide values to A before double A and see the values in the numeric form, by using subs function
I keep getting the following error "Unable to convert expression into double array" for the code given below, please help
1 view (last 30 days)
syms x1 x2 y1 y2
Q=input('enter the quadratic form Q(x1,x2):');
A=[a11 a12; a12 a22]
disp('Matrix of Q is')
%disp('Orthogonal matrix (N) reduces A to diagonal matrix D : ')
disp('The canonical quadratic form of Q is')
disp('The orthogonal transformation (X=NY) is')
Sriram Tadavarty on 30 Jul 2020
Hi Ruban Karthik,
The issue you observe is due to the conversion of symbolic variables to double.
For the input provided, the differential equation contains symbolic variables, thus, it can't be converted to double. Once the symbolic variables are provided with values, you can get rid of the error.
Two suggestions to overcome this:
Hope this helps.