Question: I have the interface all set up but when it comes to linking all the variables I keep getting this error: Error while evaluating UIControl
I have the interface all set up but when it comes to linking all the variables I keep getting this error:
Error while evaluating UIControl Callback
also one of the codes I tried was:
% theFunction = str2func(get(hObject, 'string')); % display(theFunction); % x = [xmin:xstep:xmax]; % ca = get(handles.theFunction(x),'string'); % fct1 = char(ca); % axes(handles.axes1); % ezplot(ca)
Problem 1: Create a graphical user interface that allows the user to define a row vector x = [xmin:xstepxmaxL by entering the values of xmin, xstep and xmax. It also should be possible to define a trigonometric Matlab function (call it theFunction), by entering its name as a string. As soon as a set of valid inputs is provided, your program should create row vector x, compute f(x) = theFunction(x) and plot fix) over X. In addition, you are asked to display a single line of Matlab instructions in your GUI that when copied from your GUI and pasted into the Matlab command window, will create a plot identical to the one shown in your GUI graphics area. Figure 1 below shows what a possible implementation may look like Bonus Points: Add three sliders (1 point each), to control xmin, xmax and xstep. Moving a slider should update the corresponding text field, and vice versa. Make sure that the sliders can be used to only create valid inputs. The xmin and xmax sliders should cover the range of [xmin, xmax] and increment by xstep trigGUI x min: 0.8 6.2832 x step: 0.2 Function: 02 04 06 0.8 Matlab xz[ 000 0.10: 6.28]. yadOS(xk plon3% Figure 1: An implementation using five Edit Text, fields, five 'Static Text, fields, and one 'Axes, Hints: There are a couple of new functions that we explored during class that will come in handy with this assignment, they are e set .str2double num2str str2func sprintf
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
