Can I change this?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Younghun Kim
le 10 Juin 2020
Réponse apportée : Stephen23
le 10 Juin 2020
I have array_X
array_X=[1,1,1,0,1,0,0,0,1,0]
i want to change to
like this.
ans =
'1110100010'
how to change this?
0 commentaires
Réponse acceptée
KSSV
le 10 Juin 2020
k = num2str(array_X) ; % convert to string
k(k ==' ') = [] ; % remove spaces
There will be more other elegant ways.
0 commentaires
Plus de réponses (1)
Stephen23
le 10 Juin 2020
The most efficient solution is likely to be
>> X = [1,1,1,0,1,0,0,0,1,0];
>> A = sprintf('%u',X)
A = 1110100010
0 commentaires
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!