Decision Branching, modification Script
51 views (last 30 days)
Show older comments
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 Comments
Muhammad Mansoor khan
on 7 Sep 2022
Reenter this code
if doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end
Answers (9)
Dhruv G
on 5 Jul 2021
if doPlot
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end
0 Comments
KAPIL DEV YADAV
on 10 Jun 2022
if doPlot==1
plot(5,8)
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end
0 Comments
Harshada Pawar
on 9 Jan 2022
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
0 Comments
Thameemul Ansari Kaja
on 17 Jan 2022
if doPlot==1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end
0 Comments
Samuel Kwesi Tandoh
on 30 Mar 2022
if doPlot==1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end
0 Comments
chaymae saibari
on 3 Apr 2022
if doPlot==1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end
0 Comments
Hashim Albasher
on 1 Feb 2023
if doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end
0 Comments
See Also
Categories
Find more on Graphics Object Programming 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!