matlab-figure

Change axis in polar plots in matlab to radians

风格不统一 提交于 2019-12-24 00:39:00
问题 So matlab rightfully uses radians for trigonometric functions and in the actual plotting of polar plots. However annoyingly it puts the angular axis in degrees, is there any way to change this? 回答1: The text objects representing angular values are created by the polar function in the following section of its code (Matlab R2010b): % annotate spokes in degrees rt = 1.1 * rmax; for i = 1 : length(th) text(rt * cst(i), rt * snt(i), int2str(i * 30),... 'HorizontalAlignment', 'center', ...

how to make two bars in the same fig Matlab

半世苍凉 提交于 2019-12-23 23:47:48
问题 I want to make two bars in the same fig in matlab. Now, I have two separate bar charts, what I want to do is combining them in one chart but with different colors (eg red and blue) to differentiate between the two barcharts. This is the two barcharts appearing: what I want to do is something like this: Below is the code I'm using so if anyone could please help me. load('x640_Sensor_Lights_On_1000mm-pgms.mat'); uu=unique(n); nn=histc(n, uu); h=figure; bar(uu,nn/numel(n)); print(h, '-dpdf',

Generating Animations in Matlab (AVI files) without displaying figure

爷,独闯天下 提交于 2019-12-23 19:09:26
问题 I have been trying to generate animation files (.AVI files) in parallel remotely on a cluster via shell script with Matlab. So far this has been an impossible task. I have all but given up, and have just accepted that I will need to generate the animations on my laptop overnight for 8 hours or so. But I’m hoping that someone out there knows how to fix this, or that I can stop someone from wasting a day of trial and error. I have generated a large number of two dimensional probability

How to reset XTickLabel to default

爷,独闯天下 提交于 2019-12-23 16:04:59
问题 In R2010b, I can reset the tick labels to auto thru figure editor, but I'd like to reset them to default programmatically I tried set(gca,'XTickLabel','auto') But it displays 'auto' at each tick... Any hint ? 回答1: You need to set XTickLabelMode to 'auto' : set(gca,'XTickLabelMode','auto') Tick label modes are set to 'manual' when you specify tick labels. So, you need to turn it back to 'auto' . 回答2: OK, I finally found this way: set(gca,'XTickLabel', num2str(get(gca,'XTick')')); I read the

Matlab: bar No public property CData exists

我的梦境 提交于 2019-12-23 15:33:24
问题 The Matlab example code cannot run in Matlab 2017a (Linux 64bits): https://cn.mathworks.com/help/matlab/ref/bar.html b = bar(rand(10,1)); b.FaceColor = 'flat'; b.CData(2,:) = [.5 0 .5]; It can not color the specific bar and warns as: No public property CData exists for class matlab.graphics.chart.primitive.Bar. I don't know it is a specific feature merely for Matlab 2017b? This code is only to color the specific bar. In Matlab 2012a, it can be easily done by: bh=bar(MyStem); h=get(bh,

aligning the axes labels in 3d plot in matlab

ぃ、小莉子 提交于 2019-12-23 12:25:50
问题 I plot the mesh data with the following matlab commands [x, y] = meshgrid(-10:0.1:10, -10:0.1:10); z = exp(-x.^2 - y.^2); mesh(x, y, z); xlabel('time variable'); ylabel('space variable'); zlabel('wave'); You will see that no matter how to rotate the axes, the x and y label are always aligned horizontally. Is there any way to make it align with the x axis and y axis separately while I rotating the axes? 回答1: There has been a submission to align axes labels with the figure axis here. 回答2: You

waitbar -> length ot the bar figure?

流过昼夜 提交于 2019-12-23 10:20:03
问题 This is probably something trivial, but how can I control the width of the bar figure inside the waitbar ? My problem is, that when I use the 'Position' property, I can expand only the waitbar, but not simultaneously the bar figure inside it. So, how is this made ? hWaitb = waitbar(0,'Titel','Position',[x y width height]); Than probably I would make childrenWaitb = get(hWaitb, 'Children'); but what then? 回答1: The OP found the solution himself, see comments above: childrenWaitb = get(hWaitb,

How to assign figure property with movegui() on Matlab subplot?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 05:47:19
问题 I need to assign the units inches for subplots (1-2). I added movegui() for the figure, after which I started to get the error. Without it, I donot get the error message. Code hFig3=figure('Units', 'inches', 'Name', 'Time, Potential, T-p, T-p tiff'); movegui(hFig3,'northeast'); % without this, you do not get the error % TechnicalMonitoring b1=subplot(2,2,1); b2=subplot(2,2,2); b3=subplot(2,2,3); b4=subplot(2,2,4); % b1, b2 hFig3.Children(1).Units = 'inches'; hFig3.Children(2).Units = 'inches'

Bar plot x-axis Matlab

你离开我真会死。 提交于 2019-12-23 05:25:40
问题 I am stuck with a bar plot in Matlab. I got it to work with Matlab help and this this forum until here, but on the x-axis, there are still only 2 names. I would like to have the "names" under the bars and the "categories" where the 2 names show up now. Thank you! values = [4 10... 11 2 3;... 4 1... 5 2 -10]; names = {'PreSplitTotalEON' 'PostSplitTotalEON'... 'PreSplitPureEON' 'PostSplitPureEON' 'PostSplitUniper';... 'PreSplitTotalRWE' 'PostSplitTotalRWE'... 'PreSplitPureRWE' 'PostSplitPureRWE

How to do cross validation SVM classifier

断了今生、忘了曾经 提交于 2019-12-23 04:29:41
问题 I want to perform a decoding by applying an SVM classifier to a data matirx S, the size of which is 1089*43093,and the prediction accuracy of the labels, denoted as r, is calculated based on a 11-fold cross-validation classification procedure.The 11 fold cross-validation is based on the data matrix S, which is separated into the training and testing data sets for classification. Specifically, this cross-validation is only for calculating the prediction accuracy r. Can anyone give me some