You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Import CSV data into Matlab
I am trying to import data CSV using MATLAB, with patient_1(1).Data, as a following:

to import I used this code:
filedir = '/Users/'; files1 = dir(fullfile(filedir, '*.csv')); numFiles1 = length(files1); for i = 1 : numFiles1 patient_1(i).Name = files1(i).name; patient_1(i).Data = readtable(fullfile(filedir,files1(i).name),'ReadVariableNames',false); % loads data end
But I got this warning and following error:
Warning: Unable to determine the format of the DURATION data. Try adding a format to the DURATION specifier. e.g. '%{hh:mm:ss}T'. > In table/readTextFile>textscanReadData (line 554) In table/readTextFile (line 225) In table.readFromFile (line 39) In readtable (line 197) In patient1 (line 23) Error using readtable (line 197) Unable to determine the format of the DURATION data. Try adding a format to the DURATION specifier. e.g. '%{hh:mm:ss}T'. Note: readtable detected the following parameters: 'Delimiter', ';', 'HeaderLines', 0, 'Format', '%q%q%T%q%q%T%T%f%f%q%q' Error in patient1 (line 23) patient_1(i).Data = readtable(fullfile(filedir,files1(i).name),'ReadVariableNames',false); % loads data
Can anyone help me to solve this problem?
4 Comments

Accepted Answer
19 Comments


More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)