matlab-gui

How to add data to existing XLSX file in MATLAB every time using a push button?

你说的曾经没有我的故事 提交于 2021-02-17 02:38:40
问题 I have a function which generates some variable, like score, right, wrong, unanswered. This function is called using a push button. The problem is how can I add/append these values generated by a function to an XLSX file every time? Or, how to create a MAT file so that it can be added? What may be a possible solution? 回答1: The challenge involved in appending to a xls file is knowing its last row, to avoid overwriting data with the xlswrite command. I'd suggest taking a look at this file

How to add data to existing XLSX file in MATLAB every time using a push button?

假装没事ソ 提交于 2021-02-17 02:37:04
问题 I have a function which generates some variable, like score, right, wrong, unanswered. This function is called using a push button. The problem is how can I add/append these values generated by a function to an XLSX file every time? Or, how to create a MAT file so that it can be added? What may be a possible solution? 回答1: The challenge involved in appending to a xls file is knowing its last row, to avoid overwriting data with the xlswrite command. I'd suggest taking a look at this file

Save brushed data to variable on button push

喜你入骨 提交于 2021-01-29 05:16:56
问题 I'm trying to save brushed data to a variable on button click. I've read other questions but can't find the method to do it. Inside a script the following code works: t=0:0.2:25; x=sin(t); n=plot(t,x,'s'); brush on pause brushedData = find(get(n,'BrushData')); However, calling the function selectBrush does not work: function selectBrush() % Create data t=0:0.2:25; x=sin(t); % Create figure with points fig=figure(); n=plot(t,x,'s'); brush on; addBP = uicontrol(1,'Style', 'pushbutton',...

How to customize the background of an App Designer figure?

自闭症网瘾萝莉.ら 提交于 2021-01-27 06:53:12
问题 I'd like to attach a logo or change the whole background of an App Designer uifigure . How can this be done? 回答1: If you want to set a solid background color for the entire figure , there exists a documented way to do this, e.g.: % When creating a new uifigure: fig = uifigure('Color',[R G B]) % if the uifigure already exists: fig.Color = [R G B]; If you want to change the background color of just some region , you can add a uipanel with no title or border ( uipanel(...,'BorderType','none',

Using uigetdir as callback for a pushbutton, crashes due to weird, invalid arguments

梦想的初衷 提交于 2019-12-25 07:20:01
问题 I am trying to create a simple "browse" button on a Matlab (R2016a) GUI. My code is something like: hd = dialog; hb = uicontrol('parent',hd,'style','pushbutton','string','browse',... 'callback',@uigetdir); The callback function uigetdir has 2 optional arguments STARTPATH, TITLE . In principle I could pass these on my callback by concatenating them with the function handle on a cell array, such as hd = dialog; hb = uicontrol('parent',hd,'style','pushbutton','string','browse',... 'callback',{

grabbing the index value from the pointer when clicking on the image in MATLAB

若如初见. 提交于 2019-12-24 01:55:28
问题 How can I find the index of a point on click on and add it to end of an array, list or vector? h=figure; image(result); locx = []; locy = []; while (ishandle(h)) pos = get(0, 'PointerLocation'); locx(end + 1) = pos(1); locy(end + 1) = pos(2); pause(1); end While I have only clicked on two points to see their x,y and index, many x locations has been saved in locx array. Please suggest solution and fixes: locx = Columns 1 through 16 635 1116 231 758 771 591 596 46 116 116 116 1362 852 498 1920

How to make a function non-blocking? Dynamic plotting in Matlab GUI

女生的网名这么多〃 提交于 2019-12-12 03:36:27
问题 It's been some time since using Matlab and I've never used it for any GUI creation until now. My goal is to have a button which I can press, and then have the results plotted as they are calculated. The button should toggle between 'Start' and 'Stop' depending on what is happening. These results are collected for several iterations and each iteration gives another data point. My solution was to pass the axes to the function doing the calculations, which can then plot to the axes. This works,