Matrix Function to Finite Element Method

Hi, I'm trying to create a function with matrix, but a heve not got, the results shall be k1 = [100 -100; -100 100], and my function have been that:
function y = SpringElementStiffness(k)
y = [k -k; -k k];
end
k1=SpringElementStiffness(100)
I Thank you by your attention.

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 17 de Abr. de 2020
Create a file named SpringElementStiffness.m:
function y = SpringElementStiffness(k)
y = [k -k; -k k];
end
and then in the command window, run
>> k1=SpringElementStiffness(100)
k1 =
100 -100
-100 100

2 comentarios

Rafael Zanetti
Rafael Zanetti el 17 de Abr. de 2020
Thank you Ameer Hamza
Ameer Hamza
Ameer Hamza el 18 de Abr. de 2020
I am glad to be of help.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Productos

Preguntada:

el 17 de Abr. de 2020

Comentada:

el 18 de Abr. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by