what's the program mistake?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MA
el 3 de Jun. de 2014
Comentada: MA
el 3 de Jun. de 2014
clear all
clc;
syms a b c
w=zeros(3,1);
w(1,1)=3*a+b;
w(2,1)=b+2;
w(3,1)=c-a;
disp(w)
b=3;
disp(w)
2 comentarios
Respuesta aceptada
Sean de Wolski
el 3 de Jun. de 2014
w = sym(zeros(3,1))
You preallocated w as a numeric type and then tried to stuff a sym into it. If you preallocate w as a symbolic, it works as expected.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!