help
Thank you for your helping. I'm trying to import csv files form a folder, however it does not work.
The following code might be wrong.. fname=mtlb_dir('Users/shogo/Left_Leg_Single-Leg_Landing/SLLExport/*.exp')
I appreciate it if you help,
Sincerely, Shogo
3 Comments
Hi Shogo,
if you right-click on one of your files in the current folder browser window in MATLAB and select 'Import Data', MATLAB will open a convenient Import App for you. Here, you can chose the output format, the variables and other import parameters.
Instead of pressing 'Import Selection', you select the small arrow next to it and press 'Generate Function' (or 'Generate (Live) Script' depending on your liking). This will give you code that will import your data.
This code will need some tweaking in case your files have different lengths. Also, you will want to put a loop around it so you open every file in your directory. However, this is a great start and it will help you define your output formats easily.
I hope this helps.