Matrix Function to Finite Element Method

1 vue (au cours des 30 derniers jours)
Rafael Zanetti
Rafael Zanetti le 17 Avr 2020
Commenté : Ameer Hamza le 18 Avr 2020
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.

Réponse acceptée

Ameer Hamza
Ameer Hamza le 17 Avr 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 commentaires
Rafael Zanetti
Rafael Zanetti le 17 Avr 2020
Thank you Ameer Hamza
Ameer Hamza
Ameer Hamza le 18 Avr 2020
I am glad to be of help.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by