필터 지우기
필터 지우기

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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by