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

11 vues (au cours des 30 derniers jours)
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)

Réponses (1)

Walter Roberson
Walter Roberson le 18 Mar 2019
mat1 = zeros(721, length(EHV));
Notice the comma instead of colon.

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by