Path: news.mathworks.com!not-for-mail
From: "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Selecting values in a vector, based on index of another vector
Date: Thu, 8 Jul 2010 14:29:07 +0000 (UTC)
Organization: Universit&#228;t Heidelberg
Lines: 12
Message-ID: <i14nbj$edq$1@fred.mathworks.com>
References: <i148fd$lrn$1@fred.mathworks.com> <i14a5m$74p$1@fred.mathworks.com> <i14b5g$8jd$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 1278599347 14778 172.30.248.37 (8 Jul 2010 14:29:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 8 Jul 2010 14:29:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869888
Xref: news.mathworks.com comp.soft-sys.matlab:651425

Dear Ulrik,

> > > firm_id_selection = [1 3 4]
> > > firm_prices_all = [10.25 11.00 9.75 22.50 10.99]
> > > firm_prices_selection = [10.25 9.75 22.50]

> firm_prices_selection = ([firm_id_selection])

You mean:
  firm_prices_selection = firm_prices_all(firm_id_selection)

Jan