FAQ Database Discussion Community


Converting a MATLAB GUI to .exe with trial version of MATLAB

matlab,matlab-guide,matlab-compiler
I am using MATLAB 2014a trial version. I developed a MATLAB GUI, and I want to convert it to a .exe file, which I will be able to open when my trial will be over. I searched the web and found out that I have to use MATLAB Compiler in...

Plotting several curves in Matlab GUIDE in real time

matlab,matlab-guide
I need to plot 2 variables in the same axes in real time using the MATLAB GUIDE. Right now I´m successfully plotting 1 variable per subplot. In order to do that I created in the _OpeningFcn a timer and 2 handles.plot: handles.timer = timer(... 'ExecutionMode', 'fixedRate', ... % Run timer...

colormap for imshow in GUIDE axes object

matlab,matlab-figure,matlab-guide
I have using GUIDE to display raster data inside of a axes object. But I want to colormap to be the 'colorcube' map. Right now I set this with two lines: function mapImage(data, box) low = min(min(data)); high = max(max(data)); imshow(data, [low high], 'Parent', box); colormap(box, colorcube); Update: I do...

Which scaling technique does it use?

matlab,statistics,matlab-guide,matlab-deployment
I have a matrix X, the size of which is 100*2000 double. I want to know which kind of scaling technique is applied to matrix X in the following command, and why it does not use z-score to do scaling? X = X./repmat(sqrt(sum(X.^2)),size(X,1),1); ...

Stop A GUI in a middle of process in MATLAB

matlab,user-interface,matlab-guide
I'm designing a GUI using GUIDE in MATLAB R2014b. My program has a long loop (takes 2~5h to process). I want have a button in my GUI that the user stop the process every time he/she want (The GUI is updating graphs and texts continuously based on result of loops)....

Push button is only changing position once

matlab,matlab-guide
I have a question about callback functions in MATLAB's GUIDE. I have the following code execute when a button is pushed: handles.xPos=handles.xPos+1 addX = handles.xPos handles.shape2 =fill ([-2+addX 1+addX 1+addX -1+addX], [1 1 -1 -1], 'r'); This works, but only once (and the old shape is still there, but that...

getting a return value from a function in MATLAB

matlab,matlab-figure,matlab-guide,matlab-deployment,matlab-compiler
I have such a matlab function: function j = globalfun(a, xr, x) gv_0 = 0; gv_1 = 0; counter1_0 = 0; counter1_1 = 0; counter2_0 = 0; counter2_1 = 0; counter3_0 = 0; counter3_1 = 0; counter4_0 = 0; counter4_1 = 0; ............................................ ............................................ score = gv_0/gv_1; end I haven't...

Using Workspace variables in a GUI matlab

matlab,neural-network,workspace,matlab-guide
I have a workspace called finalnet. Inside the workspace i have a neural network called net. and I want to use the network in one of the functions in my GUI. Is there a way to do that? I tried to use evalin function : network = evalin('finalnet','net') but i...

I want to make panorama image but it is showing the error message Undefined function 'imageSet' for input arguments of type 'char'

matlab,image-processing,matlab-guide
Undefined function 'imageSet' for input arguments of type 'char'. Error in build (line 3) buildingScene = imageSet(buildingDir); % Load images. buildingDir = fullfile(toolboxdir('vision'), 'visiondata', 'building'); buildingScene = imageSet(buildingDir); % Display images to be stitched montage(buildingScene.ImageLocation) % Read the first image from the image set. I = read(buildingScene, 1); % Initialize...

How can I change the GUI controls' properties programatically in Matlab?

matlab,user-interface,properties,matlab-guide
As the question title says, I don't know how to change programatically the properties of the different controls that come with the Matlab GUI. Let's say that I have an edit control, whose String property I want to modify. What code do I write? I researched both the on-line and...

re-plotting of data on same GUI axes in matlab

matlab,matlab-figure,matlab-guide
I am working with GUI in matlab and I have one axes to plot the data. I want to keep track what I have already plotted in order to re-plot it if needed on same axes and for this purpose, I have list box which holds names of data sets...

Error in using GUIDE in Matlab

matlab,user-interface,matlab-figure,matlab-guide
This is the code for my GUI using GUIDE function varargout = testcreat(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @testcreat_OpeningFcn, ... 'gui_OutputFcn', @testcreat_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});...

Simultaneous interaction with 2 figures in MATLAB GUI

