matlab-figure

Why my plot is not working in loop for different graph representations? [duplicate]

蓝咒 提交于 2019-12-12 04:45:12
问题 This question already has an answer here : Plot several lines (looping through line styles in cell array) in Matlab (1 answer) Closed 2 years ago . I have a matrix 'capacity' and I want to plot its row and for that I have used a loop, my code is for j_1=1:8 plotStyle = {'k -','r +','g *','b.','y o','r--','b d','g s'}; hold on; plot(x_1,capacity(j_1,:),plotStyle(j_1)); end hold off; x_1 is just the x axis, the number of elements in x_1 is equal to the number of columns of capacity.But I am

save GUI figure in matlab

北慕城南 提交于 2019-12-12 04:37:36
问题 let us consider following program for graphical user interface function varargout = quadratic(varargin) % QUADRATIC MATLAB code for quadratic.fig % QUADRATIC, by itself, creates a new QUADRATIC or raises the existing % singleton*. % % H = QUADRATIC returns the handle to a new QUADRATIC or the handle to % the existing singleton*. % % QUADRATIC('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in QUADRATIC.M with the given input arguments. % % QUADRATIC(

Make the slider as a progress bar in matlab GUIDE

会有一股神秘感。 提交于 2019-12-12 04:27:01
问题 I am having hard time to make slider to behave as a progress bar. I have two push buttons. One accepts the starting value from a text editor(User Input) and other start the progress of the loop. Then I have got a slider, which I am trying to move as the function loop changes 'i' value(Update along/show progress). This is my code. function varargout = myfig(varargin) % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui

compute the average over simulation for different parameters values

ぃ、小莉子 提交于 2019-12-12 03:42:38
问题 I am working on something similar to the following example: I want to compute <x(t)> that is the average of a function x(t) over number of simulations. To do this, I generate the following code: sim=50;% number of simulations t=linspace(0,1);% time interval a_range=[1,2,3];% different values for the parameter a b_range=[0,0.5,1];% different values for the parameter b z=zeros(1,sim); theta=zeros(1,sim); for nplot=1:3 a=a_range(nplot); b=b_range(nplot); average_x=zeros(nplot,sim); for i=1:sim z

GUIData not updating properly

99封情书 提交于 2019-12-12 03:19:24
问题 I have a GUI in MATLAB which contains a timer. I want every time the timer is called to increment an index by one, and store it in the guidata. I would like functionality to go backwards if needed, so just using the TasksExecuted field would not work. My problem is that the index simply does not increment. This is the declaration of the timer handles.index= 1 ; handles.timer = timer(... 'ExecutionMode', 'fixedRate', ... % Run timer repeatedly 'Period', 1, ... % Initial period is 1 sec.

How to add a different title to LTIview?

好久不见. 提交于 2019-12-12 02:24:51
问题 I want to plot step response of a second order transfer function using LTIview in different conditions such as underdamped,critically damped condition etc. I want to plot them in the same matlab program so want to give my own title names such as 'underdamped' condition. But the following code for plot function doesn't work and the GUI gives the preinitialised names figure,ltiview('step',trf),title('underdmp') Or ltiview('step',trf),title('overdamped') How to solve this problem? And give the

Create a colormap in matlab [duplicate]

狂风中的少年 提交于 2019-12-12 01:47:53
问题 This question already has answers here : How to create a custom colormap programmatically? (2 answers) Closed 4 years ago . I have a contour plot with data that goes from -90 to 90 degrees. for now i am using jet so I have a map that looks like this I have been asked to change the colormap so that instead of having a gradient, I have a fixed color for each 5 degress (so I believe 36 colors). Also i was thinking of maybe having same colors for the interval [5 10] and [-10 -5], and so on if

Matlab Boxplots

喜欢而已 提交于 2019-12-12 01:42:34
问题 I'd like to create a quasi boxplot graph as shown on pages 15/16 of the attached report. comisef.eu/files/wps031.pdf Ideally I only want to show the median, the maximum and minimum values as in the report. I would also like to have similar spacing to that shown in the report. Currently I have two matrices with the all the necessary values stored in them but have no idea how to do this in matlab. The boxplot function gives too much data (outliers etc) which makes the resulting graph look

Coloring labels and lines in a dendrogram plot [duplicate]

喜你入骨 提交于 2019-12-12 01:36:48
问题 This question already has an answer here : Colour the tick lables in a dendrogram to match the cluster colours (1 answer) Closed 2 years ago . I want to change the color of lines in the dendrogram corresponding to its label. However, I haven't seen anything like that before. So I want to at least change the color of the text labels. 回答1: It seems like there is no simple solution for that. The labels of the dendrogram are simply the y-axis tick labels and are all sharing the same color

Matlab figure flashes back and forth between black&white and color

瘦欲@ 提交于 2019-12-12 00:23:10
问题 I'm trying to display a color disparity map, but it first displays black and white until I do 'colormap jet' then it's in color. How can black and white image be suppressed? imshow(disparityMap, DisparityRange ); title('DISPARITY MAP'); colormap jet; 回答1: Specify the colormap parameter to imshow . imshow(disparityMap, DisparityRange, 'colormap', jet); Example use im = imread('cameraman.tif'); imshow(im, [60,200], 'colormap', hsv); We get this image: 来源: https://stackoverflow.com/questions