double - type matrix with integer and char values
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Francesco
il 2 Giu 2014
Commentato: Star Strider
il 2 Giu 2014
Hi, I would know if it's possible create a matrix with two columns where in the first one we have integer values while in the second one i would save character values. Thanks for the answers.
0 Commenti
Risposta accettata
Star Strider
il 2 Giu 2014
Modificato: Star Strider
il 2 Giu 2014
You can easily do that with a cell array, but not a matrix. Matrices have to have only one data type.
For instance:
for k1 = 1:10
C{k1,1} = k1;
C{k1,2} = char(61+k1);
end
The character array can be anything you want (single letters or symbols here only for demonstration purposes).
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!