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
muhammad waseem 2021년 5월 31일
Error in below command
k1=PlaneTrussElementStiffness(E,A,L1,theta1)
muhammad waseem
muhammad waseem 2021년 5월 31일
please solve this problem
Walter Roberson
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
Sulaymon Eshkabilov 2021년 5월 31일
can you post the produced err in the command window?

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2021년 5월 31일

0 개 추천

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에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 5월 31일

답변:

2021년 5월 31일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by