Display in the command window
my code looks as follows but i don’t understand why the values of x and z won’t display on the command window. The values are supposed to plot a semicircle.
startUpHeight = 299.07;
startUpValue = 100;
radius = 15;
minConstraintX = 150;
maxConstraintX = 50;
minConstraintZ = 10;
maxConstraintZ = 300;
for x = (startUpValue – radius):0.25:(startUpValue + radius)
if ((maxConstraintX >= x) && (x >= minConstraintX))
z = -1*((sqrt(radius^2)-((x-(3*radius))^2)) – startUpHeight);
if ((maxConstraintZ >= z) && (z >= minConstraintZ))
disp([‘x: ‘, num2str(x), ‘, z: ‘, num2str(z)]);
end
end
endmy code looks as follows but i don’t understand why the values of x and z won’t display on the command window. The values are supposed to plot a semicircle.
startUpHeight = 299.07;
startUpValue = 100;
radius = 15;
minConstraintX = 150;
maxConstraintX = 50;
minConstraintZ = 10;
maxConstraintZ = 300;
for x = (startUpValue – radius):0.25:(startUpValue + radius)
if ((maxConstraintX >= x) && (x >= minConstraintX))
z = -1*((sqrt(radius^2)-((x-(3*radius))^2)) – startUpHeight);
if ((maxConstraintZ >= z) && (z >= minConstraintZ))
disp([‘x: ‘, num2str(x), ‘, z: ‘, num2str(z)]);
end
end
end my code looks as follows but i don’t understand why the values of x and z won’t display on the command window. The values are supposed to plot a semicircle.
startUpHeight = 299.07;
startUpValue = 100;
radius = 15;
minConstraintX = 150;
maxConstraintX = 50;
minConstraintZ = 10;
maxConstraintZ = 300;
for x = (startUpValue – radius):0.25:(startUpValue + radius)
if ((maxConstraintX >= x) && (x >= minConstraintX))
z = -1*((sqrt(radius^2)-((x-(3*radius))^2)) – startUpHeight);
if ((maxConstraintZ >= z) && (z >= minConstraintZ))
disp([‘x: ‘, num2str(x), ‘, z: ‘, num2str(z)]);
end
end
end display MATLAB Answers — New Questions