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: find location in matrix and print min and max for each column batch
Replies: 9   Last Post: Nov 24, 2012 6:26 PM

Advanced Search

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

Posts: 5
Registered: 11/23/12
Re: find location in matrix and print min and max for each column
Posted: Nov 24, 2012 3:45 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <none@non.net> wrote in message <k8r4vc$psc$1@speranza.aioe.org>...
> On 11/24/2012 12:03 PM, Michael wrote:
> ...
>

> > I read the doc max info and I even have been looking in my textbook, but
> > when I tried the different syntaxes, my program still didn't give me the
> > batch number of the max and min temperature, pressure, and dwell time.
> > Please Help!!!

>
> cs-sm respondents don't actually _do_ homework problems directly as a
> general rule...hints and specific questions on syntax or the like are
> kosher but it would be taking from the learning process to just plop and
> answer out there on a plate.
>
> Trust me, what you need is there in the documentation...think about what
> it is that you need to know to retrieve the values desired...and then
> how to use what max/min can tell you to do that.
>
> Post what you've tried...specifically for that problem, _not_ the entire
> chunk of code.
>
> --


I completely understand. I don't expect you to do the problem for me, just some good advice is perfect. I think though this problem requires more than just using max and min, I believe it wants us to use max, min with the find command or something. Here is my user-defined function and what I have tried for that problem:
Also here is my suture data. The * is what I am having a problem with.

Batch Number Temperature Pressure Dwell Time
24551 145.5 62.3 2.23
24582 153.7 63.2 2.52
26553 160.3 58.9 2.51
26623 159.5 58.9 2.01
26642 160.3 61.2 1.98

function [n,Max,Min,p] = func(a,b,x)
n = find(x<a|x>b);
*Max = max(x);*
*Min = min(x);*
p = (length(n)/length(x))*100;

c = s(:,2);
[n,Max,Min,p] = func(150,170,c);
fprintf('The batch number with minimum temperature is: %3.0f \n', *Min*);
fprintf('The batch number with maximum temperature is: %3.0f \n \n', *Max*);

I'm am trying to print out the batch number with maximum and minimum temperature, not the max and min temperature.



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.