Respondida
Group values in a double & create new matrix according to the groups formed
xedge = [0 5 10 15 20 30 40 50 100 150 200 300]; A = rand(1000,1)*300; [n, idx] = histc(A, xedge); isin = bsxfun(@eq,...

más de 11 años hace | 1

| aceptada

Respondida
Making and colouring a vertical surface
You can do it pretty much exactly like the clown example; your surface just needs to define a vertical plane: c = load('clo...

más de 11 años hace | 2

| aceptada

Respondida
Contour plot for river cross sections
My first instinct would be to transform the data from lat/lon coordinates into length/width coordinates, where length and width ...

más de 11 años hace | 2

| aceptada

Respondida
How do I resolve the Improper index matrix reference error?
Type which plot -all Is there a variable named plot overshadowing the function?

más de 11 años hace | 0

Respondida
How do I get multiple boxplots onto one figure, with NaNs in the mix?
Just a small change needed: boxplot(x(:), group(:))

más de 11 años hace | 3

| aceptada

Respondida
Indexing to subtract sections of an array
A = rand(1,80000); nuse = 64; nskip = 16; new = reshape(A, nuse+nskip, []); B = new(1:nuse,1) - sum(new(1:nus...

más de 11 años hace | 0

Respondida
Need help writing expression in regexp!!!
idx = setdiff(1:length(Lines), [cardelm; cardprop; cardmats; cardcs]);

más de 11 años hace | 0

| aceptada

Respondida
How to group connected pairs
There are several graph theory-related entries on the FEX that provide connected components algorithms. <http://www.mathworks.c...

más de 11 años hace | 0

| aceptada

Respondida
How can I plot overlay black land?
Plot using |pcolor| (not |image| or similar), mask out the land with NaNs, and set the axis color to black. If you don't ha...

más de 11 años hace | 2

Respondida
The max matrix of two matrices
C = max(A,B);

casi 12 años hace | 3

| aceptada

Respondida
code using if but didn't work?? any help
You have a typo in your then statement... should be newa(1,i) = 1; not newa(1,i) == 1; But you can replace the en...

casi 12 años hace | 0

| aceptada

Respondida
Loop only storing last run in nested for loop ... should be easy indixing easy for the experienced eye
You could simplify the syntax quite a bit using histc and accumarray: inpdata = [datenum(2014,1,1)+(1:100)' rand(100,12)*39...

casi 12 años hace | 0

| aceptada

Respondida
Best practice to pass large number of parameters to many functions?
I use structures for this sort of thing. I also usually set up functions so that they can handle input as either structure or p...

casi 12 años hace | 5

Respondida
Is there a fix for a bug in the gshhs function from the MATLAB mapping tool box? Faulty section of coast off South America.
Just to clarify, what you're seeing isn't a bug in |gshhs| so much as a bug in |geoshow|, |patchm|, |patchesm|, etc.; all of Mat...

casi 12 años hace | 1

Respondida
Create a 3D Martix by operation of 1D vector on 2D matrix, using cat()
A = rand(10,5); B = 1:3; C = bsxfun(@minus, A, permute(B, [3 1 2])); If B is a column vector (instead of a row vector...

casi 12 años hace | 0

| aceptada

Respondida
How to read many arbitrary text files in MATLAB?
F = dir('ClCdCm*.txt'); nfile = length(F); ctext = cell(nfile, 1); cdata = cell(nfile, 1); for ii = 1:length(F) ...

casi 12 años hace | 2

| aceptada

Respondida
Changing bar graph bar colors
By default, all the bars in a bar graph are part of the same patch object, and therefore are the same color. To get different c...

casi 12 años hace | 0

| aceptada

Respondida
Dimension error using VERTCAT, but pretty sure dimensions are consistent
When you try to concatenate the cell array ( |text| ) with a numeric array ( |rawdata| ), the numeric array is treated as a sing...

casi 12 años hace | 4

| aceptada

Respondida
Plotting rainfall data with latitude and longitude coordinates
The geoshow function will plot your data... no need to create an image as an in-between. As you called it, you passed 2D data, ...

casi 12 años hace | 0

Respondida
Truncating elements of Vector for XTick and YTick
Not quite sure I understand the issue... the format of tick values when your print them to screen has no relation to how they ar...

casi 12 años hace | 0

Respondida
Using try/catch to get warning message
You can turn off specific warning messages via the warning command: S = warning('MATLAB:ode45:IntegrationTolNotMet', 'off')...

casi 12 años hace | 0

| aceptada

Respondida
How to open a shapefile with a shape type "PolyLineM"? It did not work in 'shaperead' function.
Have you tried |m_shaperead| from the <http://www2.ocgy.ubc.ca/~rich/map.html M_map Toolbox>? It might be able to handle that. ...

casi 12 años hace | 0

Respondida
Frequency Magnitude histogram plot
Is this what you had in mind? xedge = 2.1:.1:3; freq = [43 41 31 29 13 9 3 2 1]; bar(xedge, [freq 0], 'histc')

casi 12 años hace | 1

Respondida
Reading date of a file
Why not just use dir? A = dir(myfile); disp(A.date) But if you want to call the dos command: [dum, str] = dos(spr...

casi 12 años hace | 1

| aceptada

Respondida
How can I get a point cloud from a patch object?
I'm assuming from this example that |TRI| is nx3 and |P| is 3xm (i.e. your data is 3D) trimesh uses the same face/vertex inpu...

casi 12 años hace | 1

| aceptada

Respondida
Mapping toolbox patch color issue
Plotting patches in map axes can be a real pain. I think it's because of the way patches are trimmed at map boundaries, though ...

casi 12 años hace | 2

Respondida
How can I stop textread from reading [1x1 char] and ' '?
It looks like there might be some additional characters/columns in your file that are causing problems; just running a test on y...

casi 12 años hace | 0

Respondida
Using three 60000 x 1 double matrices, how to make the 3D graph efficiently in the form of 2D
Right now, your meshgird command is attempting to create 2 60000x60000 matrices... which are going to require around 26 GB each....

casi 12 años hace | 2

| aceptada

Pregunta


Increase limit on number of open files
*Short question(s):* Is there a way to increase the maximum number of open files allowed at a given time? For that matte...

casi 12 años hace | 2 respuestas | 1

2

respuestas

Pregunta


Close open netcdf files
*Short question:* Is there a way to explicitly close all open netcdf files, similar to fclose('all') for open binary ...

casi 12 años hace | 0 respuestas | 3

0

respuestas

Cargar más