converting sym to double
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Parth Jain
el 19 de Mzo. de 2020
Comentada: Parth Jain
el 19 de Mzo. de 2020
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.
0 comentarios
Respuesta aceptada
Sriram Tadavarty
el 19 de Mzo. de 2020
Hi Parth,
Do not define the K with double variables and that should help. Instead directly create the matrix with those many symbolic variables.
Hope this helps.
Regards,
Sriram
0 comentarios
Más respuestas (1)
Steven Lord
el 19 de Mzo. de 2020
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));
Ver también
Categorías
Más información sobre Conversion Between Symbolic and Numeric en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!