imshow is not working

13 views (last 30 days)
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)

Answers (1)

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.

Community Treasure Hunt

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

Start Hunting!