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

Reading files with extension.

Asked by ZK on 7 Feb 2013

I'm using:

A = dir(uigetdir('C:\','Select directory of a files'));

What can I use instead of fullfife() to load only files with file extension *.a ? In this line to have absolute file names?

Thank You.

0 Comments

ZK

Products

No products are associated with this question.

1 Answer

Answer by Azzi Abdelmalek on 7 Feb 2013
   A = dir([uigetdir('C:\','Select directory of a files'),'/*.a']);

3 Comments

ZK on 7 Feb 2013

Thank You it's working but still I don't have absolute file names, fopen returns me -1, is there any solution for this?

Azzi Abdelmalek on 7 Feb 2013
A = dir([uigetdir('C:\','Select directory of a files'),'/*.a']);
filename={A.name}
ZK on 8 Feb 2013

Sorry I have still -1 fid. I wish to use after it this loop:

 for k=1:length(A);
     Ap=A(k).name
     fid = fopen(Ap, 'r');
 end
Azzi Abdelmalek

Contact us