Calculates the total difference between two numbers
이전 댓글 표시
I want it to calculate the difference between two given numbers.
댓글 수: 1
a = 5;
b = 3;
difference = a-b
답변 (1개)
Guru Kumaresan
2022년 11월 9일
편집: Guru Kumaresan
2022년 11월 9일
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!
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!