Effacer les filtres
Effacer les filtres

how to place zeros instead of blanks in array

1 vue (au cours des 30 derniers jours)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD le 7 Déc 2017
Commenté : MAHMOUD ALZIOUD le 7 Déc 2017
hello everyone, i have a char array of size 358695x3, that is 358695 rows and it is called B, when i write the following code str2num(B) I just have 7000 rows in the output, i found out that B has alot of blanks [] in it so i cannot use str2num, what is the way to fill those blanks in B with zeros please? so i have 358695 rows when i do the str2num on it. help please
  1 commentaire
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD le 7 Déc 2017
i used this code but it is not working.
B(find(isnan(B)))=0;

Connectez-vous pour commenter.

Réponse acceptée

James Tursa
James Tursa le 7 Déc 2017
If you really mean blank spaces, then e.g.
B(B==' ') = '0';
  1 commentaire
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD le 7 Déc 2017
it worked , thank you very much for your help

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements 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