The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Structure handling (DIR output)
Replies: 3   Last Post: Oct 15, 2008 12:12 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Dimitri Shvorob

Posts: 49
Registered: 4/1/08
Structure handling (DIR output)
Posted: Oct 7, 2008 4:01 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I would like to get a cell array of strings, listing files and subdirectories in a directory. The best I can manage is:

list = dir;
n = length(list);
x = cell(n,1);
[x{:}] = deal(list(1:n).name)

Is there a better way?

Thank you.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.