Hello everybody. I'm new with Matlab and maybe the problem I'm facing is trivial, but not for me. In my script I have two for loop which generate every time as result a vector. I want to store every one of this vector inside a matrix of the results. Therefore at the end I will have a matrix which has every index being a vector. I can't find the solution. In the following I will report my script:
%data of the problem C=linspace(5,20,30000); % [MPa] alpha=linspace(0.300,0.500,30000); % power law exponent d=9.5; % bar diameter A=70.9; % bar cross-sectional area E=41400; % bar Young's modulus
x=linspace(0,750,30000);
Nl=zeros(length(C),length(C)); %matrix in which I want to store the results
for i=1:length(C)
for k=1:length(alpha) N_x=(2.*E.*A./(1-alpha(k))).*(((2.*C(i).*(1-alpha(k)).^2)./(E.*d.*(1+alpha(k)))).^(1./(1-alpha(k)))).*x.^((1+alpha(k))./(1-alpha(k))); Nl(i,k)=N_x'; end
end
The error I get is:
Subscripted assignment dimension mismatch.
Error in untitled6 (line 20) Nl(i,k)=N_x';
Best Answer