フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

constructing a matrix from other

1 回表示 (過去 30 日間)
ss
ss 2012 年 12 月 29 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
hi I have a matrix for instance 6*6 called U, Also two vector b1 and b2 of size 6 and their arrays are integers among 1 and 6, now I want to construct a new matrix 6*6 such V that all arrays are zero and then pick up the new arrays from U such that the rows refer to b1 and columns to b2: for instance b1=[ 1 2 4 6] and b2=[2 3 1 6] so V is a 6*6 matrix that V(i,j)=U(i,j) for i in b1 and for j in b2 (so V(1,2), V(1,3), V(1,1),V(1,6),V(2,2), V(2,3), V(2,1),V(2,6),V(4,2), V(4,3), V(4,1),V(4,6),V(6,2), V(6,3), V(6,1),V(6,6) are same as correspondent U) and other arrays are zero, how we can construct this V? Thanks
  1 件のコメント
Matt J
Matt J 2012 年 12 月 29 日
You asked an essentially identical question here
There is no major difference in the solutions.

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 29 日
[a1,a2]=meshgrid(b1,b2)
out=u(a1,a2)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by