Merge a matrix present in the same position but in two different cells

1 回表示 (過去 30 日間)
Alberto Acri
Alberto Acri 2023 年 1 月 10 日
回答済み: the cyclist 2023 年 1 月 10 日
Hi. I should merge the matrix located at position {1,1} (and so on for all other matrices) present in cell_A (1464x2) and cell (1464x1).
Here is a graphic example of the final cell I would like to get as a result (new_cell). Is there a quick and easy way to do this?

採用された回答

the cyclist
the cyclist 2023 年 1 月 10 日
Here is one way:
% Inputs
rng default
cell = {rand(2,3); rand(5,7); []};
cell_A = {rand(2,1); rand(5,1); []};
% Output
new_cell = cellfun(@(x,y)[x y],cell,cell_A,"UniformOutput",false)
new_cell = 3×1 cell array
{2×4 double} {5×8 double} {0×0 double}

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by