Variable q10 must be of data type double. It is currently of type sym. Check where the variable is assigned a value.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I was wondering what to do to chane my data type to double? I am very new to matlab and this is the only error that is coming up in my assignment
P = [3,2,-1];
Q = [5,0,1];
n = [4,7,-2];
syms x y z
f(x,y,z) = (4*(x-3)+7*(y-2)-2*(z+1));
q10 = abs((f(5,0,1))/(norm(n)))
Respuestas (1)
Steven Lord
el 6 de Feb. de 2024
As you can see from the fact that your code ran in MATLAB Answers, your code does work. I'm assuming that you're running this in something like MATLAB Grader or MATLAB Onramp that checks certain qualities (chosen by the problem author) about the results.
In that case you're likely going to want to convert the symbolic answer into its numeric (double) representation.
P = [3,2,-1];
Q = [5,0,1];
n = [4,7,-2];
syms x y z
f(x,y,z) = (4*(x-3)+7*(y-2)-2*(z+1));
q10 = abs((f(5,0,1))/(norm(n)))
D = double(q10)
format longg
D
0 comentarios
Ver también
Categorías
Más información sobre Number Theory en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!