Unable to perform assignment because the left and right sides have a different number of elements.
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to build an array for calculating wind-gust factor ratios for different averaged time intervals and I am running into the error as described in the title of this post.
Script:
numdata = length(wspd);
numgusts = floor(numdata/600);
g3_60 = zeros(numgusts,1);
g3_600 = zeros(numgusts,1);
g60_600 = zeros(numgusts,1);
for qq = 1:numgusts
sp = 1 + (qq-1)*600;
ep = qq*600
g3_60(qq) = max(wspd3(ep:sp)) / max(wavg1(ep:sp));
g3_600(qq) = max(wspd3(ep:sp)) / W10(ep);
g60_600(qq) = max(wavg1(ep:sp)) / W10(ep);
end
For context, wspd3 is 3-sec averages or 3 data points for a file with data every second, wavg1 is 1 min data or 60 points, and W10 is 10 min data or 600 points. numdata = 43201 and numgusts = 72
I would appreciate any advice/answers! Thank you so much for your time!
0 件のコメント
採用された回答
DGM
2022 年 10 月 27 日
Your array indexes are backwards, so the RHS is zero-length
g3_60(qq) = max(wspd3(sp:ep)) / max(wavg1(sp:ep));
I don't know which index you intend to use in the indexing of W10.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!