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

Thread Subject:
dir

Subject: dir

From: Dominic

Date: 6 Jul, 2009 14:11:02

Message: 1 of 7

Hi all,
I recently purchased a Macbook (running OS X 10.5) and am running into some trouble when I try to run my MATLAB codes which I wrote on a PC. The main issue I am having is with the dir command. Is it possible to use it on a Mac, and if so, what is the correct syntax for listing the directory.
Thanks!

Subject: dir

From: John D'Errico

Date: 6 Jul, 2009 14:42:02

Message: 2 of 7

"Dominic " <dcg48@cornell.edu> wrote in message <h2t0lm$msc$1@fred.mathworks.com>...
> Hi all,
> I recently purchased a Macbook (running OS X 10.5) and am running into some trouble when I try to run my MATLAB codes which I wrote on a PC. The main issue I am having is with the dir command. Is it possible to use it on a Mac, and if so, what is the correct syntax for listing the directory.
> Thanks!

dir works fine for me on my mac. Or use ls.

What problem do you have?

John

Subject: dir

From: Dominic

Date: 7 Jul, 2009 15:59:03

Message: 3 of 7

I don't know the code to use it on a folder which isn't the folder I am working in. On PC it was C:\Users\etc.

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <h2t2fp$gqr$1@fred.mathworks.com>...
> "Dominic " <dcg48@cornell.edu> wrote in message <h2t0lm$msc$1@fred.mathworks.com>...
> > Hi all,
> > I recently purchased a Macbook (running OS X 10.5) and am running into some trouble when I try to run my MATLAB codes which I wrote on a PC. The main issue I am having is with the dir command. Is it possible to use it on a Mac, and if so, what is the correct syntax for listing the directory.
> > Thanks!
>
> dir works fine for me on my mac. Or use ls.
>
> What problem do you have?
>
> John

Subject: dir

From: someone

Date: 7 Jul, 2009 16:19:59

Message: 4 of 7

"Dominic " <dcg48@cornell.edu> wrote in message <h2vrc7$6vo$1@fred.mathworks.com>...
> I don't know the code to use it on a folder which isn't the folder I am working in. On PC it was C:\Users\etc.
>
> "John D'Errico" <woodchips@rochester.rr.com> wrote in message <h2t2fp$gqr$1@fred.mathworks.com>...
> > "Dominic " <dcg48@cornell.edu> wrote in message <h2t0lm$msc$1@fred.mathworks.com>...
> > > Hi all,
> > > I recently purchased a Macbook (running OS X 10.5) and am running into some trouble when I try to run my MATLAB codes which I wrote on a PC. The main issue I am having is with the dir command. Is it possible to use it on a Mac, and if so, what is the correct syntax for listing the directory.
> > > Thanks!
> >
> > dir works fine for me on my mac. Or use ls.
> >
> > What problem do you have?
> >
> > John

doc filesep
doc fullfile
doc fileparts

% The directory structure on Macs (& UNIX) is different than PCs.
% For example, there is no C: drive.

Subject: dir

From: Dominic

Date: 7 Jul, 2009 18:09:02

Message: 5 of 7

So what would I put in the parentheses if I was trying to get the contents of a folder MATLAB which is in the folder Documents, in the folder Dominic, in the folder Users, which is located on Macintosh HD? Sorry I am new to all of this...
"someone" <someone@somewhere.net> wrote in message <h2vsjf$r03$1@fred.mathworks.com>...
> "Dominic " <dcg48@cornell.edu> wrote in message <h2vrc7$6vo$1@fred.mathworks.com>...
> > I don't know the code to use it on a folder which isn't the folder I am working in. On PC it was C:\Users\etc.
> >
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in message <h2t2fp$gqr$1@fred.mathworks.com>...
> > > "Dominic " <dcg48@cornell.edu> wrote in message <h2t0lm$msc$1@fred.mathworks.com>...
> > > > Hi all,
> > > > I recently purchased a Macbook (running OS X 10.5) and am running into some trouble when I try to run my MATLAB codes which I wrote on a PC. The main issue I am having is with the dir command. Is it possible to use it on a Mac, and if so, what is the correct syntax for listing the directory.
> > > > Thanks!
> > >
> > > dir works fine for me on my mac. Or use ls.
> > >
> > > What problem do you have?
> > >
> > > John
>
> doc filesep
> doc fullfile
> doc fileparts
>
> % The directory structure on Macs (& UNIX) is different than PCs.
> % For example, there is no C: drive.

