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:
What is the system path for imread() and load( )?

Subject: What is the system path for imread() and load( )?

From: Pat Finder

Date: 29 Mar, 2010 03:02:06

Message: 1 of 2

Some of the matlab routines, such as imread( ) and load( ), seem to have a default path for where to find files. I would like to know more about how this works.

For example, we sometimes see example codes that say something like:
im = imread('cameraman.tif');

I cannot find this image on my computer, yet imread( ) miraculously returns an
image. Is it reading the image over the net, or from a resource fork, or a compressed file, or what?

Thanks

Subject: What is the system path for imread() and load( )?

From: ImageAnalyst

Date: 29 Mar, 2010 03:36:25

Message: 2 of 2

On Mar 28, 11:02 pm, "Pat Finder" <pfin...@netacc.net> wrote:
> Some of the matlab routines, such as imread( ) and load( ), seem to have a default path for where to find files.  I would like to know more about how this works.
>
> For example, we sometimes see example codes that say something like:
> im = imread('cameraman.tif');
>
> I cannot find this image on my computer, yet imread( ) miraculously returns an
> image.  Is it reading the image over the net, or from a resource fork, or a compressed file, or what?  
>
> Thanks
-----------------------------------------------------------------------------------------------------------------
Type "path" in the command window and see what shows up. THAT's where
it searches. You may also like to take a look at the docs for
addpath(), setpath(), and genpath(). Maybe you might want to put some
of them in your startup.m file. like:

if(~isdeployed)
% Add the work folder and all subfolders to the search path.
addpath(genpath('C:\Program Files\MATLAB\Work'));
cd 'C:\Program Files\MATLAB\work'
savepath;
end

Tags for this Thread

No tags are associated with 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