Path: news.mathworks.com!not-for-mail
From: "Ulrik Nash" <uwn@sam.sdu.dk>
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$1@fred.mathworks.com>
References: <i1mov9$m1f$1@fred.mathworks.com> <i1mrus$1k6$1@fred.mathworks.com>
Reply-To: "Ulrik Nash" <uwn@sam.sdu.dk>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1279196587 17586 172.30.248.37 (15 Jul 2010 12:23:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 Jul 2010 12:23:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2106050
Xref: news.mathworks.com comp.soft-sys.matlab:653341

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <i1mrus$1k6$1@fred.mathworks.com>...
> 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.

Ulrik.