Importing Data From Excel
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi
When importing data from Excel using xlsread() regadless if the data is numeric or char in the Excel file once loaded into Matlab its always treated as a char. I've used isnumeric() to test data type and this always fails to spot the data as a number.
The same code works with other files so suspec its the file but in Excel the formats are saved as General( as per the working files).
Plaese help Greg
댓글 수: 0
답변 (2개)
Sean de Wolski
2011년 7월 5일
Is the data a char in the excel file?
You could always brute force it:
is_str_a_num = str2double(char_num); %is it a number?
if ~isnan(is_str_a_num); %?
num = is_str_a_num; %it is! woohoo
else
something_else; %it isn't
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!