Greetings to al my name JOSE LUIS HUAYNAY VILLAR, I have the following error problem;
Size mismatch (size [1 x 11] ~= size [1 x 10]).
the program indicates the error to me in this line, that seems strange to me
Function 'MATLAB Function3' (#169.624.635), line 21, column 17: "D(k+1)+D(j)" Launch diagnostic report.
and this is my code, please someone help me:
function dot_theta = fcn(theta,theta_0,theta_f)dot_theta=size(10,1);D=size(10,1);K=size(10,1);L=50; %comprimento
z=linspace(0,L,10); theta_r = 0.218; alpha= 0.0115; K_s = 31.6; theta_s=0.52; dz=L/length(z);b=1/(2*dz^2);n = 2.03;m=1-(1/n);i=2:length(z),j=1:length(z),k=0:length(z),D=(K_s*(1-m)/(alpha*m*(theta_s-theta_r)))*dot(theta,theta);K=(K_s*(1-m)/(alpha*m*(theta_s-theta_r)))*dot(theta,theta);dot_theta =b*((D(k+1)+D(j))*(theta(k+1)-theta(j))- b*(D(i-1)+D(j))*(theta(j)-theta(i-1))+((K(j)-K(i-1))/Delta_z));
Best Answer