Matrix dimensions must agree.
1 次查看(过去 30 天)
显示 更早的评论
??? Error using ==> plus
Matrix dimensions must agree.
Error in ==> assem at 28
K(t(i,:),t(i,:)) = K(t(i,:),t(i,:))+Ke;
Dear all, What the hell is this? what should I do? please help me out.
thanks
function [Ke]=bar3e(ex,ey,ez,ep)
%--------------------------------------------------------------------
E=ep(1); A=ep(2);
b=[ ex(2)-ex(1); ey(2)-ey(1); ez(2)-ez(1) ];
L=sqrt(b'*b);
Kle=E*A/L*[1 -1;
-1 1];
n=b'/L; G=[ n zeros(size(n));
zeros(size(n)) n ];
Ke=G'*Kle*G;
%--------------------------end--------------------------------
function [K,f]=assem(edof,K,Ke,f,fe)
%-------------------------------------------------------------
[nie,n]=size(edof);
t=edof(:,2:n);
for i = 1:nie
K(t(i,:),t(i,:)) = K(t(i,:),t(i,:))+Ke;
if nargin==5
f(t(i,:))=f(t(i,:))+fe;
end
end
%--------------------------end--------------------------------
5 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!