I have a double variable called Num_Firm_An with 3 columns and 60000 rows.
Num_Firm_An=[1994 12 191994 13 161994 16 121994 18 271994 19 15]
I tried the following two codes:
Code 1:
mean(Num_Firm_An(:,3))
Code 2:
year=1994:2013for n=1:length(year) NFA=Num_Firm_An(Num_Firm_An(:,1)==year(n),:); m=mean(NFA(:,3)); s=std(NFA(:,3)); NFAmean{n}=m; NFAstd{n}=s; end
Code one gives the overall mean throughout the years. Code two should provide a final variable with both means and standard deviations for all the years.
Both codes are giving me the follwoing error: Index exceeds matrix dimensions. And I am not being able to solve it. Can someone help me? Thanks
Best Answer