Don't know why it is showing incorrect?
Mostra commenti meno recenti
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)
6 Commenti
Sriram Tadavarty
il 13 Mar 2020
Hi Varun,
Make sure if you included the condition correctly. A screenshot about the issue will help.
% For example, taking random values, as the values and condition is not known
element = 1;
density = 10;
cond = 0;
if ~(cond)
disp("The density of " + element ...
+ " is " + density)
end
This should work.
Can you once try in the above lines and do let know?
Regards,
Sriram
Syed Hammad
il 25 Mar 2020
I have also face the same problem. Also use above code but still facing the same error
error is: "Are the densities displayed when doPlot is 0?"
Harpreet Singh Whan
il 8 Mag 2020
@ Sriram Sir, i am facing the same problem too. it isn"t working!
Sriram Tadavarty
il 8 Mag 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.
Sachin Chavan
il 6 Giu 2020
i am facing same problem

Héctor Mauricio
il 30 Mag 2024
if doPlot
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
else
x=("The density of " + element ...
+ " is " + density)
disp(x)
plot=[];
end
Risposta accettata
Più risposte (3)
Ryan Leman
il 2 Mag 2020
Modificato: Ryan Leman
il 2 Mag 2020
1 voto
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 Commento
Ryan Leman
il 2 Mag 2020
Modificato: Ryan Leman
il 2 Mag 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.

Kumar Shubham
il 12 Ago 2020
1 voto
insert the spaces properly especially after of.

Sandra Feliciano
il 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
Categorie
Scopri di più su Downloads in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!