Creating Graphical User Interface for a Code

7 views (last 30 days)
Hi,
Here I am adding a simple code:
mx=20; my=5;
[x,y]=meshgrid(-1:2/127:1, -1:2/127:1); circ=sqrt(x.^2+y.^2)<1; H=circ.*(cos((x*pi*mx)+(y*pi*my)))>0;
figure(1) imagesc(H); colormap gray; axis image; axis off
%Fourier Transform z=fft2(H, 512,512); m=fftshift(z); q=abs(m);
figure(2) imagesc(q); colormap gray; axis image; axis off
I have no idea how to make a GUI out of this code so that I have the value of 'mx' and 'my' as input and the figures as output in Matlab. Can anyone help me in this regard?
Thanking You!

Answers (1)

Chad Gilbert
Chad Gilbert on 18 Jul 2013
Edited: Chad Gilbert on 18 Jul 2013
If you are new to MATLAB GUI programming, your best bet is to use GUIDE. Type 'guide' on the MATLAB command line to begin. There are many tutorials listed here: https://www.mathworks.com/matlabcentral/answers/30070-gui-guide-tutorials
Good luck!

Categories

Find more on Graphics Object Properties 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!