matlab,user-interface,matlab-figure,matlab-guide
I am writing a GUI in MATLAB (guide) where user will be shown 2 images(both images are positioned side by side in single gui window) from a series of images (but each drifted little bit) and will be allowed to select area of interest. I want user to select working...

MATLAB reset axes position copied from GUIDE

matlab,matlab-figure,matlab-guide
After copying an axes from GUIDE to a new figure, f=figure; copyobj(handles.axes1,f) I found out that the position of axes1 is not on the right place. How can I reset new axes position to the default value? This value it copied from the position in GUIDE which should not be...

How to get varargout to output text from pushbuttons in Matlab GUI?

matlab,matlab-guide
I am trying to create a GUI using GUIDE where it allows the user to pick one of two pushbuttons. The strings in the pushbuttons will vary each time (I haven't automated this yet), but when any of the pushbuttons is pushed, I'd like the GUI to put out the...

Properly using button/checkbox callback

matlab,matlab-guide
I have some problems when it comes to defining a callback function and using handles. h1 = uicontrol('style','pushbutton','units','pixels',... 'position',[40,5,70,20],'string','test',... 'callback',@h1_call); I create a button with the code above and want to plot some information stored in the handles if I push on this button. function h1_call(handles) axes(handles.ax1) plot(handles.x,handles.y); sadly this...

show axes on click - matlab

matlab,user-interface,listbox,matlab-guide
I have a listbox button , lets say it contain 3 options : '1' '2' '3'. I also have 5 axes. When '2' is selected I plot something on this 5 axes. What I wanted to know is how to make 5 more axes that will be shown only in...

Plotting in a nested function on matlab GUI

matlab,plot,matlab-guide
I am struggling to use axes on my GUI because it says it is not defined. Here is the summary of the code : function bitirme_OpeningFcn(hObject, eventdata, handles, varargin) axes(handles.axes1) imshow('photo1.jpg'); ... function pushbutton1_Callback(hObject, eventdata, handles) theta=inverseKinematic(...) ... function [Theta1,Theta2]=inverseKinematic(angle1,angle2,angle3,desCorX,desCorY) axes(handles.axes1); .... plot(a,b); .... Until the function inverseKinematic is called,everything...

Matlab define callback function for mouse click on a biograph

matlab,matlab-figure,matlab-guide
all! This is my first question on stackoverflow! In matlab, I create a biograph and visualize it. cm = [0 1 1 0 0;1 0 0 1 1;1 0 0 0 0;0 0 0 0 1;1 0 1 0 0]; bg1 = biograph(cm); view(bg1) Now I want to define callback...

matlab - GUIDE with input arguments - uimenu autoupdates its submenus

matlab,matlab-guide
I have a struct that contains some debug-options i.e: dbs = struct('db1', 0, 'db2', 1). And user can add more debug options to this struct (db3, db4 etc.) later, as well as change the value of existing fields db1, db2. I want to create a GUI dbGUI with uimenu Debug...

Why does my text value not appear in matlab gui?

sql,matlab,textbox,matlab-guide
I've managed to retrieve 5 string values from my database whereby results = 'something1' 'something2' 'something3' 'something4' 'something5'. Now I want these values to display in my edit texts Matlab GUI. How do I do that? How to pass all values from results = curs.Data; to all 5 different set(handles.edit1,'String');?...

vision.VideoPlayer embedding in GUIDE created GUI

matlab,user-interface,image-processing,matlab-guide,matlab-cvst
I'm trying to use the vision.VideoPlayer in a custom created GUIDE GUI. The video source is a camera. Right now I can get it to work with the camera but the vision.VideoPlayer object pops out of my gui. I've read the example given but it seems that this doesn't use...

Counters do not update

matlab,matlab-guide,handles
This is a first for me. I have started using GUIDE and after mild cussing I have hit rock bottom. I have setup a counter in a m-file but for some reason it does not update. Could you please help me. The counter is called num. function ack = streamSensor_1_2_3(hObject,...

Matlab GUI table - index exceeds matrix dimensions

matlab,user-interface,matlab-guide
I have created a Matlab GUI with Matlab's GUIDE tool and am executing some code now. As part of the output, I created a table, which I would like to populate with a matrix I calculated previously. I am continuing to run in the "index exceeds matric dimensions" problem and...

Variabile behaving differently in debugging vs. non-debugging in Matlab?

matlab,user-interface,matlab-guide
I work with the GUI from Matlab R2014a. I want to see if there is something written in an edit control. If it is, then the program does something. If it is not, then it does something else. The code that I wrote is this (in the KeyPressFcn callback): h1=findobj('Tag','btnOK1');...

Create and display clickable cell of cells in Matlab GUI

matlab,uitableview,matlab-guide,cell-array,clickable
So I want to display a cell matrix in Matlab GUI. Moreover, some of that cells are arrays of cells, and I want them to be clickable and that by clicking on them I activate a function. Imagine I have a cell matrix: A=cell(2,2); A{1,1}='Collumn1'; A{1,2}='Collumn2'; A{2,1}={'A','B','C','D'}; A{2,2}={'E','F'}; I want...

In a Matlab gui how do you execute a .m file returned as a result of uigetfile?

matlab,matlab-guide
I have a Matlab gui with a button that calls uigetfile. The user picks the file they want to run, and then my gui should execute that .m file, returning the results to the gui for further processing. Uigetfile works great and I can capture the filename and filepath: [filename,...

Pop-up menu and graph focus in Matlab

matlab,matlab-figure,matlab-guide
So I have this in GUI, which plots a scatter3 plot with the given x, y and z coordinates. function activation(hObject, eventdata, handles) cla(handles.eeg_final,'reset') axes(handles.eeg_final) x = [-30;-50;-40;-60;-60;-60;-30;30;60;60;60;40;50;30]; y = [50;30;30;0;20;-60;-80;-80;-60;20;0;30;30;50]; z = [30;0;40;30;0;0;10;10;0;0;30;40;0;30]; location={}; s=cell(1,14); for a = 1:14 location{1} = sprintf('AF3'); location{2} = sprintf('F7'); location{3} = sprintf('F3'); location{4}...

Matlab GUI - Axes callback for mouseclick

matlab,matlab-guide
I am programming a GUI with matlab and somehow I have problems with the callbackfunction of a mouseclick on an axes. I found some similar topics but the solutions given there won't solve my problem. The important parts of my code look like this (first normal try with the ButtonDownFcn...

Hatch a plot in MATLAB

matlab,matlab-guide
I use this code in order to generate a graph: And I must to hatch everything outside the square. pos = [3.75 5.6 53.5 29.5]; %spatiul nemasurat axis([0 61 0 45]) %axele set(gca,'YTickLabel',{'0', '7.5','11.85', '16.2', '20.55', '24.9', '29.25', '33.6', '39.3', '45'}) rectangle('Position',pos,'EdgeColor','black') ...

Printing a multi-line String token from Textbox into file

string,matlab,matlab-guide
Working on a Matlab guide, I want to take input from user using a text-box then print this input in a file to use it in many things. The problem that the input string into the text box contains multiple lines. when I print it to a file it's printed...

Error using * Inner matrix dimensions must agree

matlab,matlab-figure,matlab-guide,telecommunication
I'm trying to calculate some functions in matlab and I'm getting this error: Error using * Inner matrix dimensions must agree. Error in set1 (line 11) x = (Ac + m)*cos(2*pi*fc*t); but I don't use any kind of matrix in my code. What is the problem about? Here is my...

Call Axes from another GUI

matlab,image-processing,matlab-guide
I have created two GUI . In one GUI i have axes1 and in another GUI i have function which blur image using slider. GUI1 GUI2 this is the function in GUI2. function gui_blurSlider_Callback(hObject, eventdata, handles) % % % here global var img is a image used in GUI1 %...

“zscore” function in Matlab

matlab,matlab-guide,matlab-deployment,matlab-compiler
I saw this z = zscore(x,0,2) online, I want to know what the "0" and "2" represent? Which decide the value of "0" and "2"? and if I use z = zscore(x,0,4),does that mean it will more likely generate NaN value in the future calculation? Thank you so much!

retrieve values and export to workspace from a radiobutton in a buttongroup

matlab,user-interface,matlab-guide
I'm trying to modify this gui http://www.mathworks.com/matlabcentral/fileexchange/20604-3d-slice-viewer because I'd like to add a feature. This new feature is to assess diseases, I mean if the slice that is currently on the viewer has disease the user click yes, otherwise click no. And this should be done several time per patient....

Using the properties of the Matlab GUI components programatically

matlab,user-interface,matlab-guide
I am trying to make a simple test. I want to see if the String property of an edit component has a certain value. How do I use this property programatically? A syntax like if (edit.String=='Text') then... Seems not to work. Where am I mistaking?...