Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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. ...

plus de 10 ans il y a | 1

Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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 = ...

plus de 10 ans il y a | 3

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 8

| A accepté

Réponse apportée
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 ...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 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...

plus de 10 ans il y a | 1 réponse | 1

1

réponse

Réponse apportée
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...

plus de 10 ans il y a | 3

Réponse apportée
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...

plus de 10 ans il y a | 1

Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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; ...

plus de 10 ans il y a | 1

Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
"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...

plus de 10 ans il y a | 1

Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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); ...

plus de 10 ans il y a | 0

| A accepté

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

plus de 10 ans il y a | 1

Réponse apportée
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', '...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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 > ...

plus de 10 ans il y a | 0

Réponse apportée
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 = {... ...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
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]);

presque 11 ans il y a | 2

| A accepté

Réponse apportée
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: ...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 11 ans il y a | 0

Réponse apportée
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...

presque 11 ans il y a | 0

Réponse apportée
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...

presque 11 ans il y a | 0

Réponse apportée
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; ...

presque 11 ans il y a | 0

| A accepté

Charger plus