- numeric results (only)
- text results (only)
- raw -- numeric and text results (mixed)
error reading excel
조회 수: 9 (최근 30일)
이전 댓글 표시
I displayed data after using xlsread
raw =
Columns 1 through 5
[39] ' State-gov' [ 77516] ' Bachelors' [13]
[50] ' Self-emp-not-inc' [ 83311] ' Bachelors' [13]
[38] ' Private' [215646] ' HS-grad' [ 9]
[53] ' Private' [234721] ' 11th' [ 7]
[28] ' Private' [338409] ' Bachelors' [13]
[37] ' Private' [284582] ' Masters' [14]
[49] ' Private' [160187] ' 9th' [ 5]
I performed an operation
txt=strrep(txt,'Self-emp-not-inc','0.13');
i did same for private,State-gov,Bachelor,etc
Val = str2double(txt)
i get those values corect but other column 1,3,5 are displayed as NAN
PLEASE HELP ,after performing these operation i dont need nan ,i need only actual column 1,3,5 to be displayed as it is
댓글 수: 0
채택된 답변
Ken Atwell
2012년 2월 14일
xlsread returns (up to) three values, and it appears you are capturing all three:
Make sure you're performing your post-processing operations on the right result. I'm guessing that "str2double(txt)" is not working for you because you're doing that operation on the text-only results (the second argument). You would want to call str2double on the third output. Or, it is likely the first output already captures what you are interested in.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!