Don't know why it is showing incorrect?

22 views (last 30 days)
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)
  5 Comments
Sriram Tadavarty
Sriram Tadavarty on 8 May 2020
I just did try now and it works again.
Can you share your code that you tried? If possible even the screenshot showing the error of onramp.

Sign in to comment.

Accepted Answer

ravi meena
ravi meena on 12 Apr 2020
Edited: Image Analyst on 12 Apr 2020
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.
  8 Comments

Sign in to comment.

More Answers (3)

Ryan Leman
Ryan Leman on 2 May 2020
Edited: Ryan Leman on 2 May 2020
Just letting everyone know that I am having the same kind of issue on audio frequency tasks.
I even clicked on "see solution" and copy & pasted the entire thing so my version and the solution are identical. I submitted a report about this a few minutes ago w/ screen shot. I also noticed that it takes a little bit longer than usual to load the whole incorrect answer thing, maybe there is a bug causing it to timeout?
  1 Comment
Ryan Leman
Ryan Leman on 2 May 2020
Edited: Ryan Leman on 2 May 2020
little more info that might be relevant. My internet connection is fine however I did ping the host and got this.
Update: It seems to be working now, it finally let me pass. I think there might be some server silliness going on atm. I pinged it again at the time Onramp was working correctly and the ping was fine this time around. However a did it again a few moments after and got the same message as the picture below (the picture was from my original comment). This might also support the server silliness hypothesis.

Sign in to comment.


Kumar Shubham
Kumar Shubham on 12 Aug 2020
insert the spaces properly especially after of.

Sandra Feliciano
Sandra Feliciano on 11 Nov 2023
if doPlot==1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
else
disp("The density of " + element ...
+ " is " + density)
end

Categories

Find more on Downloads in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!