imshow is not working

3 views (last 30 days)
NEERAJ R H
NEERAJ R H on 17 Jun 2022
Answered: Jan on 17 Jun 2022
Execution of script image as a function is not supported:
C:\Users\NEERAJ RH\Dropbox\My PC (DESKTOP-LM8JK3U)\Desktop\major project\experimntation\image.m
Error in images.internal.basicImageDisplay (line 24)
hh = image(cdata, ...
Error in imshow (line 330)
hh = images.internal.basicImageDisplay(fig_handle,ax_handle,...
Error in gauss (line 2)
imshow(A)

Answers (1)

Jan
Jan on 17 Jun 2022
You have created a script called "image.m". This shadows the built-in function image.
Shadowing built-in functions is a serious problem. Trying to avoid such name conflicts is not easy, because many programmers do not know the names of all toolbox functions. Therefore it is safer to store user-defined functions in folders, which are appended to the path:
addpath yourFolder -end
and not to use cd to move the current folder to a folder, which contains M-files.
You have to rename your "image.m" file to let the buil-in image() work again.

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!