min and max of a vector
10 views (last 30 days)
Show older comments
soloby on 26 Jun 2015
Commented: Walter Roberson on 26 Jun 2015
I have 4 variables A, B, C, D
All 4 variables are a 1x20 vector containing random numbers
What i want to get is the minimum of a certain product
where I get a 1x20 vector containing minimum values of the product.
but these don't seem to be the solution I"m looking for. Help??
Jan on 26 Jun 2015
Did you read the documentation of min? You cannot provide 4 arrays as input. Please read the help and doc of a command.
Azzi Abdelmalek on 26 Jun 2015
Edited: Azzi Abdelmalek on 26 Jun 2015
Walter Roberson on 26 Jun 2015
In H = [A./D,A./E,B./C,B./D]; where are you getting your E from? It is not one of your original variables. Azzi has created a temporary E which is 4 x 20 in order to find the min; if you were executing with that then it is not the same size as your other variables so of course you have problems.
You should be paying attention to the fact that Azzi used ; between the parts instead of comma. If you were to use H = [A./C,A./D,B./C,B./D]; to be consistent with your original question, then you would be getting a 1 x 80 vector and min() of that is going to give you a single result.
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!