drawrectangle not a defined function?

I've been programming in App Designer and I want to have a ROI over some axes that would return its position. However, for some reason drawrectangle is undefined as a function. When I look up the documentation for it through matlab it cannot find the function either. A lot of answers on different posts say it might be the path but the MATLAB folder is still in my path. Please help.
ax = axes(app.UIFigure);
drawrectangle(ax); %Undefined function 'drawrectangle' for input arguments of type 'matlab.graphics.axis.Axes'.

 採用された回答

Walter Roberson
Walter Roberson 2019 年 7 月 9 日

0 投票

It needs R2018b or later.

7 件のコメント

Raymond Mo
Raymond Mo 2019 年 7 月 9 日
I'm on a demo version of 2019a. Would the trial be causing problems?
Guillaume
Guillaume 2019 年 7 月 9 日
No, a trial is a full version.
What does
which drawrectangle -all
return?
Raymond Mo
Raymond Mo 2019 年 7 月 9 日
編集済み: Raymond Mo 2019 年 7 月 9 日
It says this:
'drawrectangle' not found.
also the alternative function "imrect" isn't found either
Guillaume
Guillaume 2019 年 7 月 9 日
Oh, it's part of the image processing toolbox. Of course, if the toolbox is not part of your trial, you won't have access to the function.
Walter Roberson
Walter Roberson 2019 年 7 月 9 日
A trial is a full version of the products included in the trial license and installed.
This particular function needs the Image Processing toolbox
However, I have to wonder whether
ax = axes(app.UIFigure);
is correct. axes() does not apply to uifigure objects: you need uiaxes():
ax = uiaxes(app.UIFigure);
axes() applied to a UIFigure would give you an error about undefined function isvalid for datatype double.
Raymond Mo
Raymond Mo 2019 年 7 月 9 日
Oh, can I add it in or would I need to purchase the full version?
Walter Roberson
Walter Roberson 2019 年 7 月 9 日
You can request that products be added to the trial.

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by