why mat2gray function isnt working in my matlab?

조회 수: 4 (최근 30일)
Roni
Roni 2023년 10월 4일
댓글: Walter Roberson 2023년 10월 4일
this is the code:
clear all
load('BrainTumors.mat');
imagesc(MRI{1});
colormap('gray')
a = mat2gray(MRI{1});
the last row isnt running and thats the error:
"Undefined function 'mat2gray' for input arguments of type 'int16'.
Error in ExecriseSolution1 (line 5)"
i was able to run this code in other computer. how do i fix it?
  댓글 수: 3
Roni
Roni 2023년 10월 4일
im not sure. how can i confirm it?
Dyuman Joshi
Dyuman Joshi 2023년 10월 4일
See @Steven Lord's answer below.

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

채택된 답변

Steven Lord
Steven Lord 2023년 10월 4일
The mat2gray function is part of Image Processing Toolbox. Do you have this toolbox installed and licensed? You can check this by running the ver command and looking for a line starting with "Image Processing Toolbox" in the displayed output.
If that line does not exist you will need to install Image Processing Toolbox to use this function.
  댓글 수: 2
Roni
Roni 2023년 10월 4일
thank you' it helps a lot. The "Image Processing Toolbox" does not exist, how can i install it?
Walter Roberson
Walter Roberson 2023년 10월 4일
If you have a recent matlab I suggest substituting rescale()

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by