フィルターのクリア

can anyone help me to run this code , thank you

1 回表示 (過去 30 日間)
mina massoud
mina massoud 2019 年 4 月 9 日
回答済み: Walter Roberson 2019 年 4 月 10 日
for i=1:300
for j=1:100
A{i,j}=10*randn(2,8);
B{i,j}=10*randn(2,8);
MA{i,j}=mean(A{i,j},1);
MB{i,j}=mean(B{i,j},1);
[E{i,j}, idx{i,j}] = min([MA{i,j};MB{i,j}]);
AB{i,j} = nan(2, length(E{i,j}));
AB{i,j}(:,idx==1) = A{i,j}(:,idx==1);
AB{i,j}(:,idx==2) = B{i,j}(:,idx==2);
end
end
  1 件のコメント
Rik
Rik 2019 年 4 月 9 日
Have a read here (or here for more general advice). It will greatly improve your chances of getting an answer.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2019 年 4 月 10 日
for i=1:300
for j=1:100
A{i,j}=10*randn(2,8);
B{i,j}=10*randn(2,8);
MA{i,j}=mean(A{i,j},1);
MB{i,j}=mean(B{i,j},1);
[E{i,j}, idx{i,j}] = min([MA{i,j};MB{i,j}]);
AB{i,j} = nan(2, length(E{i,j}));
AB{i,j}(:,idx{i,j}==1) = A{i,j}(:,idx{i,j}==1);
AB{i,j}(:,idx{i,j}==2) = B{i,j}(:,idx{i,j}==2);
end
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by