biasspace

Versión 1.0.0 (2,48 KB) por Sven
Generates a vector of non-linearly spaced vector with custom bias in the spacing between points
28 Descargas
Actualizado 24 ene 2022

Ver licencia

biasspace Non-linearly spaced vector with custom spacing bias
biasspace(X1,X2,N,BIAS) generates a vector of N points spaced between X1
and X2 with a given point density BIAS. BIAS may be a string designating
a standard bias, or a griddedInterpolant object which provides a
customized point density between X1 and X2.
String BIAS options include:
'linear' - default linspace behavior
'log10','cos','exp10' - See nonLinspace FEX submission by Connor Ott
Customised BIAS is given using a gridded interpolant specifying the
density of points you desired at each location (see example below).
biasspace(...,BIASTYPE) allows BIASTYPE to be specified as "density"
(default) or "spacing". For "spacing", the BIAS interpolant specifies the
desired spacing at locations (i.e., the inverse of density).
Example usage:
figure, hold on
n = 100;
p(1) = plot(biasspace(0,1,n,"linear"),'.-','Tag',"linear");
p(2) = plot(biasspace(0,1,n,"log10"),'.','Tag',"log10");
% A custom bias with 50x more points at either end
vShapedBias = griddedInterpolant([0 0.5 1]',[50 1 50]');
p(3) = plot(biasspace(0,1,n,vShapedBias),'.','Tag',"Custom V-shape");
% Custom bias: 50x more points at 0, then linear between 0.8 and 1.0
biasGi = griddedInterpolant([0 0.8 1]',[50 1 1]');
p(4) = plot(biasspace(0,1,n,biasGi),'.','Tag',"Custom L-shape");
legend(["'linear'" "'log10'" "custom1" "custom2"],"Location","best")

Citar como

Sven (2024). biasspace (https://www.mathworks.com/matlabcentral/fileexchange/105630-biasspace), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2021b
Compatible con cualquier versión desde R2019b
Compatibilidad con las plataformas
Windows macOS Linux
Etiquetas Añadir etiquetas
Agradecimientos

Inspirado por: Non-linearly Spaced Vector Generator

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0