Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

i want to write a n*n matrix into single column

1 vue (au cours des 30 derniers jours)
SANJOY MONDAL
SANJOY MONDAL le 23 Déc 2017
Clôturé : MATLAB Answer Bot le 20 Août 2021
i have a matrix of n * n i want to arrange the same matrix in a single column with index like this
[2.3 3.5 4.5;
1.3 3.9 2.8;
3.6 5.9 2.7]
i want to see like this
1 1 2.3;
1 2 3.5;
1 3 4.5;
...
  1 commentaire
SANJOY MONDAL
SANJOY MONDAL le 23 Déc 2017
thank you sir

Réponses (1)

Walter Roberson
Walter Roberson le 23 Déc 2017
[I, J] = ndgrid(1:size(TheMatrix,1), 1:size(TheMatrix,2));
[J(:), I(:), reshape(TheMatrix.',[],1)]

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by