Matlab: How to obtain all the axes handles in a figure handle?

Use FINDALL: allAxesInFigure = findall(figureHandle,’type’,’axes’); If you want to get all axes handles anywhere in Matlab, you could do the following: allAxes = findall(0,’type’,’axes’); EDIT To answer the second part of your question: You can test for whether a list of handles are axes by getting the handles type property: isAxes = strcmp(‘axes’,get(listOfHandles,’type’)); isAxes will … Read more

MATLAB, Filling in the area between two sets of data, lines in one figure

Building off of @gnovice’s answer, you can actually create filled plots with shading only in the area between the two curves. Just use fill in conjunction with fliplr. Example: x=0:0.01:2*pi; %#initialize x array y1=sin(x); %#create first curve y2=sin(x)+.5; %#create second curve X=[x,fliplr(x)]; %#create continuous x value array for plotting Y=[y1,fliplr(y2)]; %#create y values for out … Read more

How to visualize correlation matrix as a schemaball in Matlab

Kinda finished I guess.. code can be found here at github. Documentation is included in the file. The yellow/magenta color (for positive/negative correlation) is configurable, as well as the fontsize of the labels and the angles at which the labels are plotted, so you can get fancy if you want and not distribute them evenly … Read more

Why is Octave slower than MATLAB?

There are four ways how Matlab code gets sped up: JIT: compiling at runtime helps with loops but seems to speed up (or at least interact with) other parts of the code as well, according to my anecdotal observations. Implementing functions in C/C++: There’s a bunch of Matlab/Octave functions that are implemented in Matlab/Octave. At … Read more

Find given row in a matrix

EDIT: gnovice’s suggestion is even simpler than mine: [~,indx]=ismember(X,M,’rows’) indx = 3 FIRST SOLUTION: You can easily do it using find and ismember. Here’s an example: M=magic(4); %#your matrix M = 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 X=[9 7 6 12]; %#your row vector find(ismember(M,X),1) … Read more