Filter löschen
Filter löschen

Rotate image in Matlab app designer

27 Ansichten (letzte 30 Tage)
monkey_matlab am 11 Okt. 2017
Kommentiert: monkey_matlab am 23 Okt. 2017
I was able to get an image rotated using Matlab GUI. I am now trying to implement the same effects using Matlab App Designer. Can you direct me as to how I can go about rotating the image using App designer with a slider.
Here is an extract of the code putting the image in the UIaxes:
% Code that executes after component creation
function startupFcn(app)
% Value changing function: SteeringSlider
function SteeringSliderValueChanging(app, event)
changingValue = event.Value;
How to now rotate the image?

Antworten (1)

Rajesh Balagam
Rajesh Balagam am 16 Okt. 2017
Bearbeitet: Rajesh Balagam am 16 Okt. 2017
You need to store the image data in the app using a custom public property and access this data to rotate the image in the callback for slider.
Store the image data:
app.imageData = imread('cameraman.tif');
Rotate the image using imrotate function in slider callback:
rotatedImage = imrotate(app.imageData, changingValue);
Refer to this link ( on how to share data between callbacks in appdesigner.
  1 Kommentar
monkey_matlab am 23 Okt. 2017
This solution does not work.
Also, the link is not valid.
This is what I have tried as per your suggestion but still not working:
properties (Access = public)
imageData = imread('cameraman.tif'); % Description
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
% Value changed function: Steer_ValueEditField
function Steer_ValueEditFieldValueChanged(app, event)
%value = app.Steer_ValueEditField.Value;
changingValue = app.SteeringSlider.Value;
rotatedImage = imrotate(app.imageData, changingValue);

Melden Sie sich an, um zu kommentieren.


Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by