minimum of 4 integers

4 Ansichten (letzte 30 Tage)
Ken
Ken am 19 Jan. 2017
Bearbeitet: Ken am 19 Jan. 2017
Is there a Matlab function to find the minimum of 4 integers? Min only finds for 2 integers

Akzeptierte Antwort

Karsten Reuß
Karsten Reuß am 19 Jan. 2017
Do you mean this?
smallestnumber=min([3 5 6 7])

Weitere Antworten (1)

Guillaume
Guillaume am 19 Jan. 2017
Bearbeitet: Guillaume am 19 Jan. 2017
Put all your integers in one array and call min, e.g.:
min([10 15 11 9])
  2 Kommentare
Ken
Ken am 19 Jan. 2017
Thanks
Ken
Ken am 19 Jan. 2017
Bearbeitet: Ken am 19 Jan. 2017
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))])

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by