Min and Max value

Min and Max value - Сообщения

#1 Опубликовано: 13.07.2010 16:16:47
Edward Ulle

Edward Ulle

20 сообщений из 182 понравились пользователям.

Группа: Moderator

Typically the functions min and max return the minumum or maximum value of a list of operands. For example

x:=max(1.1,2.2,3.3,-5.5) would return 3.3 and like wise for minimum.

The SMath functions min and max return the minimum or maximum value of a matrix.

To accomplish this in SMath requires a lot of if ... else statements.

Can this be implemented in SMath and make the min and max functions mmin and mmax for matrix operations?
Ed
#2 Опубликовано: 14.07.2010 10:01:45
Edward Ulle

Edward Ulle

20 сообщений из 182 понравились пользователям.

Группа: Moderator

Or I realized, the function can check to see if the parameter passed is a matrix or vector, then do what it currently does. If its a list of operands, return the min or max of the list of values.
Ed
#3 Опубликовано: 14.07.2010 11:37:06
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

Wrote

Or I realized, the function can check to see if the parameter passed is a matrix or vector, then do what it currently does. If its a list of operands, return the min or max of the list of values.


Yes, this is optimal way how it should work. I'll try to find a time to improve min(..) and max(..) functions later.

Regards.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений