Search Comments and Ratings

go

   
Date File Comment by Comment Rating
26 Nov 2014 Add a title to a legend Add a title to a legend - compatible with R2014b Author: Robert Cumming Felipe G. Nievinski

Works better than submission #4561 (legendtitle), specially after saving figure as a png file. (You might wish to "acknowledge" that submission so that it links back to the present one.)

4
14 Jul 2014 convert_humidity Convert humidity between different formats. Author: Felipe G. Nievinski Felipe G. Nievinski

@hosseini: please take a look at the tests included in the bottom of file convert_humidity.m. For example, to convert specific humidity (s) to relative humidity (r) you'd do:
r = convert_humidity (P, T, s, 'specific humidity', 'relative humidity');
where P and T stands for pressure and temperature.

Comment only
06 May 2014 subtightplot Asymmetric subplots with variable inner gaps and outer margins. Author: Felipe G. Nievinski Felipe G. Nievinski

@Tamanaco: clear subplot;

Comment only
22 Apr 2014 Theil–Sen estimator Robust regression for slope estimation between 1dimensional X and y Author: Arnout Tilgenkamp Felipe G. Nievinski

Line 12:

theil=diff(y(Comb),1,2)./diff(x(Comb),1,2);

can be replaced by:

theil=deltay./deltax;

