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 (view profile)

on 18 Oct 2012
Accepted Answer by RNTL

RNTL (view profile)

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 (view profile)

Products

No products are associated with this question.

3 Answers

Answer by RNTL

RNTL (view profile)

on 24 Oct 2012
Accepted answer

why don't you simply write

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

0 Comments

RNTL

RNTL (view profile)

Answer by Sachin

Sachin (view profile)

on 18 Oct 2012

Refer link below:

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

Hope it helps!!!

0 Comments

Sachin

Sachin (view profile)

Answer by Azzi Abdelmalek

Azzi Abdelmalek (view profile)

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

2 Comments

Lisa Justin

Lisa Justin (view profile)

on 19 Oct 2012

It is giving error still

Azzi Abdelmalek

Azzi Abdelmalek (view profile)

on 24 Oct 2012

what kind of error?

Azzi Abdelmalek

Azzi Abdelmalek (view profile)

Contact us