フィルターのクリア

how to place zeros instead of blanks in array

1 回表示 (過去 30 日間)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017 年 12 月 7 日
コメント済み: MAHMOUD ALZIOUD 2017 年 12 月 7 日
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 件のコメント
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017 年 12 月 7 日
i used this code but it is not working.
B(find(isnan(B)))=0;

サインインしてコメントする。

採用された回答

James Tursa
James Tursa 2017 年 12 月 7 日
If you really mean blank spaces, then e.g.
B(B==' ') = '0';
  1 件のコメント
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017 年 12 月 7 日
it worked , thank you very much for your help

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by