Subject: dir

From: someone

Date: 7 Jul, 2009 18:25:02

Message: 6 of 7

"Dominic " <dcg48@cornell.edu> wrote in message <h302vu$sfk$1@fred.mathworks.com>...
> So what would I put in the parentheses if I was trying to get the contents of a folder MATLAB which is in the folder Documents, in the folder Dominic, in the folder Users, which is located on Macintosh HD? Sorry I am new to all of this...
> "someone" <someone@somewhere.net> wrote in message <h2vsjf$r03$1@fred.mathworks.com>...
> > "Dominic " <dcg48@cornell.edu> wrote in message <h2vrc7$6vo$1@fred.mathworks.com>...
> > > I don't know the code to use it on a folder which isn't the folder I am working in. On PC it was C:\Users\etc.
> > >
> > > "John D'Errico" <woodchips@rochester.rr.com> wrote in message <h2t2fp$gqr$1@fred.mathworks.com>...
> > > > "Dominic " <dcg48@cornell.edu> wrote in message <h2t0lm$msc$1@fred.mathworks.com>...
> > > > > Hi all,
> > > > > I recently purchased a Macbook (running OS X 10.5) and am running into some trouble when I try to run my MATLAB codes which I wrote on a PC. The main issue I am having is with the dir command. Is it possible to use it on a Mac, and if so, what is the correct syntax for listing the directory.
> > > > > Thanks!
> > > >
> > > > dir works fine for me on my mac. Or use ls.
> > > >
> > > > What problem do you have?
> > > >
> > > > John
> >
> > doc filesep
> > doc fullfile
> > doc fileparts
> >
> > % The directory structure on Macs (& UNIX) is different than PCs.
> > % For example, there is no C: drive.

% From the MATLAB command line "cd" to the directory you want.
% Then type:

pwd

% Put that result in the parentheses.

% PS Bottom posting makes it easier to follow the message chain.

Subject: dir

From: Dominic

Date: 7 Jul, 2009 18:42:01

Message: 7 of 7

"Dominic " <dcg48@cornell.edu> wrote in message <h302vu$sfk$1@fred.mathworks.com>...
> So what would I put in the parentheses if I was trying to get the contents of a folder MATLAB which is in the folder Documents, in the folder Dominic, in the folder Users, which is located on Macintosh HD? Sorry I am new to all of this...
> "someone" <someone@somewhere.net> wrote in message <h2vsjf$r03$1@fred.mathworks.com>...
> > "Dominic " <dcg48@cornell.edu> wrote in message <h2vrc7$6vo$1@fred.mathworks.com>...
> > > I don't know the code to use it on a folder which isn't the folder I am working in. On PC it was C:\Users\etc.
> > >
> > > "John D'Errico" <woodchips@rochester.rr.com> wrote in message <h2t2fp$gqr$1@fred.mathworks.com>...
> > > > "Dominic " <dcg48@cornell.edu> wrote in message <h2t0lm$msc$1@fred.mathworks.com>...
> > > > > Hi all,
> > > > > I recently purchased a Macbook (running OS X 10.5) and am running into some trouble when I try to run my MATLAB codes which I wrote on a PC. The main issue I am having is with the dir command. Is it possible to use it on a Mac, and if so, what is the correct syntax for listing the directory.
> > > > > Thanks!
> > > >
> > > > dir works fine for me on my mac. Or use ls.
> > > >
> > > > What problem do you have?
> > > >
> > > > John
> >
> > doc filesep
> > doc fullfile
> > doc fileparts
> >
> > % The directory structure on Macs (& UNIX) is different than PCs.
> > % For example, there is no C: drive.

Ok Thank you

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us