Path: news.mathworks.com!not-for-mail
From: "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How do I reduce this to one line from two lines?
Date: Thu, 15 Jul 2010 11:38:05 +0000 (UTC)
Organization: Universit&#228;t Heidelberg
Lines: 12
Message-ID: <i1mrus$1k6$1@fred.mathworks.com>
References: <i1mov9$m1f$1@fred.mathworks.com>
Reply-To: "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de>
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 1279193885 1670 172.30.248.37 (15 Jul 2010 11:38:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 Jul 2010 11:38:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869888
Xref: news.mathworks.com comp.soft-sys.matlab:653331

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