Effacer les filtres
Effacer les filtres

double - type matrix with integer and char values

3 vues (au cours des 30 derniers jours)
Francesco
Francesco le 2 Juin 2014
Commenté : Star Strider le 2 Juin 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.

Réponse acceptée

Star Strider
Star Strider le 2 Juin 2014
Modifié(e) : Star Strider le 2 Juin 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).
  2 commentaires
Francesco
Francesco le 2 Juin 2014
thank you!
Star Strider
Star Strider le 2 Juin 2014
My pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by