MATLAB: Don’t know why it is showing incorrect

errorMATLABonline_trainingonramptraining

I get an incorrect mark in the task(2) of 13.2 section of Matlab onramp course.Even if i saw the solution in the see solution option and entered the same the error still shows.
the task is given below:
Modify the script so that when the if condition is not satisfied, the following line of code is executed:
disp("The density of " + element …
+ " is " + density)

Best Answer

It will work when you enter the code carefully. For example, if you will enter
disp("The density of" + element...
+ " is " + density )
it will not work but, instead of this enter
disp("The density of " + element...
+ " is " + density )
there is a space after of and it will work.
Related Question