Not enough input arguments in Matlab R2021b
1 回表示 (過去 30 日間)
古いコメントを表示
function [K] = assembly_gl(Ke,gdl_bar,K)
%--Function that assembles the global stiffness matrix for the entire structure
%Ke=Enter the name of the finite element stiffness matrix you want to add
%gdl_bar=Vector containing the degrees of freedom of the finite element
%K=Specify the array in which the assembly will be stored
for igdl=1:4
ifila = gdl_bar(igdl);
for jgdl=1:4
jcolumna = gdl_bar(jgdl);
K(ifila,jcolumna) = K(ifila,jcolumna) + Ke(igdl,jgdl);
end
end
end
%I don't understand why the error comes out: Not enough input arguments.
%I have already entered all the arguments
%Please help me, thank you so much
2 件のコメント
採用された回答
VBBV
2022 年 7 月 24 日
Ke = randi(4,4); % assume this as FE stiffness matrix to be added
gdl_bar = [2 2 4 4]; % no of DOF for each element in stiffness
K = zeros(size(Ke)); % pre-allocate matrix to store assembly
K = assembly_gl(Ke,gdl_bar,K) % resulting assembled matrix you want
function [K] = assembly_gl(Ke,gdl_bar,K)
%--Function that assembles the global stiffness matrix for the entire structure
%Ke=Enter the name of the finite element stiffness matrix you want to add
%gdl_bar=Vector containing the degrees of freedom of the finite element
%K=Specify the array in which the assembly will be stored
for igdl=1:4
ifila = gdl_bar(igdl);
for jgdl=1:4
jcolumna = gdl_bar(jgdl);
K(ifila,jcolumna) = K(ifila,jcolumna) + Ke(igdl,jgdl);
end
end
end
give input matrix parameters to the function and pre-allocate any matrix used as argument in function
3 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!