I need your help. I would like to make a matrix of 15x2501 dimension. I'm using this code.
%values of Kh
Kh = [1*10.^-7 1*10.^-6.5 1*10.^-6 1*10.^-5.5 1*10.^-5 1*10.^-4.5 1*10.^-4 1*10.^-3.5 1*10.^-3 1*10.^-2.5 1*10.^-2 1*10.^-1.5 1*10.^-1 1*10.^-0.5 1*10.^0];
%
% Matrix by each value of Kh
HMC_Kh = zeros(length(Kh),2501);
for i = 1:length(Kh)
[H,ZH,h,Zh] = func_Kh(Kh(i));
HMC_Kh = [HMC_Kh; H];
end
when I run the code, matlab show me this message:
Error using vertcat
Dimensions of matrices being concatenated are not consistent.
Error in val_Kh_feb (line 13)
HMC_Kh = [HMC_Kh; H];
The function func_Kh returns a variable H of 1x2501 dimension maximum depending of value that take Kh, or the function func_Kh can be returns a variable H of 1 x 500 dimension minimum. That is, H changes with each value that Kh takes, so the matrix can be filled with zeros after the last value of H in each row when H is 1x500 dimensional so that each row has the same dimension of 1x2501.
I hope you can help me with this error, surely it must be silly, I learning matlab.
Thanks!
HMC_Kh = zeros(length(Kh),2501);
. – MichaelTr7