matlab-figure

Get rid of “Figure 1” in the title of the figure

ε祈祈猫儿з 提交于 2019-12-21 03:44:32
问题 I have a figure that I want his name to be Step 2 of 3: Simulation Plot Window , but its name is: figure 2: Step 2 of 3: Simulation Plot Window . How can I change his name to the name I want? I don't know if it's necessary, but in the start of the code I wrote: hFig = figure('Name','window 1','Visible','Off'); and Towards my code ends, I write: hFig = figure('Name','Step 2 of 3: Simulation Plot Window','Menubar','none', 'Resize','off', ... 'WindowStyle','modal', 'Position',[300 300 1150 600])

How can I create a slice of a surface plot to create a line? (Matlab)

牧云@^-^@ 提交于 2019-12-21 02:53:20
问题 Given some function z = f(x,y), I'm interested in creating a (1D) line plot along an arbitrary cutting plane in x,y,z. How do I do this in Matlab? Slice, for example, provides a higher dimensional version (colormap of density data) but this is not what I'm looking for. E.g.: z = peaks(50); surf(z); %->plot z along some defined plane in x,y,z... This has been asked before, e.g. here, but this is the answer given is for reducing 3D data to 2D data, and there is no obvious answer on googling.

Ploting a wave with different colors in the same figure [duplicate]

*爱你&永不变心* 提交于 2019-12-20 07:22:55
问题 This question already has an answer here : Plotting piecewise function (1 answer) Closed 2 years ago . How can I plot a wave (represented by 1 x N matrix) with different colors in matlab. The range for a specific color can be provided manually. See the diagram below for the expected output. 回答1: Here is a simple option: x = linspace(-4*pi,4*pi,10000); % some data y = -sin(x); % some data N = 4; py = reshape(y,[],N); px = reshape(x,[],N); plot(px,py,'LineWidth',2) Where y is your vector, and N

how to plot this data?

断了今生、忘了曾经 提交于 2019-12-20 06:36:26
问题 I have an array of values for theta and phi . How can I easily create a MATLAB plot where theta and phi are spherical coordinates like this: How to plot the values in MATLAB if I have an array of the theta and phi with radius kept constant? These are the values of theta : theta = [ 80.0000 73.2995 65.7601 95.5007 100.4861 97.8834 94.0849 52.5174 74.4710 104.6674 52.7177 97.0538 75.7018 83.2817 97.5423 85.1797 84.2677 126.2296 81.1814 66.1376 91.6953 167.7085 46.5980 87.8220 113.4588 180.0000

How to avoid displaying zero-values in confusion matrix

送分小仙女□ 提交于 2019-12-20 04:54:32
问题 I plotted a confusion matrix in Matlab using the code from this link. However whenever there is a zero on the cell it is still shown. How can I eliminate the printing of 0.00 's on the cells? Sample of my confusion matrix 回答1: After you removed all spaces, find '0.00' and substitute it with spaces again idx = find(strcmp(textStrings(:), '0.00')); textStrings(idx) = {' '}; The complete code will then be: mat = rand(5); %# A 5-by-5 matrix of random values from 0 to 1 mat(3,3) = 0; %# To

How to plot a figure similar to the one produced by lassoPlot.m to specify a regularization parameter?

我的未来我决定 提交于 2019-12-20 04:25:44
问题 I am trying to apply a regularized optimization other than Lasso. How can I plot the figure similar to the one produced by lassoPlot.m included in MATLAB as shown below if all data needed can be provide? How to plot the I -shaped lines? I read the lassoPlot.m but cannot find out how it is done. 回答1: If I had to create a plot like this manually, I'd do something like this: function q53809665 DATASET = [ 0.601240818 459.5714648 6.549320679 0.38951982 407.6789162 6.915203670 0.250128593 366

What does the index refer to when selecting a pixel on an image in Matlab?

夙愿已清 提交于 2019-12-20 03:42:49
问题 When looking at a single pixel of an image in Matlab, what does this index refer to? X/Y refer to the coordinates of the pixel, and RGB refers to the color, but any ideas on what the index is? To clarify, when I am viewing a figure in Matlab and use the data cursor to select a point, the three lines shown are: X: ### Y: ### Index: ### RGB: ###, ###, ### I am trying to "average" several dicom images together, and it appears that the numbers that are added and being manipulated is this index

How to edit property of figure saved in .fig file without displaying it

只谈情不闲聊 提交于 2019-12-20 02:47:10
问题 I want to edit a certain property of MATLAB figures saved as .fig (MATLAB's default format) files. I create a lot of graphics-intensive figures in a script, so I choose not to display them by making the default figure invisible with set(0,'DefaultFigureVisible','off') . This sets the 'Visible' property of any new figure to 'off' . This way I can create, edit, save, etc., figures without the need to draw them, which can be taxing on CPU, GPU and their memories. I save the figures as .fig files

How to remove axis in MATLAB

僤鯓⒐⒋嵵緔 提交于 2019-12-19 19:54:59
问题 axis off Not working. function displayResults(filename,hObject, eventdata, handles) % Open 'filename' file... for reading... fid = fopen(filename); for N=6:1:10 imagename = fgetl(fid); if ~ischar(imagename), break, end % Meaning: End of File... [x,map]=imread(imagename); rgb=ind2rgb(x,map); ax = handles.(sprintf('axes%d', N)); axis off; image(rgb, 'Parent', ax); end guidata(hObject,handles) Above code results in following output: I've highlighted axis in above figure. All images I've used is

Tight subplot with colorbars and subplot's 3rd parameter in Matlab?

眉间皱痕 提交于 2019-12-19 11:46:22
问题 I would like to have a tight subplot i.e. minimum spacing between figures in the subplot where you have subplot's 3rd parameter i.e. you can decide where the picture is going to be i.e. easy to move between subplot and new_tight_subplot , and you can use it with colorbars. I have profiled the most popular tight subplots in FileExchange of Matlab. None (etc most popular here Pekka's version) can pass the following code data=randi(513,513); ax1=subplot(2,1,1); plot(mat2gray(pdist(data,