why does this line of code give error- disp(“The density of ” + element … + “is” + density). When i press the ‘enter ‘ key after the 3 dots and rerun, it works.
if doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
else
disp("The Density of " + element … + "is" + density)
endif doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
else
disp("The Density of " + element … + "is" + density)
end if doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
else
disp("The Density of " + element … + "is" + density)
end if statement MATLAB Answers — New Questions