Effacer les filtres
Effacer les filtres

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

5 vues (au cours des 30 derniers jours)
Ellis Berry
Ellis Berry le 15 Juin 2016
Commenté : RAMESH NEPALI le 14 Août 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

Réponses (1)

Adam
Adam le 15 Juin 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