The image can't be excuted using Imshow function

I have been trying to simply show a picture in my current folder using the following code:
myIm = imread('cake.jpg');
imshow(myIm)
However the system keep giving me the following error:
Execution of script image as a function is not supported:
C:\Users\ali.sina\OneDrive - Nude Solutions\Documents\MATLAB\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,...
I tried the same code on MATLAB Online and it works there however I uninstalled the Matlab app on my desktop and installed another version and still it doesn't work.

回答 (1 件)

Voss
Voss 2022 年 1 月 9 日

0 投票

Is this file:
C:\Users\ali.sina\OneDrive - Nude Solutions\Documents\MATLAB\image.m
a file you wrote? If so, rename it so that it doesn't have the same name as a built-in MATLAB function.

2 件のコメント

Ali Sina
Ali Sina 2022 年 1 月 10 日
Not really, it was on one of my local folders, but I just moved it to the same folder. So it is at:
C:\Users\ali.sina\OneDrive - Nude Solutions\Documents\MATLAB\imageTime.m
Image Analyst
Image Analyst 2022 年 1 月 10 日
So it's all working now, right? What does this say
which -all image
built-in (/MATLAB/toolbox/matlab/specgraph/image)

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

リリース

R2021b

タグ

質問済み:

2022 年 1 月 9 日

コメント済み:

2022 年 1 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by