Calculates the total difference between two numbers

35 vues (au cours des 30 derniers jours)
I want it to calculate the difference between two given numbers.
1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Torsten le 6 Nov 2022
a = 5;
b = 3;
difference = a-b
difference = 2

Connectez-vous pour commenter.

Réponses (1)

Guru Kumaresan le 9 Nov 2022
Modifié(e) : Guru Kumaresan le 9 Nov 2022
I understand that you are trying to find the difference between two numbers. For this purpose, you can use absolute value function available in MATLAB.
Example:
a = 2;
b = 5;
Diff = abs(a-b);
Diff will have the value of 3.
Hope this helps!
0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by