dpb <email@example.com> wrote in message <firstname.lastname@example.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.