Variable q10 must be of data type double. It is currently of type sym. Check where the variable is assigned a value.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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)))
Antworten (1)
Steven Lord
am 6 Feb. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Number Theory finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!