Answered
colorbar floods 3dplots with text
Perhaps you could add a screenshot of what you see? Both lines of code produce the expected plane with colorbar plot on my syst...

13 years ago | 1

Answered
How Do I Breakout and Store 2 Time Values In The Same String?
In order to capture different parts of an expression, put those parts in parentheses (note in the example below the difference b...

13 years ago | 0

| accepted

Answered
Custom colormaps and color bars
When trying to match colors of lines for objects plotted one at a time in a loop, I usually find it easier to manually set line ...

13 years ago | 1

| accepted

Answered
Contour map from hist3()?
Supply output variables to hist3: [n,c] = hist3(X, [10 10]); contour(c{1}, c{2}, n);

13 years ago | 0

| accepted

Answered
Box plot y-axis
Is this the sort of thing your looking for? x = arrayfun(@(a,b) ones(a,1)*b, trials, outcome, 'uni', 0) x = cat(1, x{:}...

13 years ago | 0

| accepted

Answered
Putting files with numeral string names into numeric order
How about something like this? files = dir('*.txt'); numname = regexp({files.name}, '^[a-z]*', 'match', 'once'); allnum =...

13 years ago | 0

Answered
How to interpolate to the nearest value
If you look at the documentation of |interp1|, you'll see that nearest neighbor interpolation is an option: interp1(x,y,xi,...

13 years ago | 1

| accepted

Answered
How can I grab the contour lines into a new figure ?
Easiest way: download <http://www.mathworks.com/matlabcentral/fileexchange/28447-contourcs-to-obtain-contourc-output-as-a-struct...

13 years ago | 0

| accepted

Answered
How to retrieve multiple handles from plot function?
A few options. You could write a loop... for ii = 1:size(p,1) h(ii) = plot(p(ii,1), p(ii,2), 'o'); end or use...

13 years ago | 0

| accepted

Question


Extract outline of polygons defined by gridded mask
I'm attempting to extract the polygons defined by a gridded mask, where the mask is defined pcolor-style, i.e. by the grid cell ...

13 years ago | 3 answers | 1

3

answers

Answered
Extract outline of polygons defined by gridded mask
I decided to go ahead and try the not-so-quick method that first came to mind: actually calculating the polygon intersection of ...

13 years ago | 0

Answered
How to graph a connectivity/adjacency matrix?
Would |gplot| work for the basic setup? By default, the code doesn't allow the edge color modifications that you mention, but t...

13 years ago | 1

| accepted

Answered
Need help plotting 100 Strings onto grid (FOR loop not working)!
The slowdown is probably because you're trying to create 10000 annotation objects, and Matlab tends to get bogged down with too ...

13 years ago | 0

Answered
using contourc to calculate the length of a single level contour
You're on the right track. You could use two loops, but the vectorized version is cleaner. I've used the simple wrapper functi...

13 years ago | 0

Answered
How do I ignore the first few 0s in a vector but not ignore the 0s in the middle?
To just drop the leading zeros, how about this? p = p(find(p,1):end); And is this what you're trying to achieve via th...

13 years ago | 0

| accepted

Answered
Controlling dual axis plots
To put all the lines in one legend, pass the line handles directly to legend (rather than the axis handle, which is the default ...

13 years ago | 0

| accepted

Answered
Plotting 4 column of data
Try scatter3. Assuming data is your n x 4 matrix: scatter3(data(:,1), data(:,2), data(:,3), [], data(:,4), 'filled');

13 years ago | 0

Answered
How can I plot on a line on the surface of the earth?
The example you point to may be a little more complicated than you need for your purposes, though you should be able to follow s...

13 years ago | 2

| accepted

Answered
how to avoid geoshow shrinking the axis
If you aren't plotting to a map axis, geoshow resets the data aspect ratio to [1 1 1], which may shrink the axis in one directio...

13 years ago | 2

| accepted

Answered
How to plot x y z coordinates and combine them with a 4th dimension
doc scatter3

13 years ago | 0

| accepted

Answered
inpolygon command for multiple areas
This should do it: http://www.mathworks.com/matlabcentral/fileexchange/7187-inpolygons Note that that function expects pol...

13 years ago | 1

| accepted

Question


Reports on list of files, rather than current directory
Is there any way to run one of the Matlab reports (e.g. Dependency Report, Help Report, etc.) on an arbitrary list of files, rat...

14 years ago | 0 answers | 1

0

answers

Answered
how to throw out certain intervals.
I'm not exactly sure of what you want (in your example, your x data seems to match your intervals exactly, which is a little con...

14 years ago | 0

Answered
Removing lines in scatter plot when using shading interp
The shading command affects all surface and patch objects, including the child patch object that's part of a scattergroup object...

14 years ago | 0

Answered
Change color order of legend
Rather than pointing the legend to the axis, pass the handles of the individual lines. This way you can specify exactly which l...

14 years ago | 0

| accepted

Answered
cellfun usage trouble
Try evalin instead, which forces the function to reference the base workspace (rather than the local one): cellfun(@(x) eva...

14 years ago | 2

| accepted

Answered
How to plot 3D currents (in color and with arrows) according to u, v, w components
Some functions to look at: quiver3 scatter3

14 years ago | 0

Answered
Plot clean surface plots from scatter data
I'm not quite clear on the format of your data to start, since you say you can't convert from spherical to cartesian in your cas...

14 years ago | 0

| accepted

Answered
changing the X tick label
Perhaps a little less ugly that Matt's suggestion (though not by much): lbl = arrayfun(@(x,y) sprintf('%d-%d',x,y), a, b, 'un...

14 years ago | 0

Answered
how can i know which toolbox a function is calling?
I prefer <http://www.mathworks.com/matlabcentral/fileexchange/17291-fdep-a-pedestrian-function-dependencies-finder| fdep> over d...

14 years ago | 1

| accepted

Load more