How to mix integers and chars in matrix?
Afficher commentaires plus anciens
1. I want to create the following matrix:
A=[1 2 3 A B C]
2. After that, based on the matrix A, I want to generate random matrix of this following matrix:
A1=[1 3 2 A C B]
A2=[2 1 3 B A C]
A2=[2 3 1 B C A]
Does any body can help me?
1 commentaire
Paulo Silva
le 27 Jan 2011
Not possible inside matrix, you must use cells
Réponse acceptée
Plus de réponses (3)
zakri
le 27 Jan 2011
zakri
le 28 Jan 2011
9 commentaires
Paulo Silva
le 28 Jan 2011
char(AA)
zakri
le 28 Jan 2011
Paulo Silva
le 28 Jan 2011
find what's wrong with your code, that's the better way to learn.
Paulo Silva
le 28 Jan 2011
hint: You got all the code in there but one line of it is in the wrong place :)
zakri
le 29 Jan 2011
Paulo Silva
le 29 Jan 2011
You are only shuffling the cards once, that's why you get always the same result, shuffle the cards 3 times...
zakri
le 31 Jan 2011
Paulo Silva
le 31 Jan 2011
already did lol
c'mon you just need to put the randperm inside the loop, so easy :)
zakri
le 31 Jan 2011
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!