Using 'xlswrite' to save excel file to a PRE-SPECIFIED folder
5 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Adam
on 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.
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!