(otherwise the value assigned to deltax and deltay would be unused.

4
20 Jan 2014 Structure display simple recursive display of a structure content in Matlab Author: Thomas Deneux

Thomas Deneux (view profile)

Felipe G. Nievinski

a mnemonic after matlab's builtin celldisp:

function varargout = structdisp (varargin)
[varargout{1:nargout}] = fn_structdisp (varargin{:});
end

4
10 Dec 2013 Generate maximally perceptually-distinct colors Choose a set of n colors that can be readily distinguished from each other Author: Tim Holy

Tim Holy (view profile)

Felipe G. Nievinski

5
10 Dec 2013 varycolor Provides maximum color variation for lines on plots. Author: Daniel Helmick

Daniel Helmick (view profile)

  • 1 file
  • 204 downloads
  • 4.57143
Felipe G. Nievinski

I found "Generate maximally perceptually-distinct colors" to be better in the case of a few lines.

2
07 Nov 2013 Functional Programming Constructs A set of files for treating many operations, like "if", "for", and even "()", as functions. Author: Tucker McClure

Tucker McClure (view profile)

Felipe G. Nievinski

I guess instead of a separate iiff.m function this could be a patch for the original iif.m (backwards compatible):

isodd = @(x) logical(mod(x,2));
if isodd(numel(varargin))
varargin(end:end+1) = [{true}, varargin(end)];
end

Comment only
07 Nov 2013 Functional Programming Constructs A set of files for treating many operations, like "if", "for", and even "()", as functions. Author: Tucker McClure

Tucker McClure (view profile)

Felipe G. Nievinski

% inline if-else (special case of general inline if-elseif):
% (dispense with typing true as the penultimate input argument)
function varargout = iiff(varargin)
varargin(end:end+1) = [{true}, varargin(end)];
[varargout{1:nargout}] = iif(varargin{:});
end

Comment only
25 Oct 2013 cloudPlot A function to plot the distribution of 2-dimensional data. Author: Daniel Armyr

Daniel Armyr (view profile)

Felipe G. Nievinski

See also file ID # 29709, 18386, 31889, 29641, 6037, 29435, 25914, 25325, 14205, 13352, 43672, ...

Comment only
23 Oct 2013 mydate Augments MATLAB's date/time library for improved handling of epochs and formats commonly used in GPS Author: Felipe G. Nievinski Felipe G. Nievinski

I've just submitted an update which includes the missing file -- my apologies, and thank you for your interest.

Comment only
13 Mar 2013 Functional Programming Constructs A set of files for treating many operations, like "if", "for", and even "()", as functions. Author: Tucker McClure

Tucker McClure (view profile)

Felipe G. Nievinski

5
12 Feb 2013 Returns weighted percentiles of a sample Returns weighted percentiles of a sample with six algorithms given weight vector Author: Durga Lal Shrestha Felipe G. Nievinski

For those looking for a weighted median: wmedian = @(X) wprctile(X,50);

4
02 Feb 2013 fig- the exact figure size and no white space Create publication-quality figures; easily define the figure's size, font of all labels, titles... Author: Reza

Reza (view profile)

Felipe G. Nievinski

5
27 Dec 2012 tight subplot Fills the figure with axes subplots with easily adjustable margins and gaps between the axes. Author: Pekka Kumpulainen Felipe G. Nievinski

It's great that it offers variable outer margins in addition to inner gaps. I wish it could support asymmetric plots, where a panel spans multiple rows/columns, though.

4
27 Dec 2012 Controllable tight subplot Subplot wrapper, allowing better figure utilization, by tighter axes. Author: Nikolay S.

Nikolay S. (view profile)

Felipe G. Nievinski

I love that it can replace the built-in subplot with minor modification in the caller script. I wish it could handle margins in addition to gaps though.

4
19 Nov 2012 LEGENDTITLE Add a title string inside a legend. Author: Steve Simon

Steve Simon (view profile)

Felipe G. Nievinski

It seems the problem can be avoided calling the saveas function instead of clicking Save As from the figure window's File menu (which internally calls hgexport).

4
21 Nov 2011 Adjust error bar width Adjust error bars width in an errorbar plot to a ratio of the x-axis or a length (x-axis units). Author: Arnaud Laurent

Arnaud Laurent (view profile)

Felipe G. Nievinski

You might want to insert this at line # 39:

if ~isscalar(h)
arrayfun(@(h) errorbar_tick(h,w,xtype), h);
return;
end

Comment only
15 Nov 2011 Adjust error bar width Adjust error bars width in an errorbar plot to a ratio of the x-axis or a length (x-axis units). Author: Arnaud Laurent

Arnaud Laurent (view profile)

Felipe G. Nievinski

It's great that this function operates on the handle output by the errorbar function, rather than duplicating what the errorbar function already does.

5
13 Aug 2011 Get computer name/hostname It provides the computer name where running. Useful for customizing scripts depending on the machine Author: Manuel Marin Felipe G. Nievinski

4
08 May 2011 Lomb normalized periodogram Both functions calculate the Lomb-Scargle periodogram (aka Gauss-Vanicek/Least-squares spectrum) Author: Christos Saragiotis Felipe G. Nievinski

Does the job.
You might want to replace line 198:

if length(x)~=nt, disp(sprintf('WARNING %s: Double entries have been eliminated',mfilename)); end

for:

if length(x)~=nt, warning('fastlomb:Duplicates','Double entries have been eliminated.'); end

so that it can be disabled issuing warning('off','fastlomb:Duplicates')

4
04 May 2011 cprintf: a pedestrian ND array formatting and display utility cprintf converts an ND array or ND cell array to a 2D character array and - optionally - a table Author: us

us (view profile)

Felipe G. Nievinski

Would you consider replacing this block (~ l.1050):

try
v=par.s2f('@(x) x'); % WARNING only
v(10); % ERROR to catch
catch %#ok
par.s2f=@eval;
end

for this one:

[msg_str_old, msg_id_old] = lastwarn('', '');
par.s2f('@(x) x'); % WARNING only
[msg_str, msg_id] = lastwarn(msg_str_old, msg_id_old);
if strcmp(msg_id, 'MATLAB:str2func:invalidFunctionName')
par.s2f=@eval;
end

I'm asking because sometimes I have to run code using dbstop if caught error.
Thanks!

5
20 Apr 2011 lapack Easily call any LAPACK or BLAS routine from inside Matlab. Author: Tim Toolan Felipe G. Nievinski

5
20 Apr 2011 lapack Easily call any LAPACK or BLAS routine from inside Matlab. Author: Tim Toolan Felipe G. Nievinski

Tim, I'm using a slightly modified version of your lapack package in my trilin package (#31125). I'd be glad if you'd consider incorporating the modifications in my submission into your original submission. Thanks.

Comment only
19 Apr 2011 lapack Easily call any LAPACK or BLAS routine from inside Matlab. Author: Tim Toolan Felipe G. Nievinski

I was suuuuper excited about this package. I am considering ditching all my LAPACK-calling C mex code in favor of it. The compilation is a bliss, no hassle in finding out where either or both LAPACK and BLAS are installed, depending on MATLAB version, computer, and compiler!

Before that, though, I was wondering if could you please comment on the following issues.

- Compiling without the -largeArrayDims flag in a 64-bit MATLAB seems to give unreliable results. Any idea why? It should be optional.

- The instructions on top of lapack.c say:
To build on Windows, run: mex lapack.c
Since lapack.m already beautifully takes care of that using largeArrayDims, you might want to change lapack.c to instruct users to simply run lapack(.m).

- Using lapack.mexw64 compiled on MATLAB 2009 64-bit gives unreliable results when used on MATLAB 2007 64-bit; it seems related to casting integer types, e.g., ipiv in a call to dgetrf has some very large values:
17179869189
21474836483
0
0

- Empty input crashes MATLAB, e.g., lapack('dgetrf', 0, 0, [], 0, 0, 1)

- I see that all arguments are copied to new memory. For me that's a concern, because I need to handle very large matrices. I understand doing that for arguments that will be overwritten by LAPACK, but that's clearly unnecessary for, e.g., the matrix factor in solving a linear system. I was wondering if you'd agree with the inclusion of a new argument, something like this:

else if (c == 'U'){
/* USER DEFINED **********************************************
/ User guarantees type and also whether or not LAPACK will overwrite this argument.
/ lowercase: input-only: need not copy.
/ UPPERCASE: input/output: need to copy.
/ TODO: complex-valued variables need at least to have their real/imag parts reorganized. */
if (mxIsComplex(args[i])){
sprintf(msg, "Can't convert argument %d to FORTRAN type "
"DOUBLE PRECISION, use double.", i+1);
mexErrMsgTxt(msg);
}
if (isupper(argType[i])){
value = mxDuplicateArray(args[i]);
a[i] = mxGetPr(value);
if (plhs[0] && mxIsCell(plhs[0]))
mxSetCell(plhs[0], indArgOut[i], value);
else
plhs[indArgOut[i]] = value;
}
else{
a[i] = mxGetPr(args[i]);
}
}

- e.g., lapackhelp('dtrcon') leads to an unreachable website; the most stable URL seems to be:
http://www.netlib.org/lapack/double/dtrcon.f
(where the double/single subdir would have to be chosen automatically)

Thanks for your time.

Comment only
08 Apr 2011 imagescnan.m v2.1 (Aug 2009) Same as IMAGESC but ignores NaNs. Author: Carlos Adrian Vargas Aguilera Felipe G. Nievinski

why not do simply:
imagesc(img, 'AlphaData',~isnan(img))
where, e.g.,
img = membrane(1,25);
img(1:10:end) = NaN;

Comment only
04 Apr 2011 Adaptive Robust Numerical Differentiation Numerical derivative of an analytically supplied function, also gradient, Jacobian & Hessian Author: John D'Errico

John D'Errico (view profile)

Felipe G. Nievinski

"Automatic" in the title might confound viewers that it implements "automatic differentiation", see <http://en.wikipedia.org/wiki/Automatic_differentiation> and submission # 26807.

You might want to use the acknowledgement field so that related submission #15235 back-links to yours.

Haven't tried it yet, reason why I'm not rating it.

Comment only
03 Apr 2011 Color Palette Tables (.cpt) for Matlab Create and apply GMT-style colormaps in Matlab Author: Kelly Kearney

Kelly Kearney (view profile)

Felipe G. Nievinski

Another one, trying

cptcmap('sst')

Just had to replace

if ~strcmp(varargin{1}(end-3:end), '.cpt') % without extension

for:

if (numel(varargin{1}) <= 4) || ~strcmp(varargin{1}(end-3:end), '.cpt') % without extension

Comment only
03 Apr 2011 Color Palette Tables (.cpt) for Matlab Create and apply GMT-style colormaps in Matlab Author: Kelly Kearney

Kelly Kearney (view profile)

Felipe G. Nievinski

Another one, trying

cptcmap('sst')

Just had to replace

if ~strcmp(varargin{1}(end-3:end), '.cpt') % without extension

for:

if (numel(varargin{1}) <= 4) || ~strcmp(varargin{1}(minend-3:end), '.cpt') % without extension

Comment only
03 Apr 2011 Color Palette Tables (.cpt) for Matlab Create and apply GMT-style colormaps in Matlab Author: Kelly Kearney

Kelly Kearney (view profile)

Felipe G. Nievinski

You might want to replace l.83:

cptpath = './cptfiles';

with:

cptpath = fullfile(fileparts(which('cptcmap')), 'cptfiles');

That way the source code needs not be modified when first downloading the package or later when moving the routine files around.

I was having problems trying

cptcmap('elevation')

where elevation.cpt was downloaded from cpt-city and placed in the cptpath; it turns out that l.98,

if exist(varargin{1}, 'file') % full filename and path given

would find this other file instead:

which elevation
C:\Program Files\MATLAB\R2009b\toolbox\map\map\elevation.m

You might want to replace the block l.98-111 with the following (minimally modified):

if ~strcmp(varargin{1}(end-3:end), '.cpt') % without extension
varargin{1} = [varargin{1} '.cpt'];
end
if exist(varargin{1}, 'file') % full filename and path given
filename = varargin{1};
else % only file name given
filename = fullfile(cptpath, varargin{1});
if ~exist(filename, 'file')
error('Specified .cpt file not found');
end
end

Finally, not sure why the __MACOSX subdirectory is being distributed.

Comment only
01 Apr 2011 Random Field Simulation Generate multivariate conditional random fields given a mesh and covariance information. Author: Paul Constantine Felipe G. Nievinski

5
26 Mar 2011 Color Palette Tables (.cpt) for Matlab Create and apply GMT-style colormaps in Matlab Author: Kelly Kearney

Kelly Kearney (view profile)

Felipe G. Nievinski

Great idea, always wanted to make my matlab maps look like gmt's. Also thanks for pointing out to cpt-city, it's a great collection.

You might want to use the acknowledgement field in the FEX form, so that your submission is back-linked from related entries, e.g., 28982 and the ones linked from there.

5
26 Mar 2011 boundedline.m Plot one or more lines with a shaded boundary (can represent error, confidence intervals, etc). Author: Kelly Kearney

Kelly Kearney (view profile)

Felipe G. Nievinski

good job in pointing out advantages over several other similar entries on the FEX.

Comment only
16 Mar 2011 frontal Do: C = frontal_mtimes(A, b); not: for k=1:size(A,3), C(:,:,k) = A(:,:,k) * b(:,:,k); end Author: Felipe G. Nievinski Felipe G. Nievinski

Don't do:

addpath(genpath('c:\work\fx\frontal\frontal\'))

just:

addpath(genpath('c:\work\fx\frontal\'))

as instructed.

Comment only
16 Mar 2011 frontal Do: C = frontal_mtimes(A, b); not: for k=1:size(A,3), C(:,:,k) = A(:,:,k) * b(:,:,k); end Author: Felipe G. Nievinski Felipe G. Nievinski

Please check your unzipping procedure. I've double checked the zip and the directory structure is intact.

Comment only
06 Mar 2011 FFT-based convolution Discrete convolution using FFT method Author: Bruno Luong

Bruno Luong (view profile)

Felipe G. Nievinski

Well written (IMHO).

Comment only
06 Mar 2011 FFT-based Convolution A fast 1D and 2D convolution. Author: Luigi Rosa

Luigi Rosa (view profile)

Felipe G. Nievinski

The code is bug-prone because it has lots of unnecessary duplicated portions. I'd recommend instead <http://www.mathworks.com/matlabcentral/fileexchange/24504-fft-based-convolution>.

Comment only
06 Mar 2011 FFW Fastest Filtering in the West Fast 2D convolution - filtering Author: Luigi Rosa

Luigi Rosa (view profile)

Felipe G. Nievinski

The FFTw now comes with Matlab.

Comment only
21 Dec 2009 Tan_plane: Tangent Plane Expression & Display Calculates the tangent plane of a Surface at point Xo and plots the surface, plane and Xo! Author: Gustavo Morales

Gustavo Morales (view profile)

Felipe G. Nievinski

You might wish to consider replacing l.37,
%fo = subs(f, X, Xo); % f evaluated at Xo
by
fo = subs(subs(f, X(1),Xo(1)), X(2),Xo(2));
and l.46,
dF = subs(jacobian(f, X), X, Xo);
by
dF = subs(subs(jacobian(f, X), X(1),Xo(1)), X(2),Xo(2));
With these few changes tan_plane would work with older versions of Matlab (e.g., R2007b).

Comment only
21 Dec 2009 Tan_plane: Tangent Plane Expression & Display Calculates the tangent plane of a Surface at point Xo and plots the surface, plane and Xo! Author: Gustavo Morales

Gustavo Morales (view profile)

Felipe G. Nievinski

5

Contact us