필터 지우기
필터 지우기

Error with imread() for GUI.

조회 수: 1 (최근 30일)
Cristina Muniz
Cristina Muniz 2022년 2월 18일
답변: Anshika Chourasia 2022년 2월 21일
I'm creating a GUI where the user select's a disease from a panel which then shows them the EEG reading of that disease. However, I'm having trouble with writing the code to upload the image. I saved the image under the name Alzheimers_EEG.png and saved it on my MATLAB folder but when I write this code:
A = imread('Alzheimers_EEG.png');
The following ERROR shows up in my Command Window:
Error using imread>get_full_filename (line 569)
File "Alzheimers_EEG.png" does not exist.
Error in imread (line 371)
fullname = get_full_filename(filename);
Error in untitled3 (line 1)
A = imread('Alzheimers_EEG.png');
How can I fix this?
  댓글 수: 1
Voss
Voss 2022년 2월 18일
You should specify the full path, e.g.,
A = imread('C:\Users\Cristina\Research\Alzheimers_EEG.png');
or whatever it is, because MATLAB is looking for Alzheimers.png in its working directory, which doesn't seem to be the directory where that file is located.

댓글을 달려면 로그인하십시오.

답변 (1개)

Anshika Chourasia
Anshika Chourasia 2022년 2월 21일
Hi Cristina,
As per my understanding, "Alzheimers_EEG.png" does not exist in the current directory or search path. Please check once the image name and location to resolve this issue.
Please refer the link for reading an image from a graphics file.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by