ある配列から行要素(または列要素)を一塊として新たな配列を作る配列操作
Afficher commentaires plus anciens
サイズM×Nの配列A(M×N double)についてワークスペース上での変数保存結果が
M×1の配列B(行の要素がそれぞれ1×N double型)やM×1の配列C(行の要素がそれぞれN×1 double型)
となるような配列B、Cを作りたいのですが方法がわかりません。
例えば、3×4の配列Aについて
A=

B=
C=
C=
のように作りたいです
以下コード
%Aの要素とサイズは省略 お任せいたします
for i=1:N %Nには数値入れる
A_cell{i}=A(1:end,i)';
end
A_cell=transpose(A_cell);
B=cell2mat(A_cell); %これだとAをただ転置しただけの配列(N×M)になる
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!