use of modulus in matlab

4 ビュー (過去 30 日間)
Patel jaykumar Dipakbhai
Patel jaykumar Dipakbhai 2020 年 2 月 3 日
hello, i am trying two build a code in which i am using a formula which has difference between two quantities , but sometimes the difference between two can lead to a negative integer and i want to make it positive always as the output (like a modulus functon which when used returns non negative integres)
how can i do this in matlab"??
like can i use as .... X = | X2 -Y2 | ?
  2 件のコメント
Geoff Hayes
Geoff Hayes 2020 年 2 月 3 日
Patel - perhaps you could use abs.
Patel jaykumar Dipakbhai
Patel jaykumar Dipakbhai 2020 年 2 月 3 日
Thanks a lot sir

サインインしてコメントする。

回答 (1 件)

fred  ssemwogerere
fred ssemwogerere 2020 年 2 月 3 日
Please refer to the matlab documentation in your version of the software and search for: "abs". Alternatively refer to:
  1 件のコメント
Patel jaykumar Dipakbhai
Patel jaykumar Dipakbhai 2020 年 2 月 3 日
Thankyou very much.. I got the required syntax

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by