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 comentarios

muhammad waseem
muhammad waseem el 31 de Mayo de 2021
Error in below command
k1=PlaneTrussElementStiffness(E,A,L1,theta1)
muhammad waseem
muhammad waseem el 31 de Mayo de 2021
please solve this problem
Walter Roberson
Walter Roberson el 31 de Mayo de 2021
What you posted is fine. Perhaps there is a problem inside PlaneTrussElementStiffness which you did not post the code for.
Sulaymon Eshkabilov
Sulaymon Eshkabilov el 31 de Mayo de 2021
can you post the produced err in the command window?

Iniciar sesión para comentar.

Respuestas (1)

KSSV
KSSV el 31 de Mayo de 2021
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

Categorías

Más información sobre Function Creation en Centro de ayuda y File Exchange.

Productos

Versión

R2020b

Preguntada:

el 31 de Mayo de 2021

Respondida:

el 31 de Mayo de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by