Questions tagged [matlab-gui]

This tag deals with questions about adding, removing or modifying interactive controls in MATLAB figures. This tag should be used primarily when adding or creating GUIs **programmatically**. For questions about either of MATLAB's GUI-building tools, consider tagging with [tag:matlab-guide] or [tag:matlab-app-designer] when applicable.

Filter by
Sorted by
Tagged with
0 votes
0 answers
43 views

matlab gui plot interaction with mouse to show graph x,y

i am trying to make GUI app in matlab that plots in UIaxes, and i want to have normal matlab plot function that allows you to click on any point of plot and get x,y values. but for some reason in GUI ...
Hawasaki7's user avatar
0 votes
0 answers
22 views

Matlab App Listbox Next Button triggers value changed function

I think this is a simple problem but I can't figure it out. I am writing an app in Matlab where you can open a .mat file and it populates a list box with data from the file (10 waveforms which are ...
bmg6690's user avatar
0 votes
1 answer
87 views

Why the load() function load nothing of .MAT file when used in GUI callbacks or other self-definition functions?

I have met with a problem when trying loading .MAT file in Matlab GUI with the button callback. The code as follows: function button1_callback() [filename,pathname,filterindex]=uigetfile('*.mat','open ...
BowinChow's user avatar
0 votes
1 answer
84 views

Matlab: GUI radio button SelectionChangedFn Callback

I'm trying to figure out how to make a GUI with radio buttons that will enable/disable options based on radio button selections. Here's an example of one way I have tried: fig = uifigure('NumberTitle',...
p.lunder's user avatar
1 vote
0 answers
85 views

Connect Microsoft Access Database with MATLAB AppDesigner

I am working on a project where I am trying to create a GUI App with MATLAB AppDesigner. This App should be able to fetch data from Microsoft Access Database (.accdb). Can someone help me how to ...
Deepak Kumar's user avatar
0 votes
0 answers
87 views

set input value from GUI into global variable in matlab

i have problem with matlab gui that when i set it global variable not work and not shown in work space table also i would to use it in more than function how to use it i tryed this code but not worked ...
elgamal's user avatar
2 votes
1 answer
324 views

Close uialert figure by button click

Based on a MATLAB example, I added a close command in order to close the uifigure after pressing the OK button. However, in its current state the figure is closed automatically, rather than on the ...
JohnSal's user avatar
  • 378
0 votes
1 answer
92 views

Matlab GUI plot is blocking my click function

I have a figure in my GUI that has a clickable callback function assigned to it. It works fine, but I have a filled shape plot that blocks my clicks. Basically, I can click anywhere within the ...
Sam's user avatar
  • 93
1 vote
1 answer
383 views

How to reset MATLAB layout to default (commandline)

How do I reset the layout of Matlab in commandline instead of clicking it (shown below)? Googled but could not find, this question/answer might help others to find this information.
user2305193's user avatar
  • 2,059
0 votes
2 answers
420 views

Using a slider in MATLAB GUI

Following the hints given by Benoit_11 in Use a slider in MATLAB GUI, I started adapting his code so to fit my case. I noticed that when the vector SliderValue*(1:0.1:20).^2 is modified to SliderValue*...
J. Serra's user avatar
  • 460
0 votes
1 answer
180 views

How to assign colour to a value in static text box in GUI MATLAB

A good day everyone, I'd like to get some ideas on how to assign colour for a specific value on my static text box for GUI. Below is the coding I used to assign value to the static text box. But I don'...
Dhasheena's user avatar
1 vote
1 answer
134 views

Change the color of an inputdlg field name

This is my code: classDefault={'','','','',''}; fieldNames= {'Class Number','Class Name'}; title='Enter Class Information'; numlines=1; y =inputdlg(fieldNames,title,numlines,classDefault); it shows:...
Ahmed Elsaeed's user avatar
0 votes
1 answer
239 views

How to pass the numerical values inputted from a GUI to a .m file?

I'm trying to write a code in my .m/ GUI file that can pass a certain value obtained from an "edit text" field (called "edit 1") in GUI when I press a push button - to a .m file. ...
yacika's user avatar
  • 11
0 votes
0 answers
65 views

To click the mouse several times

If 4 'Filloval' appear, you must select all 4 ovals. If the same oval is selected 4 times, only 1 oval is selected, so the code should not terminate. However, my current code terminates when selecting ...
user14319398's user avatar
0 votes
2 answers
2k views

How do you make a MATLAB's `uifigure` appear in the center of the screen?

One can easily use the Position property to place a uifigure in the specified location of the screen. E.g., fig = uifigure('Position',[1,1,300,300]);. Is there any way to place it immediately on the ...
ashkan's user avatar
  • 476
1 vote
1 answer
425 views

How to set the focus on a specific element in a uifigure?

I have an application where an SVG image is presented to the user, and they need to fill in two edit fields based on what is presented. Since the process needs to be repeated many times, I concluded ...
Dev-iL's user avatar
  • 23.8k
0 votes
1 answer
2k views

Read data from excel to table in MATLAB App Designer

Good evening I am trying to develop a MATLAB GUI where the user can either input the data manually in a table or attach an excel folder, which will copy the data in the excel sheet in the table. My ...
ProgrammingGuy's user avatar
0 votes
2 answers
132 views

Question regarding the scope of my global variable {matlab}

i'm trying to do an assignment for my class and the undo button click should reload the previous transformation applied onto the image in case i wish to go back. The golabal variable is defined in the ...
hassan akbar's user avatar
0 votes
1 answer
79 views

Why is the uitable element in my GUI occasionally missing in MATLAB?

I am trying to display on a GUI a table that shows a comparison between two columns and based on this info, a user can select one of two options (buttons). I have been able to make this GUI, and it ...
Akhil's user avatar
  • 1
0 votes
1 answer
250 views

Brushing multiple plots in one go

I have a series of lines which I would like to mark interactively (using brush). For this purpose, I tried adapting a similar code found here. However that code is not suitable for my use case because ...
The_Learner's user avatar
0 votes
0 answers
587 views

Drawing borders around a group of components in Matlab Appdesigner

I am using Matlab 2019b Appdesigner. I have an app with many buttons, user input boxes etc and for making the navigation easier, I want to draw borders around a group of components which are under ...
vipin's user avatar
  • 1,620
-1 votes
1 answer
82 views

Button push status property GUI MATLAB

Is there any possibility to change btn1 value or some sort of it's status/property when it's pushed? For example: I've got 2 pushbuttons btn1 and btn2 in my GUI. When I click btn1 the value/flag/...
RooBy's user avatar
  • 41
2 votes
1 answer
43 views

How to use togglebutton to turn labels in scatterplot on/off

I tried to create a scatter plot with labels for each point: Now I would like to give the user of the code the possibility to turn the labels on and off. So far my code looks like this: x = rand(1,...
Ferde's user avatar
  • 25
1 vote
1 answer
769 views

How can I put an image on a Matlab uicontrol button?

I have Matlab 2019b, GUI Layout Toolbox 2.3.4 and t all runs on MacOs 14 Mojave. I want to create button in in a UI that have icons/images instead of text. I have seen here: https://...
Peter Harrison's user avatar
2 votes
1 answer
4k views

Matlab GUI not showing line plot graph data

I'm working with my Matlab GUI file to play video and plot the mean value from the color channel (RGB). It has 2 axes, the first one for the video player and second axis for the mean graph, but the ...
Mr. Nash's user avatar
0 votes
1 answer
154 views

Is there a way a string be converted into a function call inside a matlab GUI?

I am trying to call upon a matlab GUI inside another matlab GUI. This matlab GUI has the name of a string which is available inside the GUI. I want to know how to change this string into a function, ...
Flat Boofy's user avatar
0 votes
1 answer
56 views

How to delay between loop without effect to GUI

I am working in MATLAB with GUI. And I have a for loop and GUI with while loop globally, each step I need to delay for about 1 second. But when I use pause(1), the GUI will get stuck and while loop is ...
Neo's user avatar
  • 1,469
1 vote
0 answers
33 views

Is there a way or option to create a custom shaped button in MATLAB?

How can we create a custom shaped buttons in MATLAB or is there a way to use an image and on-click do this %calculation?
raghavendra kandukuri's user avatar
0 votes
1 answer
510 views

MATLAB GUI handles

I have question about using "handles" in Matlab Callback function. I don t know how to use the same thing twice. Please help me. So,I build Matlab GUI and I have callback function for upload image: ...
Anđela Marinović's user avatar
0 votes
1 answer
64 views

Trying to read large data file and store it in workspace so that other functions can use it

I want my GUI to be able to read a file, containing header info and several columns of values, and store it so that other actions can be performed on the data, Such as mean, max, RMS etc. The '...
Razoll's user avatar
  • 107
0 votes
1 answer
53 views

Get the value of one .m file and use those values to plot in MATLAB GUI

lets suppose i have a .m file which contains the following code a=[1:0.01:10] x=sin(2.*pi.*a) plot(a,x) check where check.m is GUI file which takes the value a and x plot it in axes1. Question1: ...
A R.'s user avatar
  • 323
1 vote
2 answers
1k views

How to use "ButtonDownFcn" in a populated GUI axes?

I have a very simple GUI made in guide where i have a plot function initiated by a pushbutton which plots a scatter plot in axes (called Method1axes1): handles.plot = scatter(X,Y, 'parent', handles....
Birch78's user avatar
  • 71
12 votes
1 answer
107 views

How to add a "tutorial message div" to figures?

After installing R2018b, the first figure I opened contained an interesting message (shown in blue): The reason it's interesting is because it contains features like text wrapping, transparency, the ...
Dev-iL's user avatar
  • 23.8k
1 vote
1 answer
115 views

MATLAB Gui, text-box value on buttonpress without GUIDE

I have a certain GUI built without GUIDE, just plain old uicontrols and I've gotten everything to work properly so far. However I want to, upon a button press grab the value in a text-box (edit) and ...
Anton Hagelberg's user avatar
1 vote
1 answer
408 views

Unable to access the values a user inputs into text boxes

I am trying to collect several values inputted into NumericEditField controls by a user and store them in order to use them later in a computation, whose result gets presented back. I seem to be able ...
Austin Justman's user avatar
0 votes
1 answer
280 views

Using imline with uiaxes

I am trying to design an app using Matlab 2017b with appdesigner. I want to attach a movable line to an image using the imline function. However, appdesigner appear to use a new type of object, uiaxes,...
ceiltechbladhm's user avatar
0 votes
2 answers
242 views

Accessing the value of other sliders from within a ValueChangingFcn

I have multiple sliders inside a figure, and I would like to publish their values (using the robotics toolbox) when one of them changes. I'm unable to access the value of more than one slider - an ...
Surabhi Verma's user avatar
1 vote
0 answers
498 views

How to convert the MATLAB GUI *.m file generated by GUIDE's export tool back to a *.fig file?

As described : https://blogs.mathworks.com/community/2011/04/04/guide-guis-in-all-one-file/, it's possible to export a GUI *.fig file (and it's *.m file) to a single *.m file, which is very useful for ...
mattboud's user avatar
7 votes
1 answer
303 views

Making a dialog where the user can choose either a file or a folder

In MATLAB, there's a function that prompts the user to choose one or more files - uigetfile, and there's another function which allows the user to choose a folder - uigetdir. I would like to provide ...
Dev-iL's user avatar
  • 23.8k
1 vote
1 answer
131 views

Adding a header to a listbox

I want to know if it's possible to make first two lines (Titles and horizontal line in the image below) always show on top and to be unclickable, to make them something like a header of the current ...
unesic's user avatar
  • 53
1 vote
0 answers
426 views

Run MATLAB script on cmd without opening the GUI window or the icon [duplicate]

I run the command below to execute a MATLAB script on the cmd, but I don't want it to display the matlab window or the icon on the bare spot, what's the proposed solution? matlab.exe -nodisplay -...
Adlan Kadri's user avatar
0 votes
1 answer
419 views

How to define a callback function to receive TCP/IP data stream in MATLAB GUI?

I wrote the following simple GUI to do that but still the callback function (RXDATA) does not execute at all that I want to use to receive data from the remote computer. function com_test_OpeningFcn(...
Remy's user avatar
  • 97
1 vote
1 answer
152 views

How to save some values from gui into a text file and load them elsewhere as a number?

I have 2 values from an edit box and I want to write them in a txt file when I press a push button function Masaedit_Callback(hObject, eventdata, handles) % hObject handle to Masaedit (see GCBO) ...
Alexandru Lapusneanu's user avatar
0 votes
1 answer
200 views

Plotting surf plot into axes object in GUI from .m-file

I am a little lost... I have an .m file that plots a surf plot into a figure repetitively with a hold and a "draw now" so as to create an animation. I have now created a GUI (tag: 'GUI') with guide ...
budekatude's user avatar
0 votes
1 answer
384 views

MATLAB GUI: updating variables to mat file

I have program where at the end a GUI is launched. I built it using guide. I load 4 variables from my program into 4 GUI text boxes using a mat file called n.mat (and a pushbutton feature). In the ...
Jack's user avatar
  • 41
5 votes
1 answer
809 views

How can I implement the deprecated full crosshair pointer functionality in MATLAB?

I'm trying to replace the pointer on a chart plot with a full crosshair (that is, a set of 2 perpendicular lines that stretch to the edges of the plot vertically and horizontally and follow the mouse ...
Alarik's user avatar
  • 301
0 votes
2 answers
1k views

How to access variables from base workspace within function?

I am a nested function inside a function and I am calling variables from base workspace. Note that guiel is in base workspace. function callback(~,~) vars.dropheight = str2num(get(edit(2),'String'...
David Ling's user avatar
0 votes
1 answer
280 views

How do I access the highlighted text in a Matlab GUI edit box

I would like to have a text box and a button in my GUI. When the button is pressed, a history window will come up, and if the user selects a previous entry the text that they have highlighted in the ...
noob42's user avatar
  • 159
0 votes
2 answers
100 views

Programmatic Method of Handling Matlab Dialog Windows

I have a rather large Matlab program that is GUI based. I am looking into creating automated tests for it, as the current way of checking for bugs before a release is simply using all its ...
noob42's user avatar
  • 159
0 votes
1 answer
46 views

how to access a gui object in a nested function from a base workspace

I think my issue is I don't know how to access guiel.hAX(3) property in my button callback function where I put kiddies = get(guiel.hAX(3),'Children'); I got the error: Undefined variable "guiel" or ...
David Ling's user avatar