From: "Jan Simon" <>
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$>
References: <i1mov9$m1f$>
Reply-To: "Jan Simon" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1279193885 1670 (15 Jul 2010 11:38:05 GMT)
NNTP-Posting-Date: Thu, 15 Jul 2010 11:38:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869888
Xref: 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?