matlab-guide

MATLAB slider step behavior

徘徊边缘 提交于 2021-02-18 05:07:12
问题 I have a created a slider widget using GUIDE in MATLAB 2012a. I want it to control an axis that displays images inwhich the slider steps through a sequence of them. I have set the slider's properties for Min, Max, and SliderStep in one part of the m-file. sliderMin = 1; sliderMax = size(result); % this is variable sliderStep = [1, 1]; % major and minor steps of 1 set(handles.slider, 'Min', sliderMin); set(handles.slider, 'Max', sliderMax); set(handles.slider, 'SliderStep', sliderStep); set

Use a slider in MATLAB GUI

南楼画角 提交于 2021-02-11 12:15:27
问题 Really simple question. I wish to create GUI with a simple plot that changes something with a slider. I have been using the GUI and have a slider+text on a panel and axies1. So for starters I just wish to have the slider going from 1:10 (no specific increments) and scaling the y-values (by 1:10). I have imported my data into the GUI, so leaving out the generic auto-generate code I have: Under Graphslide_OpeningFcn handles.OutAirTemp = OutAirTemp; handles.SupAirTemp = SupAirTemp; guidata

Sort JSON by values in MATLAB

删除回忆录丶 提交于 2021-01-29 17:26:46
问题 I would like to sort my values in the JSON file order by "createdAt" and use these values in the plot function. As you can see this column stores date value so I've converted it. And I've applied the sort function but when I see the output of the data, it seems sort does not apply. data = loadjson('C:/data/default.json'); count_data = sum(cellfun(@(x) numel(x),data.Location)); %returns 21 for i=1:count_data createdAt= cellfun( @(cellElem) cellElem.createdAt, data.Location ,'UniformOutput'

How to make my help button will show matlab help?

别等时光非礼了梦想. 提交于 2020-01-30 11:28:25
问题 Hye guyz.. If i want to make a help button for my figure. How can i make if the user pressed the help button, it will appear matlab helper which is like product help, function browser and etc.. How can i link it? Is there any tutorials regarding making a help button? 回答1: You can set the Callback property of the button to 'doc(''plot'')' . This command will be executed when the button is pressed. You can set the callback with the property editor in GUIDE. If you want to do it programmatically

MATLAB GUI: Update textbox when moving drawpoint

筅森魡賤 提交于 2020-01-24 20:11:42
问题 I have a GUI where the user clicks a button to place a point ( drawpoint ). After placing the point, the Euclidean distance is calculated between it and a static point chosen prior. I want to be able to move point created by the pushbutton; such that, after moving the point the Euclidean distance is recalculated and spit into a textbox. I tried using addlistener (in the GUI_OpeningFcn postion) for the created point; however, I cannot figure out how to do this, as the handle doesn't exist

how to save imageof axes for high resolution in matlab GUI

我是研究僧i 提交于 2020-01-16 19:04:08
问题 I trying save image with the comand 'getframe' but resolution is very low, so I can not give zoom. for now I'm using the code: [arq,dir] = uiputfile('*.jpg','Output Files'); fileName=fullfile(dir,arq); f=getframe(handles.axes1); [x,map]=frame2im(f); imwrite(x,fileName,'jpg'); I need save in jpg and also need save the label (x,y) in graph. How do ? There is another command better than the getframe?? Print is a good command? Thanks 回答1: try using something other than jpg, it doesn't scale well.

How to get point of a figure (using callbacks in GUI) when the point is inside a region that previously has been “patched”?

◇◆丶佛笑我妖孽 提交于 2020-01-14 05:07:26
问题 I am using patch in order to draw inside an ellipse into a figure I have created in gui environment. Normally, I get figures' points (coordinates) by clicking (using callback functions). It works properly when the point I want to grab is not inside an ellipse that I have previously plotted (applying patch ). What should I do after applying patch in order to be able to get a point that is inside some ellipse after I have drawn it? Thanks a lot! 回答1: Here's a way to solve your problem: First we

Matlab gui WindowButtonMotionFcn crashes when called too often?

六月ゝ 毕业季﹏ 提交于 2020-01-13 11:24:30
问题 I've set WindowButtonMotionFcn to my callback which plots three plots, with the data depending on mouse position. However this seems to be too much for MATLAB to handle, because after moving my mouse around a bit, the GUI stops responding. I use this code (copied parts from someone): set(handles.figure1, 'windowbuttonmotionfcn', @hover_Callback); function hover_Callback(hObject, handles, eventdata) inside = false; pos = get(handles.axes1, 'currentpoint'); xlim = get(handles.axes1, 'XLim');

Matlab gui WindowButtonMotionFcn crashes when called too often?

你说的曾经没有我的故事 提交于 2020-01-13 11:24:06
问题 I've set WindowButtonMotionFcn to my callback which plots three plots, with the data depending on mouse position. However this seems to be too much for MATLAB to handle, because after moving my mouse around a bit, the GUI stops responding. I use this code (copied parts from someone): set(handles.figure1, 'windowbuttonmotionfcn', @hover_Callback); function hover_Callback(hObject, handles, eventdata) inside = false; pos = get(handles.axes1, 'currentpoint'); xlim = get(handles.axes1, 'XLim');