필터 지우기
필터 지우기

Using 'xlswrite' to save excel file to a PRE-SPECIFIED folder

조회 수: 5 (최근 30일)
Ellis Berry
Ellis Berry 2016년 6월 15일
댓글: RAMESH NEPALI 2018년 8월 14일
Hi All,
In my GUI, I use a pushbutton to select a directory which will be used as the save location for the processed images. This file is called 'outDir'.
When I press the other pushbutton and the images are processed, I have generated the images into separate results and I use xlxwrite to save them as an excel file.
How do I get my results to save as an excel file but in the 'outDir' folder I chose earlier? Can I try xlswrite([outDir], ..etc...); ??? Any ideas? Here is the end of my code:
PhotoDetails={fullFileName, black, time, Status};
Matrix(k,:)=PhotoDetails; %Matrix of three variables produced.
guidata(hObject,handles);
end
end
Header={'Image', 'Number of Black Pixels', 'Time (Seconds)', 'Status'};
xlswrite('PhotoResults', Header, 'Results');
xlRange='A2';
xlswrite('PhotoResults', Matrix, 'Results', xlRange);
many thanks,
Ellis

답변 (1개)

Adam
Adam 2016년 6월 15일
doc fullfile
e.g.
pathName = 'D:\myFiles';
filename = 'SomeFilename.xls'
fullPath = fullfile( pathname, filename );
It is good practice to always give an explicit path for loading or saving files anyway so where that path comes from is independent of what type of saving or loading you are doing.

카테고리

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