Merge a matrix present in the same position but in two different cells
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Alberto Acri
am 10 Jan. 2023
Beantwortet: the cyclist
am 10 Jan. 2023
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?
0 Kommentare
Akzeptierte Antwort
the cyclist
am 10 Jan. 2023
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)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!