Decision Branching, modification Script

조회 수: 82 (최근 30일)
Francis Adams Kwofie
Francis Adams Kwofie 2021년 7월 5일
댓글: Niklas 2023년 9월 12일
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
bhuvan lekkala
bhuvan lekkala 2021년 11월 10일
this is correct
Muhammad Mansoor khan
Muhammad Mansoor khan 2022년 9월 7일
Reenter this code
if doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end

댓글을 달려면 로그인하십시오.

답변 (9개)

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

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

Manisha Sonewane
Manisha Sonewane 2021년 9월 29일
If doPlot==1 %%plotting code; end
  댓글 수: 1
bhuvan lekkala
bhuvan lekkala 2021년 11월 10일
this is wrong and its shows errors and its just a hint

댓글을 달려면 로그인하십시오.


Harshada Pawar
Harshada Pawar 2022년 1월 9일
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")

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

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

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

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

Hojiboy
Hojiboy 2023년 5월 15일
if doPlot == 1
plot(density)
title("Sample Densities")
xticklabels(element)
ylabel("Density (g/cm^3)")
end
  댓글 수: 1
Niklas
Niklas 2023년 9월 12일
All answers above will lead to:
Test Results:
Incorrect!
When doPlot is 0, did you not plot the data?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by