From: Mano Samuel on
Hello,

Since this is my first GUI design, I have a few questions. One of them is,

I found this interesting tool on MATLAB file exchange.

http://www.mathworks.com/matlabcentral/fileexchange/5961-magnify

it helps magnify a figure. So i added this to my GUI with the use of a 'checkbox'. The idea was that every time I click(mark a tick) on a checkbox in the GUI, I should be able to use this magnify function and if I remove the checkbox, I should not be able to use the magnify function.

Now if I click on the checkbox, I am able to use the magnify function. However If i remove the tick mark, I am not able to disable the magnify function. Hoping someone can help me with this . How do I disable the magnify function ?

Thanks
From: Mano Samuel on
"Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message <hv9b3b$4g2$1(a)fred.mathworks.com>...
> Hello,
>
> Since this is my first GUI design, I have a few questions. One of them is,
>
> I found this interesting tool on MATLAB file exchange.
>
> http://www.mathworks.com/matlabcentral/fileexchange/5961-magnify
>
> it helps magnify a figure. So i added this to my GUI with the use of a 'checkbox'. The idea was that every time I click(mark a tick) on a checkbox in the GUI, I should be able to use this magnify function and if I remove the checkbox, I should not be able to use the magnify function.
>
> Now if I click on the checkbox, I am able to use the magnify function. However If i remove the tick mark, I am not able to disable the magnify function. Hoping someone can help me with this . How do I disable the magnify function ?
>
> Thanks


I am really stuck. cant seem to find a way out. I am adding the code along with it.


function Maina

clear all;close all;clc

figure_handle = figure('MenuBar','none',...
'Toolbar','none',...
'Name','Gui01','NumberTitle','off',...
'Position',[100,100,800,600]);

% ******************** figure ********************

ah = axes( 'Position', [0.1 0.3 0.8 .6],...
'Box', 'on', ...
'Color','white',...
'XColor',[0,0,0],'YColor',[0,0,0]);
axis( [1 10 -10 10])

% *****************

files=dir('*.wav');
for n=1:length(files);
basename = files(n).name;
basename(end-3:end) = '';
data.(basename)=wavread(files(n).name);
end

cc = struct2cell(data);
ccr = cc{1};
plot(ccr)
% *********************

set(ah,'buttondownfcn','disp(get(gca,''currentpoint''));');

% ***********************************************************************

Magnifier = uicontrol('Style','CheckBox','String','Magnifier','Position',[600,50,80,30],...
'CallBack', @CheckBox2Selected);

function CheckBox2Selected(h, eventdata)

if get(Magnifier,'Value')==1
magnify;
else
end;

end

uicontrol('Style','PushButton','String','Close','Position',[720,20,60,20],...
'CallBack','close');

end


As for the magnify function, it is in the link above. Hoping someone can help me out.
From: Mano Samuel on
"Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message <hva1i2$jjk$1(a)fred.mathworks.com>...
> "Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message <hv9b3b$4g2$1(a)fred.mathworks.com>...
> > Hello,
> >
> > Since this is my first GUI design, I have a few questions. One of them is,
> >
> > I found this interesting tool on MATLAB file exchange.
> >
> > http://www.mathworks.com/matlabcentral/fileexchange/5961-magnify
> >
> > it helps magnify a figure. So i added this to my GUI with the use of a 'checkbox'. The idea was that every time I click(mark a tick) on a checkbox in the GUI, I should be able to use this magnify function and if I remove the checkbox, I should not be able to use the magnify function.
> >
> > Now if I click on the checkbox, I am able to use the magnify function. However If i remove the tick mark, I am not able to disable the magnify function. Hoping someone can help me with this . How do I disable the magnify function ?
> >
> > Thanks
>
>
> I am really stuck. cant seem to find a way out. I am adding the code along with it.
>
>
> function Maina
>
> clear all;close all;clc
>
> figure_handle = figure('MenuBar','none',...
> 'Toolbar','none',...
> 'Name','Gui01','NumberTitle','off',...
> 'Position',[100,100,800,600]);
>
> % ******************** figure ********************
>
> ah = axes( 'Position', [0.1 0.3 0.8 .6],...
> 'Box', 'on', ...
> 'Color','white',...
> 'XColor',[0,0,0],'YColor',[0,0,0]);
> axis( [1 10 -10 10])
>
> % *****************
>
> files=dir('*.wav');
> for n=1:length(files);
> basename = files(n).name;
> basename(end-3:end) = '';
> data.(basename)=wavread(files(n).name);
> end
>
> cc = struct2cell(data);
> ccr = cc{1};
> plot(ccr)
> % *********************
>
> set(ah,'buttondownfcn','disp(get(gca,''currentpoint''));');
>
> % ***********************************************************************
>
> Magnifier = uicontrol('Style','CheckBox','String','Magnifier','Position',[600,50,80,30],...
> 'CallBack', @CheckBox2Selected);
>
> function CheckBox2Selected(h, eventdata)
>
> if get(Magnifier,'Value')==1
> magnify;
> else
> end;
>
> end
>
> uicontrol('Style','PushButton','String','Close','Position',[720,20,60,20],...
> 'CallBack','close');
>
> end
>
>
> As for the magnify function, it is in the link above. Hoping someone can help me out.

