Respondida
Trouble loading data from .nc file
What version of Matlab are you running? They've introduced some nice higher-level reading and writing functions in more recent ...

más de 12 años hace | 2

| aceptada

Respondida
interference with marker and patch?
Guessing perhaps an OpenGL issue ( <http://www.mathworks.com/help/matlab/ref/opengl.html>). Try placing: set(gcf, 'rendere...

más de 12 años hace | 0

| aceptada

Respondida
Decimal places in axis
If you're interested in a shortcut, you can try out this function: <http://www.mathworks.com/matlabcentral/fileexchange/16003-ti...

más de 12 años hace | 2

| aceptada

Respondida
How can I interpolation values within a 3D matrix by ignoring zeros?
I use this function a lot: <http://www.mathworks.com/matlabcentral/fileexchange/21214-inpainting-nan-elements-in-3-d inpaint_na...

más de 12 años hace | 1

Respondida
Problem with x-axis and dates in plot
If you're not too picky about exactly which years are labeled, datetick should do it. Assuming |t| holds your time data (as dat...

más de 12 años hace | 0

Respondida
Not sure what commands to use for eg. 0<x<a, when certain values are given
You might want to start by reading up on logical indexing (search the documentation). Your first example: Qw = zeros(size(...

más de 12 años hace | 0

Respondida
How do I use REGEXP to match multi-digit values?
In a regular expression, |[220]| means "match a single 2, 2, or 0". Eliminate the brackets if you want to match a specific sequ...

más de 12 años hace | 1

Respondida
how to do plotting with different colors in same figure?
Also, using colormaps and set with multiple handles + cell arrays can be helpful if you need a lot of colors. x = 1:100; i...

más de 12 años hace | 13

Respondida
Reshape matrix (panel data)
Might this function help: <http://www.mathworks.com/matlabcentral/fileexchange/21617-vec2grid vec2grid>?

más de 12 años hace | 0

| aceptada

Respondida
Is it possible to do multidimensional interpolation on a set of scattered data?
Does this function do what approximately what you're looking for: <http://www.mathworks.com/matlabcentral/fileexchange/21617-vec...

más de 12 años hace | 1

Respondida
ginput Tracking and preview of where clicked.
I use <http://www.mathworks.com/matlabcentral/fileexchange/20645-ginput2-m-v3-1-nov-2009 ginput2>, from the File Exchange.

más de 12 años hace | 0

Respondida
How can delete a variable within a netcdf file
Not a Matlab solution, but if you have access to NCO ( <http://nco.sourceforge.net/>), issued from a terminal window: ncks -...

más de 12 años hace | 2

| aceptada

Respondida
How set tick location in logarithmic subplot ?
Why are you plotting salinity on a log scale in the first place? At first I thought perhaps you were trying to get your salinit...

más de 12 años hace | 0

| aceptada

Respondida
How to make datenum more efficient for large arrays?
Are you specifying the date format? Particularly for large arrays, datenum(A{1}, 'yyyy-mm-dd HH:MM:SS') will be much fa...

más de 12 años hace | 1

Respondida
I'm getting a matrix subscript index error
Perhaps you accidentally made |end| the name of a variable? At that line, what does which end return?

más de 12 años hace | 0

Respondida
Why does my command window behave like Unix "more" command?
Looks like you accidentally turned page output on, with 1 line per page. This would be activated via the command more(1) ...

más de 12 años hace | 0

| aceptada

Respondida
Printing a LaTeX Table with Some Number and some Words
You mean like this? sDetNamesGe = {'T1Z2', 'T1Z5', 'T2Z3','T2Z5', 'T3Z2','T3Z4',... 'T3Z5','T3Z6', 'T4Z2', 'T4Z4', '...

más de 12 años hace | 1

| aceptada

Respondida
Textscan with multiple delimiters
You should be able to get what you want with just a bit of post-processing following your textscan line: str = sprintf('one...

más de 12 años hace | 0

| aceptada

Respondida
How do I write a MATLAB code for A (in body) that doubles the elements that are greater than 6, and raises to the power of 2 the elements that are negative but greater than -2?
The loops are unnecessary: A = [5 10 -3 8 0; -1 12 15 20 -6]; A(A > 6) = A(A > 6) .* 2; A(A < 0 & A > -2) = A(A < 0 &...

más de 12 años hace | 0

Respondida
Problem with datetick in R2013a
Define "cannot use". The datetick function is definitely included in R2013a, and as far as I can tell hasn't undergone any majo...

más de 12 años hace | 1

Respondida
Issue with low values for surf and colorbar
Looks like an OpenGL issue. Try set(gcf, 'renderer', 'zbuffer'); You can read up more on this, and possibly find some w...

más de 12 años hace | 1

| aceptada

Respondida
I have 366 matrices of size 72x144. How can I create a 367th matrix, also size 72x144, which represents the average by element of the original?
To add to Walter's answer, here's a quick way to generate your list of file names, since they're labeled by date rather than a s...

más de 12 años hace | 0

Respondida
Use of coordinates to plot a figure as shown
The gplot function is probably the easiest way to do this: xy = NodeCoordinates; ee = ElementNodes; n = size(xy,1)...

más de 12 años hace | 0

| aceptada

Respondida
Can I display 2 legends while using the plotyy function?
You can only create one legend per axis (unless you use an outside function like <http://www.mathworks.com/matlabcentral/fileexc...

más de 12 años hace | 2

Respondida
Is element-wise multiplication or element-wise squaring faster?
A slightly more robust timing test, using <http://www.mathworks.com/matlabcentral/fileexchange/18798-timeit-benchmarking-functio...

más de 12 años hace | 0

| aceptada

Respondida
How can I change elements in a matrix all at once??
new = mtx + [mtx(:,2:end) zeros(size(mtx,1),1)]

más de 12 años hace | 0

Respondida
Assigning black color to zero values of "imagesc" plot
It'll be a little tricky to do with imagesc, but you could get a similar result with pcolor: aplt = nan(size(A)+1); aplt...

más de 12 años hace | 1

Respondida
Create multiple patches from a single X,Y,Z matrix without NaNs
What is the format of the x, y, and z data? What distinguishes one face from another within that dataset? E.g. does each face ...

más de 12 años hace | 0

Respondida
Averaging values in rank orderings with repeats
The accumarray function should do what you want: u = [1,3,2,2,4,7,2,5]; nu = length(u); rank = (1:nu)'; ravg = accum...

más de 12 años hace | 0

| aceptada

Respondida
Import Irregular and nonpaterned text data into a matrix form
Assuming I've interpreted your file format correctly, you probably don't need regexp. My parsing below assumes that 1) each ent...

más de 12 años hace | 1

Cargar más