Displaying an image in app designer

28 ビュー (過去 30 日間)
Filip Juchnicki
Filip Juchnicki 2021 年 9 月 15 日
コメント済み: Filip Juchnicki 2021 年 9 月 15 日
Hello. I'm new to app designer and I need to display a matrix saved as varaible app.Matrix in a kind of a preview window (not in a separate figure yet) with a button press. I tried using a UIAxes and a following code to create a place for the preview image:
title(app.UIAxes, []);
xlabel(app.UIAxes, []);
ylabel(app.UIAxes, []);
app.UIAxes.XAxis.TickLabels = {};
app.UIAxes.YAxis.TickLabels = {};
I now have an empty plot but I'm not sure how to use the imagesc function and connect it to the button so that it displays my matrix as a grayscale image as imagesc(Matrix) normally would in Matlab. I'd appreciate some tips in that matter.

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 9 月 15 日
Use the following syntax:
where ax is your target axes (app.UIAxes). You connect it to your button by placing the code inside the button's callback function.
  3 件のコメント
Cris LaPierre
Cris LaPierre 2021 年 9 月 15 日
I would suggest using cla.
Filip Juchnicki
Filip Juchnicki 2021 年 9 月 15 日
Thank you again. Works.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by