Calling function error in MAtlab
显示 更早的评论
E=70e6
A= 0.004
L1=3.5
theta1=90
L2=4
theta2=0
L3=5.3151
theta3= atan(3.5/4)*180/pi
L4=L3
theta4=360-theta3
L5=4
theta5=0
L6=3.5
theta6=270
k1=PlaneTrussElementStiffness(E,A,L1,theta1)
4 个评论
muhammad waseem
2021-5-31
muhammad waseem
2021-5-31
Walter Roberson
2021-5-31
What you posted is fine. Perhaps there is a problem inside PlaneTrussElementStiffness which you did not post the code for.
Sulaymon Eshkabilov
2021-5-31
can you post the produced err in the command window?
回答(1 个)
KSSV
2021-5-31
I guess you have not downloaded/ copied the function PlaneTrussElementStiffness in your working folder. It is not an inbuilt function, it is a user written function. You need to download the function. The function is given below and taken from the link https://github.com/seevven/matlab_vision/blob/master/M-Files/PlaneTrussElementStiffness.m .
function y = PlaneTrussElementStiffness(E,A,L, theta)
%PlaneTrussElementStiffness This function returns the element
% stiffness matrix for a plane truss
% element with modulus of elasticity E,
% cross-sectional area A, length L, and
% angle theta (in degrees).
% The size of the element stiffness
% matrix is 4 x 4.
x = theta*pi/180;
C = cos(x);
S = sin(x);
y = E*A/L*[C*C C*S -C*C -C*S ; C*S S*S -C*S -S*S ;
-C*C -C*S C*C C*S ; -C*S -S*S C*S S*S];
end
类别
在 帮助中心 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!