Answered
Logical operations on matrix
Assuming I'm understanding your intent, a better way to do this would be with |histc|. No loop necessary: hQ = 12; hQIn...

10 years ago | 1

| accepted

Answered
Checking if points are contained within a shape
Do you have the Mapping Toolbox? If so, |polyxpoly| may be helpful to calculate exactly where you'll hit the polygon boundary. ...

10 years ago | 1

Answered
How can I format the Roh axis in mmpolar.m?
You'll have to manually label the ticks if you prefer a different number format (the same is true for regular axes, although I b...

10 years ago | 1

| accepted

Answered
Calculating the distance matrix from coordiante matrix
If you have the Stats Toolbox, |pdist|, as already mentioned: A=[3 5 4 5; 1 2 6 3] squareform(pdist(A')) ans = ...

10 years ago | 3

| accepted

Answered
Legend for plotyy to display the string for data series with yleft axis line and marker one one side, and yright axis line and marker to the right of the string
You can get that effect with <http://www.mathworks.com/matlabcentral/fileexchange/31092-legendflex-m--a-more-flexible--customiza...

10 years ago | 0

Answered
Create Own Legend With Colors and Boxes
There are two methods that come to mind... # Use a regular colorbar, and change the tick labels to match your color interval...

10 years ago | 8

| accepted

Answered
Specific values in colorbar
The unique values in you original question are |[0 1 2 15]|. Do you want just those to appear in the colorbar, or all possible ...

10 years ago | 0

| accepted

Answered
Splitting Wind direction into four quadrants
As mentioned in those lecture notes, you'll need to use |atan2| instead of |atan| (not |atand| either... your inputs aren't in d...

10 years ago | 1

Question


Access details of dynamically-created web content in Matlab's browser
Is there any way to access the properties of dynamically-created objects (specifically, an SVG canvas created via a D3.js script...

10 years ago | 1 answer | 1

1

answer

Answered
Matlab will only use upper left corner when laptop is disconnect from large display how do I reset plotting to use the entire figure
Unfortunately, no. Matlab only checks for screen size, monitor position, resolution, etc once when it first starts, and all its...

10 years ago | 3

Answered
how can i measure mixed layer depth (MLD) using these imported data?
Depends on how you're defining mixed layer depth... a common definition is a difference of 0.125 in potential density from the r...

10 years ago | 1

Answered
Changing the current axes causes a line that is a child on another axes to disappear.
I'm moving my comments to a separate thread, since I think the behavior dpb is talking about is a bit more nuanced than your sit...

10 years ago | 1

| accepted

Answered
How to Limit figure size?
If you're using a recent version of Matlab, you can accomplish this via the |SizeChangedFcn| of the figure: h = figure; ...

10 years ago | 1

Answered
Code works in Command Window but not in a script... Find Function
I suggest putting a breakpoint in your code at the line indices_TempMin = find(nbar(:,8) == Cyl_1(1,5)); and run it aga...

10 years ago | 1

| accepted

Answered
Problems with converting date strings to date numbers
Usually this type of error appears when one of your input datestrings does not match the input format you specified. For exampl...

10 years ago | 0

Answered
"Reshaping" matrix
My rule of thumb for this type of problem is to permute and reshape the matrices in such a way that you can access the dimension...

10 years ago | 1

Answered
how to draw a line bewteen two points using the exponential distribution?
|expdf| fits a pdf to a distribution of points... it doesn't define the pdf at given x-coordinates. So in your code, you're fit...

10 years ago | 1

| accepted

Answered
Calculate percentage of similarities in two polygons
If you have the Mapping Toolbox and want a more exact answer: % Some example polygons theta = linspace(0, 2*pi, 100); ...

10 years ago | 0

| accepted

Answered
logarithmic range colorbar imagesc
You can use my <http://www.mathworks.com/matlabcentral/fileexchange/28943-color-palette-tables---cpt--for-matlab cptcmap.m> func...

10 years ago | 1

Answered
Alternate to repmat to create cell array
You can use |deal| to assign a variable to every element of a cell array: structElement = struct('a1','', 'a2', '', 'a3', '...

10 years ago | 1

| accepted

Answered
readtable with variable names exceeding number of columns
I would recommend reading and parsing the variable names separately. For example: fid = fopen(file, 'r'); str = fgetl(f...

10 years ago | 1

| accepted

Answered
How do I create a single line plot (just one line) with two differently scaled y-axes?
A second option would be to layer two axes manually. For example: x = rand(100,1); fac = 2.54; ax(1) = axes('box...

10 years ago | 0

Answered
Please Help (Not sure on what kind of question this is)
I'm assuming you're missing a 0 in row 2 column 2 of your example output. If so: x = [0 1; 1 0; 1 0]; x = x'; x(x > ...

10 years ago | 0

Answered
reshaping data so that I can take sum of every 3 columns
When you say you have a dataset, do you mean a dataset array? I'm assuming so for the moment: Your data: tmp = {... ...

10 years ago | 0

| accepted

Answered
How can I change multiple fields in a nested structure?
You should be able to do this via |set|: set(h(n).Children.Children(1:2), 'Color', [1 0 0]);

10 years ago | 2

| accepted

Answered
Legend in for loop
Save the handles of your plotted lines, then pass the specific handles of lines with a unique class to the |legend| command: ...

10 years ago | 0

| accepted

Answered
how do I remove lines that show up in contour plots?
I'm guessing these are antialiasing artifacts, as discussed in <http://www.mathworks.com/matlabcentral/newsreader/view_thread/28...

10 years ago | 0

Answered
How to impliment faster logical indexing?
I often use |interp1| with nearest-neighbor interpolation as a way of matching up not-exactly-matching values in one matrix with...

10 years ago | 0

Answered
Prevent Mac from Falling Asleep While Running MATLAB Code
I've never used |caffeinate|, so I'm not entirely sure how the command works (though it looks like a good one to know, so thanks...

10 years ago | 0

Answered
How can I plot two 2D figures simultaneously, with one orthogonal to the other? They both share the same t axis, but the x axis lies perpendicular to the z axis and t axis, and they all share the same zero point.
Do you mean you want a 3D axis? t = 0:.1:20; x = 2*(18./(.5*t+.5).^.5 - 5.5); z = 18./(.5*t+.5).^.5 - 5.5; ...

10 years ago | 0

| accepted

Load more