I have created a GUI where I have created push buttons for output and linked them to plot a graph. Each code uses a few input parameters like frequency etc. I want to be able to input values in GUI using edit boxes which will change the output. How?
Show older comments
I have created edit boxes for input parameters and want to link them to my output code in the callback of pushbuttons so that on changing input value, the code output changes leading to a change in the graph plot.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
c=3e11
N=16
freq= 3.3e9
dx=81
lamda= c/freq
K= 2*pi/lamda
theta_zero = 90;
An=1;
m=1;
for theta=-90:1:90
thetarad= (theta*pi)/180;
AF=0;
for n=0:N-1
AF= AF+An*exp(j*n*K*dx*(sin(thetarad)));
end
AFtheta(m)=AF
m=m+1;
end
maxAFtheta=max(AFtheta);
AFtheta=AFtheta/maxAFtheta;
AFtheta=abs(AFtheta);
plot(-90:1:90,20*log10(AFtheta));
%pushbutton1(handles.current_data);
My input boxes would be for dx, freq etc. How do i link my edit boxes for input to the code here? Thanks.
Accepted Answer
More Answers (0)
Categories
Find more on Specifying Target for Graphics Output in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!