필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to rejoin text and numbers into raw format and export to excel

조회 수: 2 (최근 30일)
krai
krai 2018년 6월 13일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a excel file with data as shown,
Time Exp1 Exp2
0.1 26 965
0.2 23 966
0.3 25 963
0.4 NA 956
0.5 24 951
0.6 26 944
I have used the code
[num,text,raw] = xlsread('test.xlsx');
num_avg = fillmissing(num,'linear'); % to fill the missing data in the file
Now I want to write the processed data with the header to an excel file as shown below
Time Exp1 Exp2
0.1 26 965
0.2 23 966
0.3 25 963
0.4 24.5 956
0.5 24 951
0.6 26 944
How do I do it??
Thanks in advance

답변 (1개)

KSSV
KSSV 2018년 6월 13일
str = {'Time' 'Exp1' 'Exp2'};
data = [0.1 26 965
0.2 23 966
0.3 25 963
0.4 24.5 956
0.5 24 951
0.6 26 944] ;
A = num2cell(data) ;
T = [str ; A] ;
xlswrite('check.xls',T)
  댓글 수: 5
KSSV
KSSV 2018년 6월 13일
What is size of text1? YOu may trying adding header....as I have shown in the code, if you are getting error.
krai
krai 2018년 6월 13일
"What is size of text1? "
the size of text1 is 1x3
"YOu may try adding header....as I have shown in the code, if you are getting error."
How do I do that when pulling data from excel?
Thanks

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by