Solved the above. Another question though.

Given i have a GUI with a single graphic that displays an audio signal.

What is the command to change the color of a portion of the signal.

I think it has got be set(gcf(...........)) . I am not sure what command i need to use to fill in the blanks. Thanks.
From: Mano Samuel on
"Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message <hvcdff$89f$1(a)fred.mathworks.com>...
> "Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message <hva1i2$jjk$1(a)fred.mathworks.com>...
> > "Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message <hv9b3b$4g2$1(a)fred.mathworks.com>...
> > > Hello,
> > >
> > > Since this is my first GUI design, I have a few questions. One of them is,
> > >
> > > I found this interesting tool on MATLAB file exchange.
> > >
> > > http://www.mathworks.com/matlabcentral/fileexchange/5961-magnify
> > >
> > > it helps magnify a figure. So i added this to my GUI with the use of a 'checkbox'. The idea was that every time I click(mark a tick) on a checkbox in the GUI, I should be able to use this magnify function and if I remove the checkbox, I should not be able to use the magnify function.
> > >
> > > Now if I click on the checkbox, I am able to use the magnify function. However If i remove the tick mark, I am not able to disable the magnify function. Hoping someone can help me with this . How do I disable the magnify function ?
> > >
> > > Thanks
> >
> >
> > I am really stuck. cant seem to find a way out. I am adding the code along with it.
> >
> >
> > function Maina
> >
> > clear all;close all;clc
> >
> > figure_handle = figure('MenuBar','none',...
> > 'Toolbar','none',...
> > 'Name','Gui01','NumberTitle','off',...
> > 'Position',[100,100,800,600]);
> >
> > % ******************** figure ********************
> >
> > ah = axes( 'Position', [0.1 0.3 0.8 .6],...
> > 'Box', 'on', ...
> > 'Color','white',...
> > 'XColor',[0,0,0],'YColor',[0,0,0]);
> > axis( [1 10 -10 10])
> >
> > % *****************
> >
> > files=dir('*.wav');
> > for n=1:length(files);
> > basename = files(n).name;
> > basename(end-3:end) = '';
> > data.(basename)=wavread(files(n).name);
> > end
> >
> > cc = struct2cell(data);
> > ccr = cc{1};
> > plot(ccr)
> > % *********************
> >
> > set(ah,'buttondownfcn','disp(get(gca,''currentpoint''));');
> >
> > % ***********************************************************************
> >
> > Magnifier = uicontrol('Style','CheckBox','String','Magnifier','Position',[600,50,80,30],...
> > 'CallBack', @CheckBox2Selected);
> >
> > function CheckBox2Selected(h, eventdata)
> >
> > if get(Magnifier,'Value')==1
> > magnify;
> > else
> > end;
> >
> > end
> >
> > uicontrol('Style','PushButton','String','Close','Position',[720,20,60,20],...
> > 'CallBack','close');
> >
> > end
> >
> >
> > As for the magnify function, it is in the link above. Hoping someone can help me out.
>
> Solved the above. Another question though.
>
> Given i have a GUI with a single graphic that displays an audio signal.
>
> What is the command to change the color of a portion of the signal.
>
> I think it has got be set(gcf(...........)) . I am not sure what command i need to use to fill in the blanks. Thanks.

For ex, i can change the color of the entire signal by using,

set(findobj('type','line'),'color',[1 0 0])

but not just a part of the signal .