missing graphs in subplot in matlab -


i have such code;

figure;     = 1:length(weekm')         tday_cell = day_cell(week_cell == weekm(a));         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 plot graphs subplot function subplot(3,7,[1:2:3...]). is, want plot graph has 3 lines, , 7 graphs on each line.

but in case, shows last line on first line, , can't see remaining graphs.

i'm sure data plot previous graphs not being lost, don't understand why there missing graphs.

could me fix problem?

your line subplot-statement needs changed. first argument correct. second argument represents number of columns , needs set 7 here, since have 7 days. last argument index of addressed subplot , needs changed in every iteration.

this index can generated using sub2ind-function, calculates index subscripts. following line can used instead of yours:

subplot(length(weekm'),7,sub2ind([7,length(weekm')],b,a)); 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -