필터 지우기
필터 지우기

Writing few lines to Excel cell

조회 수: 5 (최근 30일)
Tamir
Tamir 2014년 6월 1일
댓글: Image Analyst 2014년 6월 2일
Hello, I am using XLSWRITE in order to write to Excel file and it works well. My problem is that I would like to write to a single cell a few lines. For instance I would like to write :
'0-12,10
50-60,9
70-76,2'
all in one cell. Currently I only to do it in one row : ''0-12,10,50-60,9,70-76,2' Do you have any idea how to force Alt-Enter?
Best, Tamir

채택된 답변

Image Analyst
Image Analyst 2014년 6월 1일
A total SWAG, but try this:
% Create a cell with one multi-line string in it.
oneCell = {sprintf('0-12,10\n,50-60,9\n70-76,2')}
% Write out to Excel
xlswrite(filename, oneCell, 'A1');
  댓글 수: 3
Tamir
Tamir 2014년 6월 2일
Works great! Thanks a lot!
Image Analyst
Image Analyst 2014년 6월 2일
For others who might read this, which one(s) worked?

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

추가 답변 (0개)

카테고리

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