Effacer les filtres
Effacer les filtres

move cells (contained within a cell) to coordinates other than the starting coordinates

2 vues (au cours des 30 derniers jours)
Hi. I have a cell 'matrix_complete' and a coordinate matrix 'coord'.
I need to transform 'matrix_complete' so that:
  • the first row (3x3 cells) of 'matrix_complete' is positioned at coordinates [4,1] (first row of 'coord')
  • the first row (2x3 cells) of 'matrix_complete' is positioned at coordinates [2,2] (second row of 'coord')
  2 commentaires
Dyuman Joshi
Dyuman Joshi le 25 Juil 2023
You want to mix a numeric array with a cell array?
Alberto Acri
Alberto Acri le 25 Juil 2023
I need to make a small clarification in my question.
The 'matrix_complete' cell I need to generate must be a cell of size 4 rows and 2 columns. Inside it I need to allocate the (3x3 cells) at position [4,1] and the (2x3 cells) at position [2,2]. All other positions must be empty.

Connectez-vous pour commenter.

Réponse acceptée

Voss
Voss le 25 Juil 2023
load matrix_complete
load coord
siz = max(check_1_valori_0,[],1);
matrice_completa_new = cell(siz);
for ii = 1:numel(matrice_completa)
matrice_completa_new(check_1_valori_0(ii,1),check_1_valori_0(ii,2)) = matrice_completa(ii);
end
disp(matrice_completa_new);
{0×0 double} {0×0 double} {0×0 double} {2×3 cell } {0×0 double} {0×0 double} {3×3 cell } {0×0 double}

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by