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!

채택된 답변

DGM
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개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by