How to add rows of zeroes in matrices/excel spreadsheet with code (MATLAB)?

后端 未结 1 1787
粉色の甜心
粉色の甜心 2021-01-29 11:34

I made this program were the user can type in a year between 2009 and 2011 and get snow depth and air temperature data for the chosen year displayed on a graph.

I have o

相关标签:
1条回答
  • 2021-01-29 12:05

    Try this,

    snowDepth_full = zeros(365,3); % make a temporary variable to hold everything
    snowDepth_full(1:121,:)  = snowDepth(1:121,:);   % First 121 days up to april 30
    snowDepth_full(end-90,:) = snowDepth(122:end,:); % Last 91 days from oct 1 on
    snowDepth = snowDepth_full;  % Copy it back 
    

    Then as before...

    snowdepth2009 = snowdepth(:,1);
    snowdepth2010 = snowdepth(:,2);
    snowdepth2011 = snowdepth(:,3);
    ...
    
    0 讨论(0)
提交回复
热议问题