Question


polyfitn throws an error with seemingly sufficient input data
I have two data points that lie on a straight line: x = [1;2]; y = [3;4]; Matlab's built-in |polyfit| function nic...

11 years ago | 1 answer | 0

1

answer

Submitted


degreetick
Format axis tick labels with degree symbols.

11 years ago | 2 downloads |

0.0 / 5
Thumbnail

Question


Find a subset of unique permutations
I have many arrays |A| of varying length. For any given |A|, I'd like to find all the unique sets of three elements of |A|. Fo...

11 years ago | 1 answer | 1

1

answer

Answered
How to plot multiple data sets on the same graph - Complex Aggression study
A few notes: 1. Don't use |i| as a variable name. Sometimes Matlab thinks it's the imaginary unit. 2. Only call axis se...

11 years ago | 0

Answered
computing first 50 terms of sequence
x(1) can only have one element. You'll have to choose whether x(1)=1 or x(1)=0. Also, you'll run into a problem because you...

11 years ago | 0

Answered
Histogram for bins with different numbers of elements..
Perhaps I'm misunderstanding your question, but why not compare two separate histograms--one histogram for distribution of inten...

11 years ago | 0

Answered
How can I find maximum before a certain element in my matrix
B=[5 8 5 2 6 9 10] ; [~,ind] = min(B); maxB4min = max(B(1:ind)) =8

11 years ago | 1

| accepted

Answered
Average distance from the origin
Looks right, but you could write it more simply: matrix=load('Data'); x = matrix(:,1); y = matrix(:,2); distances ...

11 years ago | 1

Answered
How can I sound two signals without them overlapping?
You can call |sound| twice or you can combine the signals. Here's both methods: tr = load('train'); la = load('laught...

11 years ago | 0

Answered
Matlab : put transparancy on a bar plot
This works find for me in 2012b: x1 = [-5 -4 -1 3 4 5 6 7 10]; y1 = rand(size(x1)); b1 = bar(x1,y1);%,'FaceCol...

11 years ago | 0

Answered
How to plot concentric hexagons
If the problem is with the aspect ratio, try ending with axis equal If making the hexagons is the issue, you can use <h...

11 years ago | 1

Answered
Interpolating to a known grid point
You could fit a plane to the three points via <www.mathworks.com/matlabcentral/answers/214516-interpolating-to-a-known-grid-poin...

11 years ago | 0

Answered
Bottom and left edges of pcolor plot?
<http://www.mathworks.com/matlabcentral/fileexchange/50706-offsets-and-missing-data-via-pcolor-and-surf/content/pcolor_offset/ht...

11 years ago | 0

Submitted


Offsets and missing data via pcolor and surf
A brief explanation of the half-pixel offset in pcolor and surf.

11 years ago | 2 downloads |

4.5 / 5
Thumbnail

Answered
surf() function query, shading a 3d mesh plot.
Looks like |surf| will do what you want, but you'll need a X, Y, and Z as gridded 2D variables, not 1D arrays. I can't fully in...

11 years ago | 0

Answered
How do I make a function that checks the divisibility of a given number, n, by 3, 5, 7, and 11.
22 is divisible by 11. The logical command makes all nonzeros into ones and the tilde (~) then takes the not of the logical. W...

11 years ago | 0

Answered
Displaced axis on figures
I'm guessing your data bounds might be changing with each frame? I recommend doing as little as possible inside the loop. Inst...

11 years ago | 0

Answered
Plotting a cone inside of a cylinder
You can use the <http://www.mathworks.com/help/matlab/ref/cylinder.html |cylinder|> function to calculate both cylinder and cone...

11 years ago | 0

Answered
Scale bar without axis
Do it manually by plotting a line and adding text: plot(1:100,cosd(1:100),'b'); hold on plot([80 80 90],[.9 .8 ...

11 years ago | 1

Answered
Data cursor does not show lat and long values in a contourm plot (worldmap function)
Try using <http://www.mathworks.com/help/map/ref/inputm.html |inputm|> instead of the data cursor.

11 years ago | 1

Answered
How to ignore certain values in A histogram?
You can get statistics with NaNs using |nanmean| or |mean(A(isfinite(A(:))))|.

11 years ago | 0

| accepted

Answered
range for xlabel of image (imagesc)
It might be easiest to not deal with |datetick| for this particular issue. Instead, set tick values manually like this: %...

11 years ago | 1

Answered
how to untilt my graphed data?
What about <http://www.mathworks.com/help/matlab/ref/detrend.html |detrend|>?

11 years ago | 0

Answered
Control the size of worldmap
You may be able to use |set(gca,'position',[lowerleftx lowerlefy width height])|.

11 years ago | 0

Answered
Give me an hint
Here's a hint. Run this: % some data: time = 1:20; y = [1 1 0 2 3 4 3 5 6 4 3 12 3 5 4 7 4 11 15 4]; ...

11 years ago | 1

Answered
define a sequential discrete color map with first color white.
The colormap you uploaded in your original question looks a lot like a Cynthia Brewer colormap, which Stephen Cobeldick has made...

11 years ago | 4

Answered
How to calculate average of Netcdf daily data
You can use <http://www.mathworks.com/matlabcentral/fileexchange/48361-downsample-ts/content/downsample_ts/html/downsample_ts_do...

11 years ago | 0

Answered
How do I correlate columns
The rand function was only to generate random data to play with. I don't see how you'll get a 925 x 90 correlation matrix. ...

11 years ago | 0

Answered
Subscript indices must either be real positive integers or logicals - quick question on how to fix
As I understand your question, you run the code above, then you want to find out values of R_h for some given x value. When you...

11 years ago | 0

| accepted

Answered
How do I correlate columns
How's this? m = rand(2400,1015); c = corrcoef(m(:,[1 926:1015])); imagesc(c) cb = colorbar; ylabel(...

11 years ago | 2

Load more