have. mat file on my computerhowto upload to matalb

Answers (1)

Hi Diana,
You can zip your files and load it onto matlab online. This worked for me, hope it helps.
Thanks,
Deepak

7 Comments

thanks. managed to upload a zip file I am on a mac and right clicks are not obvious
NOw how do i expeort the files to .csv.
can the zip file be downloaded directly OR
do ineed to down load separately 25 files for each aprticipant.\IMHO peopel who submit raw data in matalb rahter than csv or excel should be ....
Sorry but it's not clear what are you trying to do with these files. If you are trying to export this data to csv files, than:
  1. Unzip .mat files using unzip command.
  2. Parse through each file and load the content using load function and save it in csv files i.e. csvwrite('my_data.csv', data); If you want to save content in single csv file, keep file name same.
  3. If you have saved data into multiple .csv files than you can zip it and then download.
THANKS
i have uploaded files
Now I need to know how to exp[ort them to excel
Here is copy of screen. NO one cannot paste into this chat.
But there is a data unit that incliudes heirarchy of 5 data files for each of 30 subjects
Fairly desperate - I know its only a couple of lines but what are the
why does preview or import not show me anything
why did they not tell me that right click is needed for some options
yuk
Matlab has the woprst onterface I have evern seen in a statistics package. it makes R look positively friendly
csv_directory = '.'; %directory holding input files. adjust as needed
excel_directory = '.'; %directory to hold output files. adjust as needed
if ~isdir(excel_directory); mkdir(excel_directory); end
dinfo = dir( fullfile(csv_directory, '*.csv'));
filenames = fullfile({dinfo.folder}, {dinfo.name});
numfiles = length(filenames);
for K = 1 : numfiles
thisfile = filenames{K};
[~, basename, ext] = fileparts(thisfile);
outfile = fullfile( excel_directory, [basename '.xlsx']);
thisdata = readtable(thisfile);
writetable(thisdata, outfile);
end
@diana Try Walter's script. You can also try dragging and dropping. I am using a windows machine and it works for me.
thanks
code makes sense
I added it into command pane
it appeared to excute ending with the prompt double arrows
there is now an excel_directory in the workspace
saveing the workspace only has .mat option. so I saved workspace as op.mat
how do I get the excel_directory and its content down to my MAC?
the dwonlad option on op.mat wil destroy current stuf - and amyway it ios .mat
sorry to be so stupid
The excel_directory that is in the workspace is only a variable naming the destination directory for the excel files. The excel_directory in the workspace is not the content of the excel files -- only the path to where the files are to be stored.
You can
zip('ZIPFILENAMEGOESHERE.zip', fullfile(excel_directory, "*.xlsx"))
to create ZIPFILENAMEGOESHERE.zip and then download ZIPFILENAMEGOESHERE.zip onto your Mac (right-click it in the file browser to get a download menu item.)

Sign in to comment.

Asked:

on 15 Dec 2024

Commented:

on 19 Dec 2024

Community Treasure Hunt

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

Start Hunting!