From: "Ulrik Nash" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How do I reduce this to one line from two lines?
Date: Thu, 15 Jul 2010 12:23:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <i1mujb$h5i$>
References: <i1mov9$m1f$> <i1mrus$1k6$>
Reply-To: "Ulrik Nash" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1279196587 17586 (15 Jul 2010 12:23:07 GMT)
NNTP-Posting-Date: Thu, 15 Jul 2010 12:23:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2106050
Xref: comp.soft-sys.matlab:653341

"Jan Simon" <> wrote in message <i1mrus$1k6$>...
> Dear Ulrik,
> > I it possible to reduce the following to a single line?
> > A = max([firm_profit(:,t),firm_price(:,t)])
> > B = A(1,1)
> I do not see a benefit in redusing the number of lines.
> If you want to have the variables A and B, it is not possible. But if you want just B to be the maximum of the first column, you can omit the 2nd column:
>   B = max(firm_profit(:, t));
> Are you sure, that this is what you want to get?
> Jan

Hi Jan, 

What I want to achieve is an isolation of the price at which profit is greatest. I was hoping this could be done in a single line, to get a single value.