I have such a code;
figure;
for a = 1:length(weekM')
tday_cell = day_cell(week_cell == weekM(a));
for b = 1:length(days)
subplot(length(weekM'), 7, b);
if strcmp(first_entranceM{a, b}, '0')
plot(peaks);
l = [l; 0];
else
tms_cell = ms_cell(week_cell == weekM(a));
ttms_cell = tms_cell(strcmp(tday_cell,days{b}));
l = [l; ttms_cell];
plot(ttms_cell);
end
end
end
I want to plot graphs with subplot function as subplot(3,7,[1:2:3...]). That is, I want to plot graph which has 3 lines, and 7 graphs on each line.
But in my case, it only shows the last line on the first line, and I can't see the remaining graphs.
I'm sure that the data to plot previous graphs are not being lost, but I don't understand why there are missing graphs.
Could you help me to fix this problem?
subplot(3,7,[1:2:3...])? Writingsubplot(3,7,[1:2:3])would the plot a single axis over the first, second and third grid location, which sounds contrary to what you desire. Also, when you say "lines" are you referring to line plots or rows of the grid formed by calling subplot?ttms_cell?subplotworks. I've marked this post as duplicate to a post I wrote a while ago. Read that, and you can figure out why your code isn't working. Hint: It's thebterm in yoursubplotcall.b.bterm needs to be changed. I didn't say that thebneeds to be adjusted... it does need to be completely changed :) I would personally just put a counter in at the beginning, and increment by 1 each time a plot is made... but yoursub2indstuff works too. I'm still gonna leave it as a duplicate because the code still lacks basic understanding on howsubplotworks.