Efficient matri x calculation

2 ビュー (過去 30 日間)
Kris zenitis
Kris zenitis 2014 年 7 月 18 日
編集済み: Matt J 2014 年 7 月 18 日
I am wondering if there exist a more efficient way to do the following (without double for loop).
ids = textread('ids.txt'); % ids Nx1 matrix
for indx = 1:length(data) %data Nx3 matrix
for j = 1:size(data, 2)
data_new(indx, j) = ids(data(indx, j));
end
end

回答 (1 件)

Alfonso Nieto-Castanon
Alfonso Nieto-Castanon 2014 年 7 月 18 日
data_new = ids(data);

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by