Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8176021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:59:41+00:00 2026-06-06T22:59:41+00:00

I am trying to load an image but it is showing the error message

  • 0

I am trying to load an image but it is showing the error message Undefined function or method 'readimage' for input arguments of type 'char'.

My calling function is here

 h=uicontrol(FigWin,...
 'Style','pushbutton',...
 'Position',[0,320,80,20],...
 'String','Load',...
 'Callback',...
 ['image1=loadimage;'...
 'subplot(AxesHandle1);'...
 'imagesc(image1);'...
 'title(textLoad);'...
 'colormap(gray);']);

My called function is below

function image1=loadimage
    [imagefile1 , pathname]= uigetfile('*.bmp;*.BMP;*.tif;*.TIF;*.jpg','Open An Fingerprint image'); 
    if imagefile1 ~= 0 
        cd(pathname);
        image1=readimage(char(imagefile1));
        image1=255-double(image1);
    end
end

Another question, if there are warnings in the program is it a problem? Sorry, i am new to Matlab. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:59:44+00:00Added an answer on June 6, 2026 at 10:59 pm

    I could reproduce this only as a path issue.

    The problem is almost certainly that readimage.m isn’t on the path, but was/is instead located in the current directory you tested it from. Right now the easiest solution would be to use imread directly instead of your straight wrapper readimage, but assuming you want to add functionality to readimage later:

    The simple solution is to add the directory readimage.m to your path (File->Set Path->Add Folder->Browse to directory with readimage.m). However if you want to test that this is indeed the issue then make sure you can manually run readimage('existing_image.jpg') (meaning you should browse to that directory) and then run the following modified code

    function image1=loadimage
        [imagefile1 , pathname]= uigetfile('*.bmp;*.BMP;*.tif;*.TIF;*.jpg','Open An Fingerprint image'); 
        if imagefile1 ~= 0 
            image1=readimage([pathname imagefile1]);
            image1=255-double(image1);
    end;
    

    The only difference from the original code is that we’re not using cd(pathname) to change the directory, but instead are incorporating it into the readimage command itself.

    I’m betting that the combination of the cd() command and it not being on the path combined to make you think that readimage(w) was on the path and working, when it was really just in the current directory… until the cd() command was run.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to load an image in memory but might have memory issues
I'm trying to load an image through PHP, but I don't know how. The
I am trying to load the image in the following way. But when I
i'm trying to load image from local disk, and it's working. But my problem
I am trying to lazy load the Image Source for the Image Control but
i'm trying to load image from local disk, and it's working. But my problem
I'm still trying to load my image from database. But that's not so easy
im getting a little issue here. Im trying to load an image, but seems
I am trying to load .gif image from external storage (pictures directory) but I
I'm trying to load an image from a folder in the solution, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.