how to use range that can change in xlswrite?

조회 수: 3 (최근 30일)
ilona
ilona 2014년 1월 4일
답변: Image Analyst 2014년 1월 4일
if I write a function that creates a sturcture that can change sizes in different calls. and I want to put this structure in xl starting from B1(cause in A1:A4 THERE IS SOMETHING ELSE), but I don't know the end of the range since the structure can change it size - is there a way of doing so?

답변 (1개)

Image Analyst
Image Analyst 2014년 1월 4일
ilona, you probably just forgot to give the sheet name when you called xlswrite. Or you didn't construct the full cell reference range like 'B1:H9'. Try this code:
myStructure.array = rand(10,3) % Make sample data in a structure.
% You must give a sheet name unless you want to
% figure out where the lower right corner of the array would go.
% To do that you'd need ExcelCol.m in the File Exchange
% If you give sheetName, you can give just the upper left cell.
sheetName = 'Results'
xlswrite('test.xlsx', myStructure.array, sheetName, 'B1')

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by