Is there a Matlab function to find the minimum of 4 integers? Min only finds for 2 integers

 Respuesta aceptada

Karsten Reuß
Karsten Reuß el 19 de En. de 2017

0 votos

Do you mean this?
smallestnumber=min([3 5 6 7])

Más respuestas (1)

Guillaume
Guillaume el 19 de En. de 2017
Editada: Guillaume el 19 de En. de 2017

0 votos

Put all your integers in one array and call min, e.g.:
min([10 15 11 9])

2 comentarios

Ken
Ken el 19 de En. de 2017
Thanks
Ken
Ken el 19 de En. de 2017
Editada: Ken el 19 de En. de 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))])

Iniciar sesión para comentar.

Categorías

Más información sobre Aerospace Blockset en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

Ken
el 19 de En. de 2017

Editada:

Ken
el 19 de En. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by