NaN ouput on using string2double function for an OCR-ed output string
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
I have attached a snapshot of file showing undesirable result, as when I use string2double function the output I am getting is NaN...
I want to compare this string with a string obtained from excel sheet.

Kindly help where I am going wrong with this...
I am new to this so... any help would be greatly appreciated.
Thanks again.
답변 (1개)
Sulaymon Eshkabilov
2019년 5월 13일
0 개 추천
Hi,
Usually when you import/read data from the Excel spreadsheet, empty cells/boxes of the Excel Spreadsheet from where you are importing your data appears to have NaN (non a number) that can be eliminated by substituting with 0's. E.g. if your imported data variable into MATLAB workspace is called: acntColm contains NaN's and thus, you should use the followings to remove NaN's and substitute them with 0's.
>>IND = find(isnan(acntColm));
>> acntColm(IND) =0;
These substitute all NaN's with 0's.
Good luck.
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!