help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a graphical user interface with OCTAVE?


From: shank1207
Subject: Re: Creating a graphical user interface with OCTAVE?
Date: Fri, 27 May 2016 10:19:43 -0700 (PDT)

hello thanks for the reply this capabilities looks cool but i was trying to
do this code which works in MATLAB but i am not getting the result do i need
to change the syntax?

function GUI_slider
clc
clear

%// Create GUI controls
handles.figure = figure('Position',[100 100 500 500],'Units','Pixels');

handles.axes1 = axes('Units','Pixels','Position',[60,100,400,300]);

handles.Slider1 = uicontrol('Style','slider','Position',[60 20 400
50],'Min',0,'Max',1,'SliderStep',[.1 .1],'Callback',@SliderCallback);

handles.Edit1 = uicontrol('Style','Edit','Position',[250 450 100
20],'String','Update Me');
handles.Text1 = uicontrol('Style','Text','Position',[180 450 60
20],'String','Slider Value');

handles.xrange = 1:20; %// Use to generate dummy data to plot.

guidata(handles.figure,handles); %// Update the handles structure.

    function SliderCallback(~,~) %// This is the slider callback, executed
when you release the it or press the arrows at each extremity. 

        handles = guidata(gcf);

        SliderValue = get(handles.Slider1,'Value');
        set(handles.Edit1,'String',num2str(SliderValue));

        plot(handles.xrange,SliderValue*rand(1,20),'Parent',handles.axes1);
    end

end





--
View this message in context: 
http://octave.1599824.n4.nabble.com/Creating-a-graphical-user-interface-with-OCTAVE-tp4677209p4677214.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]