minimum of 4 integers

2 次查看(过去 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
编辑: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 CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by