Handles in Matlab Guide

3 次查看(过去 30 天)
Amanda
Amanda 2012-9-1
I am having a difficult time understanding use of handles
in MATLAB's guide. WHEN TO USE THEM?
For example, this is MATLAB's example how to use MATLAB Guide:
handles.peaks = peaks(35);
[x, y] = meshgrid(-8:.5:8)
handles.current_data = handles.peaks
surf(handles.current_data)
I guess we are using handles to pass data to the functions.
I'm confused.
Thanks,
Amanda

采纳的回答

Image Analyst
Image Analyst 2012-9-1
That's correct. That's one of the ways to make an otherwise local variable into a global variable so that they can be seen in other functions. Most of the other ways are discussed here: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F In your case you don't need to do that unless you're going to need those variables later, in a different function or callback function.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by