From: Mano Samuel on 14 Jun 2010 04:28 Hello I am designing a GUI programmatically. Lets say I have an audio signal. I have designed the GUI with a few buttons and each button performs an operation. Now i want to be able to display the audio signal in the GUI, so that I could use each button to perform the individual operation. The individual operations could be cropping portions of the audio signal and playing the sound of the cropped section. But I am not sure how to plot the figure in the GUI. Does anyone know of any tutorials that I could use to do this ? I want to be able to do this programmatically without the GUIDE. Thank you, Mano
From: Steve Amphlett on 14 Jun 2010 05:11 "Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message <hv4p6k$frs$1(a)fred.mathworks.com>... > Hello > > I am designing a GUI programmatically. Lets say I have an audio signal. I have designed the GUI with a few buttons and each button performs an operation. Now i want to be able to display the audio signal in the GUI, so that I could use each button to perform the individual operation. The individual operations could be cropping portions of the audio signal and playing the sound of the cropped section. But I am not sure how to plot the figure in the GUI. Does anyone know of any tutorials that I could use to do this ? I want to be able to do this programmatically without the GUIDE. It's been a while, but I can remember being in this position. My MO was to use the "get" function to explore the handles returned by the uicontrol. Callback functions and userdata were very useful if my memory serves me correctly. I never went anywhere near GUIDE.
From: Steven Lord on 14 Jun 2010 09:45 "Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message news:hv4p6k$frs$1(a)fred.mathworks.com... > Hello > > I am designing a GUI programmatically. Lets say I have an audio signal. I > have designed the GUI with a few buttons and each button performs an > operation. Now i want to be able to display the audio signal in the GUI, > so that I could use each button to perform the individual operation. The > individual operations could be cropping portions of the audio signal and > playing the sound of the cropped section. But I am not sure how to plot > the figure in the GUI. Does anyone know of any tutorials that I could use > to do this ? I want to be able to do this programmatically without the > GUIDE. Take a look at this chapter in the documentation: http://www.mathworks.com/access/helpdesk/help/techdoc/creating_guis/bqz6qcd.html -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: Frédéric Bergeron on 14 Jun 2010 10:41 "Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message <hv4p6k$frs$1(a)fred.mathworks.com>... > Hello > > I am designing a GUI programmatically. Lets say I have an audio signal. I have designed the GUI with a few buttons and each button performs an operation. Now i want to be able to display the audio signal in the GUI, so that I could use each button to perform the individual operation. The individual operations could be cropping portions of the audio signal and playing the sound of the cropped section. But I am not sure how to plot the figure in the GUI. Does anyone know of any tutorials that I could use to do this ? I want to be able to do this programmatically without the GUIDE. > > > Thank you, > Mano Hey, If you have only one graphic, you can create a pair of axis with the function axes, exactly like when you create your pushbutton. After that when you plot something in your program, it will plot it directly in the axis you defined with axes. Fred
From: Mano Samuel on 14 Jun 2010 22:54 "Frédéric Bergeron" <frederic.bergeron(a)logiag.com> wrote in message <hv5f23$i6s$1(a)fred.mathworks.com>... > "Mano Samuel" <manosamuel(a)rediffmail.com> wrote in message <hv4p6k$frs$1(a)fred.mathworks.com>... > > Hello > > > > I am designing a GUI programmatically. Lets say I have an audio signal. I have designed the GUI with a few buttons and each button performs an operation. Now i want to be able to display the audio signal in the GUI, so that I could use each button to perform the individual operation. The individual operations could be cropping portions of the audio signal and playing the sound of the cropped section. But I am not sure how to plot the figure in the GUI. Does anyone know of any tutorials that I could use to do this ? I want to be able to do this programmatically without the GUIDE. > > > > > > Thank you, > > Mano > > Hey, > > If you have only one graphic, you can create a pair of axis with the function axes, exactly like when you create your pushbutton. After that when you plot something in your program, it will plot it directly in the axis you defined with axes. > > Fred Thanks Fred and everyone for answering. Since I am using only one graph, I decided to go with the function 'axes'. so the MATLAB command for the figure is as follows, ah=axes( 'Position', [0.1 0.3 0.7 .6],... 'Box', 'on', ... 'Color','white',... 'XColor',[0,0,0],'YColor',[0,0,0]); axis( [1 10 -10 10]) Assuming i have a data , xx = [1:10]; yy= ones(length(xx)); I follow the above piece of code with plot(xx,yy) Now to find the co-ordinates of the points I am clicking on the graph, I added, set(ah, 'HitTest', 'on'); set(ah,'ButtonDownFcn', @GetClick); with the Getclick function as, function GetClick(src,evt) disp(get(src,'CurrentPoint')) end After I click on the figure, it takes a good 5 seconds duration before it shows the following values. (I clicked somewhere close to 6) 6.0063 0.9639 1.0000 6.0063 0.9639 -1.0000 how do i restrict it to display just the x and y co-ordinates. and is the process generally time consuming or am I doing something wrong? . Thank you.
|
Next
|
Last
Pages: 1 2 Prev: how to get a m-by-n matrix from grayscale image? Next: replace one char using its index |