Answered
How do I find if a x,y point is within a given polygon?
The |inpolygon| function is included in base Matlab. If your polygons cover a small geographic area and don't cross the poles, ...

11 years ago | 1

| accepted

Answered
Selecting elements of logically pruned vector (concatenating indices)
I think you'd need to save the indices. idx = find(v_log); c = b(idx(ind)); Depending on the size/sparsity of v_log, ...

11 years ago | 0

| accepted

Answered
getframe difference in 2014b.... bug?
I'll also confirm, but older versions of Matlab also responded to |axis image| without changing the axis's Position property, so...

11 years ago | 0

| accepted

Submitted


tick2text: create easy-to-customize tick labels
Customized tick marks, maintained on zoom and pan

11 years ago | 3 downloads |

4.2 / 5
Thumbnail

Submitted


subdir: a recursive file search
Performs a recursive file search using same input and output format as dir function

11 years ago | 2 downloads |

4.7 / 5

Answered
How to do workaround MATLAB crash in set(gcf,'CurrentAxes',ax1)?
I'm not sure if it's entirely related, but I have also found the need to throw a lot of |drawnow| commands into some of my code ...

11 years ago | 2

Answered
How to print using fprintf to distinguisish 1.1 from 1.10 and 1.100
I would just do a simple concatenation, rather than try to figure out the proper |%f| precision for each: [r,c] = meshgri...

11 years ago | 1

Answered
How to get the points of [lat, lon] of a full great circle?
I would use a combination of |azimuth|, |gc2sc|, and |scircle1|: az = azimuth(lat1, lon1, lat2, lon2) [lat, lon, r] = gc...

11 years ago | 1

| accepted

Answered
Using time derivative dot in plot legend
You just need to set the interpreter after plotting: plot(rand(10,1)); hl = legend('$\dot{\theta}_{in}$'); set(hl, 'I...

11 years ago | 3

Answered
How to enlarge legend marker size in r2014b?
The marker handles are still there... load seamount; hs = scatter(x,y,5,z); [hleg, hobj, hout, mout] = legend(hs, '...

11 years ago | 3

Answered
How to generate string without space at the beginning?
Easier, you can just add the string part to the |num2str| format: Fields = num2str((2:2:16)', 'Item_%d'); Of course, thi...

11 years ago | 2

| accepted

Answered
Arrange data in cell array for complete data years
I'm not sure I see the link between your two sample files... the date/value pairs in output.csv doesn't seem to match those in t...

11 years ago | 0

| accepted

Answered
Reading in Legend, then displaying, gives different string order - Matlab 2014b
Nothing immediately jumps out at me as incorrect. Does the loaded figure and the new subplot include the same number of child o...

11 years ago | 0

Answered
overwriting certain lines in a matrix with previous lines that satisfy a condition.
marked = [3,6,7,14,15,16,17]; good = setdiff(1:20, marked); prev = arrayfun(@(x) good(find(good < x,1,'last')), marked)...

11 years ago | 1

Answered
How to use accumarray?
A small variation in Guillaume's suggestion, in case you want a value for every day/hour/hour of day (even if no data was collec...

11 years ago | 0

Answered
substituting value in matrix does not work for some reason
You can't use |==| with NaNs: >> NaN == NaN ans = 0 Use |isnan| instead: B(isnan(A)) = NaN;

11 years ago | 1

| accepted

Answered
Patch performance with caxis?
It might help if you can consolidate your multiple patch objects into one many-faced patch. I've found that this usually speeds...

11 years ago | 0

Answered
using colormap to assign one color for values => 0 and one for < 0
colormap([0 0 1; 1 0 0]); set(gca, 'clim', [-1 1]); % or any centered-on-0 limits

11 years ago | 1

| accepted

Answered
Conflict with 2 matlab R2014b windows running
That folder includes some of the core Matlab functionality; why are you trying to remove it? It's definitely not an external to...

11 years ago | 0

Answered
imwrite from polar surf
If your polar plot already appears as you need it to, it might be easiest to simply steal the data from the plot rather than cal...

11 years ago | 0

Answered
Throwing out bad data
You don't need to loop: x = x(count == 10,:);

11 years ago | 0

| accepted

Answered
constrain surf() plot region
I would recommend setting up your grid in polar coordinates. The |surf| command (along with |mesh|, |pcolor|, etc.) doesn't req...

11 years ago | 0

| accepted

Answered
Syntax other than evil eval to build dynamic dataset?
It's not ideal (since it can confuse the interpreter), but I've occasionally used load/save to accomplish this. Tmp.(incexp)...

11 years ago | 1

Question


Using git to share Matlab code
This is perhaps more of a git question than a Matlab one, but since Git is now being integrated into Matlab a bit I thought othe...

11 years ago | 0 answers | 1

0

answers

Answered
How can I view an undistorted JPG file in MATLAB?
image(img); axis equal;

11 years ago | 0

| accepted

Answered
I'm asked to find the probability of this problem :(
A few things... - You're not changing anything within your loop. You probably want to be changing the values of a,b,c,d, and...

11 years ago | 0

| accepted

Answered
reading undelimited comma numbers
Trying to convert to an Excel format seems unnecessary and complicated... if you're planning to work with this data in Matlab on...

11 years ago | 1

Answered
Help with Tick mark labels
The syntax you're using there will only work in the latest release of Matlab (R2014b). In earlier versions, the graphics handle...

11 years ago | 1

| accepted

Answered
ncwrite issue + loop through many netcdf files
When you create a new variable in the file, you'll probably need to specify the dimensions for the new variable. For example, t...

11 years ago | 0

| accepted

Answered
Is it possible to calculate the line of sight between two points in a 2d polygon?
Have you tried taking advantage of the fact that |polyxpoly| can process NaN-separated polylines? It seems to handle 1000 line ...

11 years ago | 2

Load more