How can refer to rotational angle, which was made in another function of GUI?
1 view (last 30 days)
Show older comments
Hi, I want to use obtained rotation angle for further computing in another function. Assignment of angle to handles.angle did not help.
----------
handles.angle = round( get(hObject,'Value') );
Im_r = imrotate(handles.pic, handles.angle, 'bilinear', 'crop');
----------
angle=handles.angle;
I_r = imrotate(I,angle, 'bilinear', 'crop');
0 Comments
Accepted Answer
Adam
on 22 Sep 2014
Edited: Adam
on 22 Sep 2014
The first code section looks like it should work fine, but you need to add
guidata( hObject, handles )
at the end of the function containing that code in order for your 'angle' field to be added to the GUI's 'handles' structure rather than going out of scope in a copy of 'handles' that is local to your first function.
3 Comments
Adam
on 22 Sep 2014
Please can you post the entire two functions in question, from their function signature down (with the above code included)?
I assume that error is being thrown on the:
angle=handles.angle;
line?
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!