我正在尝试执行此代码
clc;clear;
disp('nombre_de_travée');
NT=input('NT='); %nombre_de_travé
thetad=0;
thetag=0;
for i=1:NT
disp('longueur_de_travée');
l(i)=input(['l(' num2str(i) '):']);
disp('nombre_de_charge');
nch=input(['nch(' num2str(i) '):']); %nombre_de_charge
for j=1:nch
disp('type_de_charge');
nc(i,j)=input(['nc(' num2str(i) ',' num2str(j) ')1_2:']); %type_de_charge
if nc(i,j)==1
disp('charge concentrée')
a(i,j)=input(['a(' num2str(i) ',' num2str(j) '):']);
p(i,j)=input(['p(' num2str(i) ',' num2str(j) '):']);
thetad(i)=-p(i,j).*a(i,j).*l(i)./6+thetad;
thetag(i)=p(i,j).*a(i,j).*l(i)./3+thetag;
elseif nc(i,j)==2
disp('moment concentrée')
m(i,j)=input(['m(' num2str(i) ',' num2str(j) '):']);
thetad(i)=-m(i,j).*l(i)./6+thetad;
thetag(i)=m(i,j).*l(i)./3+thetag;
end
end
end
但会显示错误消息:
??? In an assignment A(I) = B, the number of elements
in B and
I must be the same.