converting a variable in a table from cell to double
이전 댓글 표시
I am trying to read some tables and concatenate them in one big table, but I am getting the following error
Cannot concatenate the table variable 'foE' because it is a cell in one table and a non-cell in another.
attached is the table "t1" that I am trying to read. the type of the variable in the other table is double, so how can I convert foE from cell to double
I am using the following lines to read the data
for kk = 1 : nfiles
fprintf('.......... File - %d of %d\n',kk, nfiles)
fullFileName = fullnames{kk};
t1 = readtable(fullFileName); %t1 stores the table from each file
if kk==1
Iono=t1;
else
Iono=[Iono; t1];
end
댓글 수: 4
Davide Masiello
2022년 10월 18일
Jan
2022년 10월 18일
The error message is not useful without seeing the corresponding code. Please edit the question and add it.
Salma fathi
2022년 10월 19일
Salma fathi
2022년 10월 19일
답변 (1개)
Cris LaPierre
2022년 10월 18일
Your variable is a cell because many of your values are '---'. Try this
t1.foE = str2double(t1.foE);
댓글 수: 2
Salma fathi
2022년 10월 19일
Cris LaPierre
2022년 10월 19일
That is a separate error, and has more to do with what you are trying to do with the result than the conversion itself. Share the code that corresponds to that error message.
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!