Nothing shows up on plot?
Ältere Kommentare anzeigen
MM = 24;
days = 1;
while MM > 0
MM = MM - randi(5);
MM = MM - 7;
days = days + 1;
end
days
plot(days,MM)
%I'm trying to plot the values of MM on the y axis for days 1-4 on the x axis but nothing shows up on the plot.
1 Kommentar
Christina Allen
am 19 Apr. 2021
Antworten (1)
Jonas
am 19 Apr. 2021
0 Stimmen
your plot contains only one data point because days is 1 x 1 and MM is 1 x1. If you are interested the sequence of data you also have to store the sequence of data
2 Kommentare
Christina Allen
am 19 Apr. 2021
Jonas
am 19 Apr. 2021
just add something during the while like dailyValues(days)=MM . i'm not sure which value you want to save per day
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!