Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help!!! Do not know how to create a call back funtion nor function in GUI. Need

ID: 3810848 • Letter: H

Question

Help!!! Do not know how to create a call back funtion nor function in GUI. Need help and examples

Project 3 Project Assignment Design a general analysis system using Matlab's Graphical User Interface Design Environment (GUIDE) that completes the following analysis types: 1. Addition of two sinusoids 2. Product of two sinusoids 3. Shifted product of a user supplied data vector I. Linear system of equations analysis. Sine Wave Analyses Analysis types 1 and 2 are similar in description and thus will be described concurrently. These analysis types requires the user to input the amplitude, frequency, and phase offset of 3 disctinct sine waves. The amplitude and frequency for each sine wave is obtained separately from the user through the appropriate input dialog boxes. The phase offset for each sine wave is obtained from the respective slider for each sine wave. The slider limits should enable the addition of a phase offest value between -2T and 2T. These analyses also requires user input values for the sample frequency and length of the samples. Use these values to determine the length of each sine wave. Plot Input Sinewave 1 in plot area 1 and Input Sinewave 2 in plot area 2 for both analysis types 1 and 2. Plot area 3 contains the sum of Input Sinewaves 1 and 2 along with a plot of Input Sinewave 3 for analysis type 1. Similarly, plot area 3 contains the product of Input Sinewaves 1 and 2 along with a plot of Input Sinewave 3 for analysis type 2. User Supplied Data Analysis The third analysis type consists of operations on a user supplied data vector. This section displays the data vector in plot area 1, a shifted version of the input in plot area 2, and the product of the shifted and unshifted version of the data vector in plot area 3. Finally, the analysis system should provide the solution to a linear system of equation. The name of the coefficient matrix

Explanation / Answer

Callback Function: The function that controls component behavior by performing some action in response to an event for that component is called a callback function.

Callback function in GUI: Software that works as an interface between a computer and its user and which has graphic elements(Dialog box,icons,menus, scroll bars) is called as GUI(Graphical user interface).

NOTE: callback execution might be delayed if the call back involves CPU intensive task or if MATLAB software processing another task.

Some kinds of callback functions:

Example: Plot button Callback

The plot button callback performs 3 tasks: 1.Gets the name of the variables selected by the user in listbox. 2. Type of the plot selected by the use in the pop up menu. 3. Constructs and evaluates the plotting command in the MATLAB base workspace.   

Callback Property Description Components ButtonDownFcn Executes when the user presses a mouse button while the pointer is on or within five pixels of a component. Axes,
figure, uibuttongroup, uicontrol, uipanel Callback Control action. Executes, for example, when a user clicks a push button or selects a menu item. Uicontextmenu, uicontrol, uimenu ClickedCallback Control action. Executes when the push tool or toggle tool is clicked. For the toggle tool, this is independent of its state. Uipushtool, uitoggletool CloseRequestFcn Executes when the figure closes. Figure CreateFcn Initializes the component when it is created. It executes after the component is created, but before it is displayed. Axes,
figure, uibuttongroup, uicontextmenu, uicontrol, uimenu, uipanel, uipushtool, uitoggletool, uitoolbar DeleteFcn Performs cleanup operations just before the component is destroyed. Axes,
figure, uibuttongroup, uicontextmenu, uicontrol, uimenu, uipanel, uipushtool, uitoggletool, uitoolbar KeyPressFcn Executes when the user presses a keyboard key and the callback's component has focus. Uicontrol, figure OffCallback Control action. Executes when the state of a toggle tool is changed to off. Uitoggletool OnCallback Control action. Executes when the state of a toggle tool is changed to on. Uitoggletool ResizeFcn Executes when a user resizes a panel or button group whose Resize behavior is set to Other. Figure, uibuttongroup, uipanel SelectionChangeFcn Executes when a user selects a different radio button or toggle button in a button group component. Uibuttongroup WindowButtonDownFcn Executes when you press a mouse button while the pointer is in the figure window. Figure WindowButtonMotionFcn Executes when you move the pointer within the figure window. Figure WindowButtonUpFcn Executes when you release a mouse button. Figure
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote