Assignment has more non-singleton rhs dimensions than non-singleton subscripts error

조회 수: 11 (최근 30일)
Hi everyone, I am running this for loop and I am getting the next message :Assignment has more non-singleton rhs dimensions than non-singleton subscripts. Could someone explain to me why? The goal in this exercise is to compute the H/V ratio for an incequake time series with a dimnesion of 721x6000.Thank you!!
mat1=zeros(721:length(EHV))
for i=1:length(ETB21)
EHV=(((ETB21N).^2)+((ETB21E).^2))/(((ETB21N).^2)+((ETB21E).^2)+((ETB21).^2));
mat1(i,:)=EHV
end
HVmn=mean(mat1,1);
plot(HVmn)

답변 (1개)

Walter Roberson
Walter Roberson 2019년 3월 18일
mat1 = zeros(721, length(EHV));
Notice the comma instead of colon.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by