Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

creating an input list from a large data set

Asked by Lisa Justin

Lisa Justin

on 18 Oct 2012
Accepted Answer by RNTL

RNTL

Hi! I want to create an input list from a large data set. dir .*csv displays all the csv but when i do

dir='C:\Lisajustin\vib'

Listdir=sprintf('%s%s',dir, ' *.csv');

i get error

 Error using ==> sprintf
Function is not defined for 'struct' inputs.

0 Comments

Lisa Justin

Lisa Justin

Products

No products are associated with this question.

3 Answers

Answer by RNTL

RNTL

on 24 Oct 2012
Accepted answer

why don't you simply write

clear dir;
list = dir('c:\Lisajustin\vib\*.csv');

0 Comments

RNTL

RNTL

Answer by Sachin

Sachin

on 18 Oct 2012

Refer link below:

http://www.mathworks.com/matlabcentral/answers/21801

Hope it helps!!!

0 Comments

Sachin

Sachin

Answer by Azzi Abdelmalek

Azzi Abdelmalek

on 18 Oct 2012
folder='C:\Lisajustin\vib\' 
list=struct2cell(dir([folder '*.csv']));
Listdir=list(1,:)

2 Comments

Lisa Justin

Lisa Justin

on 19 Oct 2012

It is giving error still

Azzi Abdelmalek

Azzi Abdelmalek

on 24 Oct 2012

what kind of error?

Azzi Abdelmalek

Azzi Abdelmalek

Contact us