Assignment has more non-singleton rhs dimensions than non-singleton subscripts error
11 views (last 30 days)
Show older comments
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)
0 Comments
Answers (1)
Walter Roberson
on 18 Mar 2019
mat1 = zeros(721, length(EHV));
Notice the comma instead of colon.
0 Comments
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!