I want loop several sea level change data from the database
2 次查看(过去 30 天)
显示 更早的评论
data14years=load('Ziliang_data.mat');
%remove seasonal cycle
%find location that are close to 5
%degrees.(151.0831,156.0832,161.0832,166.0833,171.0833)
seachange1=data14years.zetaData(:,2);
seachange2=data14years.zetaData(:,62);
seachange3=data14years.zetaData(:,n);
days=1:length(data14years.zetaData(:,1));
I want to loop the number of location at 32:30:300 and save these data to get all final
0 个评论
回答(1 个)
Jaynik
2023-10-6
Hi,
According to my understanding, you want to loop on indices of "data14years.zetaData" initialized at 32 and ending at or before 300 with intervals of 30. You can create a "cell array" to store all the final data and then directly loop over it to store the data. Following is a sample code to perform the loop operation:
finalSeaExchange = cell(1, 10);
index = 1;
for n = 32:30:300
seachangeN = data14years.zetaData(:, n);
% Perform any desired operations on seachangeN here
finalSeaExchange{index} = seachangeN;
index = index + 1;
end
Refer the following link to learn more about "cell array":
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!