Borrar filtros
Borrar filtros

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

5 visualizaciones (últimos 30 días)
Ellis Berry
Ellis Berry el 15 de Jun. de 2016
Comentada: RAMESH NEPALI el 14 de Ag. de 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

Respuestas (1)

Adam
Adam el 15 de Jun. de 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