フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Why abs(-5) gives an array and not a single value?

1 回表示 (過去 30 日間)
Wen Shu Wong
Wen Shu Wong 2020 年 10 月 29 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I tried to use abs(-5) but it gives me an array of 107.1957 109.9616 103.5453 109.7126 103.4645 and not 5?
  1 件のコメント
Stephen23
Stephen23 2020 年 10 月 29 日
abs(-5)
ans = 5
Please show us the complete output of this command:
which abs -all

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 10 月 29 日
編集済み: Ameer Hamza 2020 年 10 月 29 日
Most probably, you have a function handle or function in your MATLAB path with the name abs(). Try following.
First, run
clear abs
and then run your code, if error persist, then run
which abs
If it gives a path to a user-defined file, change its name.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by