Stuck at MATLAB Onramp

Hey guys.
I'm stuck on the self-paced MATLAB Onramp course. The section is 13.2 Decision Branching and I'm at Furher Practice. I have no idea how I'm supposed to add the "elseif" statement with "doDisplay". Can anyone show me thier take on this problem?

5 commentaires

Sneham Shrikant Vaidya
Sneham Shrikant Vaidya le 16 Mai 2020
if doPlot
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
else
disp("The density of" + element + "is" + density)
end
//just paste this code
or remove the dashed line in front of element is soluttion
Anushka Tilekar
Anushka Tilekar le 19 Mai 2020
Is the MATLAB Onramp course available free of cost ? Will I get a certificate of completion after finishing it ?
Walter Roberson
Walter Roberson le 19 Mai 2020
Yes, and Yes.
Surya Karthik Nadupalle
Surya Karthik Nadupalle le 23 Août 2020
Guys please help me with last 4 questions of Matlab in 14.2 section
PANKAJ KUMAR
PANKAJ KUMAR le 21 Jan 2021
I if get this matlab onramp or any other onramp certificate,can i keep it for free for ever without paying? or will i have to pay for it after my 30 day trial or after sometime?

Connectez-vous pour commenter.

Réponses (2)

Vimal Rathod
Vimal Rathod le 26 Avr 2020

5 votes

Hi,
The question is a bit ambiguos at start but if you look at the code carefully you will understand the each step.
It asks you to create a "doDisplay" variable, you can do that by creating a variable same as doPlot below the doPlot variable.
doPlot = randi([0 1]);
doDisplay = randi([0 1]);
It asks you to add an elseif block which can toggle whether it can display the densities or not.
if doPlot
...
elseif doDisplay
%Print the densities
else
%Print nothing just leave it with a comment for readability.
end

3 commentaires

Anushka Tilekar
Anushka Tilekar le 19 Mai 2020
Is the MATLAB Onramp course available free of cost ? Will I get a certificate of completion after finishing it ?
Walter Roberson
Walter Roberson le 15 Sep 2020
Yes, it is available free. My understanding is that there is a certificate upon completion.
Lixin Zhen
Lixin Zhen le 11 Mai 2023
Will there be a certificate upon completion of the MATLAB self-paced fundamentals course (16.5 hours)?

Connectez-vous pour commenter.

Izma Shaikh
Izma Shaikh le 14 Sep 2021

0 votes

Load the file Cchord.mat.
Create a variable named n that contains the number of elements in y. Then use n to create an evenly-spaced vector t that starts at 0, ends at n-1, and has elements that are spaced by 1.

Catégories

En savoir plus sur File Operations dans Centre d'aide et File Exchange

Question posée :

le 19 Avr 2020

Commenté :

le 11 Mai 2023

Community Treasure Hunt

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

Start Hunting!

Translated by