Filter löschen
Filter löschen

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

5 Ansichten (letzte 30 Tage)
Ellis Berry
Ellis Berry am 15 Jun. 2016
Kommentiert: RAMESH NEPALI am 14 Aug. 2018
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

Antworten (1)

Adam
Adam am 15 Jun. 2016
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.

Community Treasure Hunt

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

Start Hunting!

Translated by