function varargout = Show_real(varargin)
%SHOW_REAL M-file for Show_real.fig
%      SHOW_REAL, by itself, creates a new SHOW_REAL or raises the existing
%      singleton*.
%
%      H = SHOW_REAL returns the handle to a new SHOW_REAL or the handle to
%      the existing singleton*.
%
%      SHOW_REAL('Property','Value',...) creates a new SHOW_REAL using the
%      given property value pairs. Unrecognized properties are passed via
%      varargin to Show_real_OpeningFcn.  This calling syntax produces a
%      warning when there is an existing singleton*.
%
%      SHOW_REAL('CALLBACK') and SHOW_REAL('CALLBACK',hObject,...) call the
%      local function named CALLBACK in SHOW_REAL.M with the given input
%      arguments.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help Show_real

% Last Modified by GUIDE v2.5 02-Jul-2007 22:24:46

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @Show_real_OpeningFcn, ...
                   'gui_OutputFcn',  @Show_real_OutputFcn, ...
                   'gui_LayoutFcn',  [], ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
   gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before Show_real is made visible.
function Show_real_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   unrecognized PropertyName/PropertyValue pairs from the
%            command line (see VARARGIN)

% Choose default command line output for Show_real
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes Show_real wait for user response (see UIRESUME)
handles.DM = varargin{1};
init(handles);
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = Show_real_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fim das definições automáticas do GUI-----------------------------------%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
%       Inicio

    function init(handles)
        slave = transform(handles.DM.q(handles.DM.fase,:));
        for i=1:4,
            for j=1:3,
                object = getfield(handles, ['text_' num2str((i-1)*3+(j))]);
                set(object, 'String', num2str(slave(i,j)));
            end
        end
        