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

If anyone could help me setup the code for this GUI I wpould appreciate it. Desi

ID: 3349325 • Letter: I

Question

If anyone could help me setup the code for this GUI I wpould appreciate it. 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 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 -2 pi and 2 pi.

EECE2207_ Pict3 Input Sine 1 Project 3 GUI Input Sine 2 Sample Freq Sample Length(s) User Supplied Data Section Linear System of Equation Section Analysis Selector

Explanation / Answer

Call back 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).

call back function roll as given below:-

A component can be any control devices such as menu, toolbar, a toolbar tool, panel, push button or slider. For example, GUI has an icon for plotting some data, then the user clicks the button, MATLAB calls the call back user associated with clicking the button, and call back then gets the data and plot it.

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

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 for plot button//

function plotButtonCallback(src,evt)

//Get workspace variables//

vars = get(listBox,'String');

var_index = get(listBox,'Value');

if length(var_index) ~= 2

errordlg('You must select two variables',...

'Incorrect Selection','modal')

return

end

//Get data from base workspace//

x = evalin('base',vars{var_index(1)});

y = evalin('base',vars{var_index(2)});

//Get plotting command//

selected_cmd = get(popUp,'Value');

//Make the GUI axes current and create plot//

axes(a)

switch selected_cmd

case 1 % user selected plot

plot(x,y)

case 2 % user selected bar

bar(x,y)

case 3 % user selected stem

stem(x,y)

end

end     //plotButtonCallback//

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