Azzera filtri
Azzera filtri

Decision Branching, modification Script

56 visualizzazioni (ultimi 30 giorni)
Francis Adams Kwofie
Francis Adams Kwofie il 5 Lug 2021
Modificato: PUJA il 20 Apr 2024
Modify the script so that the plotting code on lines 4-7 are executed only when doPlot is 1.
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
  2 Commenti
Muhammad Mansoor khan
Muhammad Mansoor khan il 7 Set 2022
Reenter this code
if doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end

Accedi per commentare.

Risposte (9)

Dhruv G
Dhruv G il 5 Lug 2021
if doPlot
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end

KAPIL DEV YADAV
KAPIL DEV YADAV il 10 Giu 2022
if doPlot==1
plot(5,8)
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end

Manisha Sonewane
Manisha Sonewane il 29 Set 2021
If doPlot==1 %%plotting code; end

Harshada Pawar
Harshada Pawar il 9 Gen 2022
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")

Thameemul Ansari Kaja
Thameemul Ansari Kaja il 17 Gen 2022
if doPlot==1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end

Samuel Kwesi Tandoh
Samuel Kwesi Tandoh il 30 Mar 2022
if doPlot==1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end

chaymae saibari
chaymae saibari il 3 Apr 2022
if doPlot==1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end

Hashim Albasher
Hashim Albasher il 1 Feb 2023
if doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end

Hojiboy
Hojiboy il 15 Mag 2023
if doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end
  2 Commenti
Niklas
Niklas il 12 Set 2023
All answers above will lead to:
Test Results:
Incorrect!
When doPlot is 0, did you not plot the data?
PUJA
PUJA il 20 Apr 2024
Modificato: PUJA il 20 Apr 2024
Modify the script so that the plotting code on lines 5-8 execute only if doPlot is 1.
Answer:
if doPlot == 1
x=5
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end

Accedi per commentare.

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by