How do I convert my .asc file to .xlsx file using MATLAB?

조회 수: 2 (최근 30일)
Joswin Leslie
Joswin Leslie 2018년 7월 23일
댓글: Krithika A 2018년 7월 24일
I have around three lines of words in my "PLC1.asc" file and then data (around 9000 rows and 3 columns) from my measurements. I want to convert this data to excel using MATLAB. Can anyone tell me what function to use?
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 7월 24일
Do you need to preserve the lines of words in your output file?

댓글을 달려면 로그인하십시오.

답변 (1개)

Krithika A
Krithika A 2018년 7월 24일
An example of one file (you'll need to change it depending on your data structure):
file = 'file.dat';
delim = ' '; % Your delimiter
data = dlmread(file,'delimiter',delim);
filename_out = 'your_excel.xls';
xlswrite(filename_out,data)
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 7월 24일
dlmread() cannot normally handle text, unless it is header lines that you tell it to skip, or it is in leading columns that you tell it to skip.
Krithika A
Krithika A 2018년 7월 24일
Oh right. Then sorry Joswin, I'm not going to be useful here.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by