help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: displaying an image


From: James Sherman Jr.
Subject: Re: displaying an image
Date: Wed, 2 Sep 2015 10:39:43 -0400

On Tue, Sep 1, 2015 at 11:25 PM, lana frankle <address@hidden> wrote:
> Does Octave have the MATLAB function of displaying an image?  I'm trying to
> learn MATLAB using Octave, and one of the prompts I was trying to follow
> involves displaying an image.  I received an error message ("image not
> found") and I'd like to know whether that's a problem with my code or Octave
> just doesn't do that.  I've attached the code I entered.  I even moved the
> item I was trying to display to editor in case Octave couldn't access it
> from the drive.
>
> Thanks,
> Lana
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-octave
>

Hi Lana,

Make sure either that:
1) Your image is in the same directory as your current directory (you
can check what your current directory is by typing 'pwd' (without the
'').  This should be the same directory as your script.
2) You can add the directory path where the image is to Octave's
search path.  If your image is in the directory C:/images for example.
Then using  the command:
addpath("C:/images")
before trying to read the image will work as well.

All the rest of the errors you're getting with your script stem from
the fact that your attempt to read the image and save it to the
variable A failed.  Since that wasn't successful, the rest of the code
is trying to do stuff with no data to work with.

Hope this helps,

James Sherman

P.S.  I just noticed that you image name is a bit ... odd.  Are you
sure that your image file has the suffix ".img"?  Usual suffixes are
.jpg, .jpeg, or .png.  I'm not familiar with the .img format, and I
wonder if that might be a typo.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]