Respondida
How can I find the first constant in an array per row that matches a certain absolute value?
You can do this with accumarray: [ii,jj] = find(abs(test_array) == 9); col = accumarray(ii, jj, [size(x,1) 1], @(x) mi...

más de 12 años hace | 0

Respondida
Advice Grid Point Position Advice
I think what you're looking for is a 2D histogram: % Data x = randn(1000,1); y = randn(1000,1); % Bin edges xe...

más de 12 años hace | 0

| aceptada

Respondida
Matrix Output displays Incorrectly
At the top of that matrix output, I'm guessing you'll find a 1.0e+06 * You specify short format display, but due to the...

más de 12 años hace | 2

| aceptada

Respondida
Can I specify a particular matrix for the colorbar?
You've accepted an answer, but I'm not sure you've actually solved your problem. If I'm guessing correctly, you aren't really l...

más de 12 años hace | 0

Respondida
how to match patterns begining with : and endsing with space
This one isn't a one-liner, but should capture everything (including empty entries like the OPT one). The inconsistent spacing ...

casi 13 años hace | 0

| aceptada

Respondida
pcolor - how to smooth
Pretty sure it's just a colormap difference, with origin setting everything less than -90 to black. Try this: pcolor(x,y,z...

casi 13 años hace | 0

Respondida
How to use pchip to interpolate between data points in cartesian coordinate format
The all-increasing or all-decreasing issue you're encountering isn't a restriction of pchip, but rather of the |:| operator. If...

casi 13 años hace | 2

| aceptada

Respondida
Computational times for various routines?
Try the Profiler. doc profile

casi 13 años hace | 1

Respondida
Ridiculously Simple Nearest Neighbor Search 3D
It's sort of overkill, but I usually use interpolation to do this ( |scatteredInterpolant| in the latest version of Matlab, prev...

casi 13 años hace | 0

Respondida
Change units for contour plot
Are you explicitly defining which contour levels to plot? If you don't, the contour function automatically chooses which levels...

casi 13 años hace | 0

Pregunta


Overriding DYLD library... any problems?
Does anyone know if I will break anything important in Matlab (R2013a on Mac OS X 10.8.4) if I override the DYLD_LIBRARY_PATH an...

casi 13 años hace | 1 respuesta | 0

1

respuesta

Respondida
Textscan reading in floats and str2num dropping ending zeros
If you read the year-day combo string in as a number, or convert from string to number, it's going to treat the value like a num...

casi 13 años hace | 0

| aceptada

Respondida
How to get contour plot and line plot intersection values/ coordinates
I assume by 3D graph with contour, you mean you have 3D data represented in 2D by a contour plot? Or do you mean something like...

casi 13 años hace | 0

Respondida
set NaN as another color than default using imagesc
Do you need to use imagesc, or are you open to using pcolor? The latter will leave NaNs blank, so they will appear the same col...

casi 13 años hace | 11

| aceptada

Respondida
Equivalent function to 'year'?
To break down the date into year, month, etc... dv = datevec(t); year = dv(:,1); month = dv(:,2);

casi 13 años hace | 1

Respondida
datevec with no leap year timeseries
Here's a function I wrote for the task: And in response to Jan's query as to why one would ever want to do this, I often need...

casi 13 años hace | 2

| aceptada

Respondida
How to make an if/else statement
No if/else needed... just some logical indexing: a = rand(100000,3)*15; b = a(a(:,1)>13 & a(:,1)<15,:); c = a(a(:,1)>2 ...

casi 13 años hace | 2

Respondida
How to use "gplot" function?
I assume you want to plot based on the adjacency matrix A? You'll have to figure out exactly how to define an objects coordinat...

casi 13 años hace | 0

| aceptada

Respondida
Basic question about coloring of a 3d plot
Some more details about your plot would help... are you plotting points? Lines? Surfaces? A scatter plot could help with poin...

casi 13 años hace | 0

Respondida
X axis of feather plot
Use quiver instead; it allows you to specify explicit x and y coordinates for each vextor: quiver(date, zeros(size(U)), U, ...

casi 13 años hace | 0

| aceptada

Pregunta


Rank deficiency issues with GeneralizedLinearModel
I'm not quite sure if I'm encountering a bug associated with GeneralizedLinearModel objects, or if this is simply a result of my...

casi 13 años hace | 0 respuestas | 0

0

respuestas

Respondida
Can't figure out why plot is not giving the correct graph with either switch or if-elseif code
Switch/case is definitely not the best choice for this (pretty sure it doesn't work with inequalities at all). The idea behind ...

casi 13 años hace | 0

| aceptada

Respondida
How to make a log plot with a graph?
Would you be able to switch to using |pcolor| instead of |imagesc|? In that case, you could set the |'Yscale'| as suggested by ...

casi 13 años hace | 0

| aceptada

Respondida
Is there a way to get MATLAB to filter out specific rows in arrays?
Take a look at the |ismember| function: data = [... 10000.5 3 120 10001.0 5 112 10001.5 1 117 10002.0 4 119 10002.5 ...

casi 13 años hace | 2

| aceptada

Respondida
assign colarmap to multiple lines' lengths
Do you mean something like this? x = 1:10; y = rand(1,10); w = 1:10; % weights patch([x NaN],[y NaN],[c NaN], 'edg...

casi 13 años hace | 1

Respondida
Help with sprintf, disp, load, strcat?
Looks like |concatdatesearch| returns a cell array, not a character array. Try adding the line FileName = FileName{1}; a...

casi 13 años hace | 0

| aceptada

Respondida
convert monthly data from daily data series
Assuming t is a vector of datenumbers and x is your corresponding data, the following code will return the last instance of each...

casi 13 años hace | 0

| aceptada

Respondida
Create a matrix full of dates
If you just want to increment from a fixed point, then that's pretty straightforward. t0 = datenum('2013-04-01 22:00:59');...

casi 13 años hace | 0

| aceptada

Respondida
Problem with quiver resolution
When you don't provide any x or y matrices, both contour and quiver assume 1:#columns and 1:#rows as the x and y-coordinates, re...

casi 13 años hace | 0

| aceptada

Respondida
How can I make contour lines smoother?
The easiest way to do this is to interpolate your data to a higher resolution using an interpolation scheme that will result in ...

casi 13 años hace | 2

Cargar más