Calculates the total difference between two numbers

28 visualizaciones (últimos 30 días)
Adam
Adam el 6 de Nov. de 2022
Editada: Guru Kumaresan el 9 de Nov. de 2022
I want it to calculate the difference between two given numbers.

Respuestas (1)

Guru Kumaresan
Guru Kumaresan el 9 de Nov. de 2022
Editada: Guru Kumaresan el 9 de Nov. de 2022
Hi Adam,
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!

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by