matlab-figure

Arabic/Persian label Matlab figure

亡梦爱人 提交于 2019-12-11 11:39:51
问题 Matlab cannot display Arabic/Persian labels of the figure. Also I cannot see my installed fonts and I don't want to add the labels by another program. How can I fix this problem? 回答1: What you're looking for is a way to display unicode characters in axes labels. It seems that this problem was encountered before, but there's no simple solution for it. See workarounds here and here. One important thing though - do not edit .m files containing unicode\utf-8 characters (such as Arabic, Farsi,

Set pixels on screen efficiently

与世无争的帅哥 提交于 2019-12-11 10:34:55
问题 I am using WindowAPI (http://www.mathworks.com/matlabcentral/fileexchange/31437) to show a black full screen in matlab. When drawing on screen, turns out drawing using line() and rectangle() functions is extremely slow. How can I set values of pixels without going through matlab's mechanism? Getting the window's canvas for example would be great. 回答1: One way to imitate a "canvas" is by using a MATLAB image. The idea is to manually change its pixels and update the 'CData' of the plotted image

Create a bitmap from patch object in Matlab

◇◆丶佛笑我妖孽 提交于 2019-12-11 09:31:25
问题 I have a set of polygon vertices in in X, Y matrices and their colors are in RGB values in another matrix C. I then use fill() function to generate patch objects that is displayed in a Matlab figure. I want to create a bmp object from this figure. What I mean by a bmp object is the x,y coordinates of the pixels and there RGB values. If I use the print() function, with '-dbmp' and a file name, matlab can write the bmp to a file. But then I have to read the file with imread() to create the bmp

finding absolute error of approximated function - matlab

和自甴很熟 提交于 2019-12-11 09:06:21
问题 During an experiment i registered several points. Thereafter I approximated them with 9th order polynomial. I need to find the absolute error of the measurements and the approximated function on y axis. Any idea? *edit: y = [0.006332 0.04056 0.11813 0.1776723 0.23840 0.29827 0.358396... 0.418149 0.4786 0.478154 0.538114 0.53862 0.598954 0.659804... 0.720267 0.781026 0.8412 0.901548 0.962022 1.022567 1.083291... 1.143653 1.20449 1.14398 1.02273 0.962285 0.90203 0.841474... 0.780881 0.720346 0

Plotting subplots in a figure automatically for each column of matrix

杀马特。学长 韩版系。学妹 提交于 2019-12-11 08:57:42
问题 For example let's say I have a following matrix (<9x6 double>) with a colheaders(<1x6 cell>). Matrix = 226.7431 14.7437 14.9417 14.1000 14.5000 66.0590 226.7500 14.6582 14.8250 NaN 14.2000 66.7740 226.7569 14.3590 14.6067 NaN 13.9000 68.4897 226.7639 14.2702 14.5717 13.4000 13.8000 68.2487 226.7708 14.2555 14.6000 NaN 14.0000 NaN 226.7778 14.1605 14.5967 NaN 13.9000 NaN 226.7847 14.0320 14.4567 12.9000 13.6000 68.8272 226.7917 13.8422 14.2733 NaN 13.4000 69.6392 226.7986 13.6585 14.1169 NaN

How to set colorbar labels

五迷三道 提交于 2019-12-11 08:26:31
问题 I have some points in a 'jet' colormap. The points have a coefficient that can go from 0 to 1, but usually they dont cover all the range, e.g 0.75-0.9. When I plot those points I colour them so 0.75 is the lesser colour in the colormap and 0.9 is the maximum color in the colormap, so all the colormap is shown. What I want to do is show that in the colorbar also. When I plot the colorbar the labels on it go to 64, but I want them from 0.75 to 0.9. How can I do that? EDIT I don't think the code

Matlab how to make a set callback return values?

假装没事ソ 提交于 2019-12-11 08:18:28
问题 I want to make a little script in which I can systematically ananlyse a lot of matlab plots. With the script I should be able to click on some points in the graph and the script then stores these values. I have now that the callback function has the coordinates, but I want these values in the main file to store them. But the set function can't receive values from a function. How can I create another construction to avoid this? [x,y] = set(f,'ButtonDownFcn',{@Click_CallBack a}); doesn't work

How to add a 'colorbar' and set 'clim' to a colour image overlaid on a grey level image?

一世执手 提交于 2019-12-11 06:37:48
问题 I am trying to overlay a colour image on a grey level image. However, when I try to plot the 'colorbar' and set the 'clim'. Matlab always produce a colorbar according to the underneath grey level image. However, I want to get the colorbar for the overlaid colour image. Any suggestions would be appreciate. Thanks a lot. %% Example codes: greyImage = imread('AT3_1m4_08.tif'); colorImage = imread('hestain.png'); figure, greyImagePlot = image(greyImage); colormap(gray); hold on; overlayImage =

two curves on one figure with one kept updating

血红的双手。 提交于 2019-12-11 05:49:10
问题 I have following code which basically plot the original signal x on the figure, and updates the reconstructed signal rec iteratively. plot(x); hold on err = 100; tol = 0.1; err_vec = []; while err > tol % iterations % Low-pass filter xpg REC = fft(rec); REC(M+2:N-M) = 0; rec = real(ifft(REC)); plot(rec, 'r*'); drawnow % Restore the known samples % rec(ks) = y(ks); % Error err = norm(rec - x) err_vec = [err_vec err]; end What I like is to retain x on the figure, and only update rec at each

Relocating “.fig” files when creating a GUI using Matlab GUIDE

徘徊边缘 提交于 2019-12-11 05:09:19
问题 I've developed a GUI for some build scripts, and am now in the process of deploying it. As the script will be deployed to a number of different machines at various points, I need to use the standard format of directories that the team use. The GUI consists of a ".fig" file that contains the visual definition of the UI, and a m-script that defines the functionality. I need to locate these two in "fig/" and "m/" folders respectively, but I can't figure out how to. I first searched for an