Conversion problem of data types of an array
이전 댓글 표시
Hi all, I read with textscan from a text file to get an array. I received this error report at first
"All contents of the input cell array must be of the same data type."
for my array "data_A".
data_A:
522x1 double 522x1 double 522x1 cell 522x1 double
I tried to do this:
data_A(:,3) = str2double(data_A(:,3));
and I received this report:
"Conversion to cell from double is not possible."
Hence, I tried to use cell2mat:
data_A(:,3) = cell2mat(data_A(:,3));
for which I got the same error again:
"All contents of the input cell array must be of the same data type."
It would be so kind, if anyone could look into the matter. Any help and tips are very much appreciated. =)
Best regards,
Boon
댓글 수: 4
KL
2017년 9월 14일
and what is inside data_A(:,3)?
cbh0307
2017년 9월 14일
dpb
2017년 9월 14일
So, what is in the data record that is screwing up the reading of what looks as should be number? The ',' is a normal delimiter so that shouldn't be the problem.
Fix the problem at its root rather than try to post-process a mess created where needn't be (at least until can prove it must be a mess).
Show an offending record and how you tried to read it.
cbh0307
2017년 9월 14일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!