minimum of 4 integers

5 ビュー (過去 30 日間)
Ken
Ken 2017 年 1 月 19 日
編集済み: Ken 2017 年 1 月 19 日
Is there a Matlab function to find the minimum of 4 integers? Min only finds for 2 integers

採用された回答

Karsten Reuß
Karsten Reuß 2017 年 1 月 19 日
Do you mean this?
smallestnumber=min([3 5 6 7])

その他の回答 (1 件)

Guillaume
Guillaume 2017 年 1 月 19 日
編集済み: Guillaume 2017 年 1 月 19 日
Put all your integers in one array and call min, e.g.:
min([10 15 11 9])
  2 件のコメント
Ken
Ken 2017 年 1 月 19 日
Thanks
Ken
Ken 2017 年 1 月 19 日
編集済み: Ken 2017 年 1 月 19 日
I am trying to evaluate this, but I want the answer in the expression for x and y; instead I am getting an integer. Please help:
min([(x-1 - Goal(1) +y - Goal(2)),(x+1- Goal(1) +y- Goal(2)),...
(x - Goal(1) +y-1 - Goal(2)),(x - Goal(1) +y+1 - Goal(2))])

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

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by