Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: matrix function that compare a list of real numbers with a real number
Replies: 3   Last Post: Nov 20, 2012 10:52 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Curious

Posts: 2,007
Registered: 12/6/04
Re: matrix function that compare a list of real numbers with a real number
Posted: Nov 20, 2012 10:52 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"felix " <f_3lix@hotmail.com> wrote in message <k8d4le$dmc$1@newscl01ah.mathworks.com>...
> I need a function which accepts as input a list of real numbers, and a real number X and which returns to the output:
> ? The number of how many times the number (X) appear in the table
> ? The location where this number appears in the table
> ? A table that will have the value 0 in the positions where (X) appears and the value -1 in the remaining positions
> ? A table(matrix) where the elements of the original matrix that is larger than the input number (X) will be replaced with the maximum number of the original table
> ? A vector which will contain all the unique elements of the input table which are larger than the number(X) we gave to the entrance.


Before trying to compare real numbers,
you should read item 6.1 of the MATLAB FAQ at:

http://matlab.wikia.com/wiki/FAQ

Specifically:

http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.