Linearly spaced multidimensional matrix without loop

Generates a N-dimensional matrix of linearly equally spaced points between the matrices d1 and d2.
4,2K download
Aggiornato 19 mag 2014

Visualizza la licenza

LINSPACENDIM is a good extension of the Matlab function linspace to any multidimensional elements.
LINSPACENDIM(d1, d2) generates a multi-dimensional
matrix of 100 linearly equally spaced points between
each element of matrices d1 and d2.

LINSPACENDIM(d1, d2, N) generates N points between
each element of matrices X1 and X2.

Example:
d1 = rand(3, 2, 4); d2 = rand(size(d1)); n = 10;

y = linspaceNDim(d1, d2, n) returns a multidimensional matrix y of
size (3, 2, 4, 10)

Class support for inputs X1,X2:
float: Multidimensional matrix, vector, double, single

--> I did not use any Loop! <--

I use an old function that I wrote to make the tensor product of two(2) multidimensional matrices of of any size and any number of dimensions.

Cita come

Steeve AMBROISE (2026). Linearly spaced multidimensional matrix without loop (https://it.mathworks.com/matlabcentral/fileexchange/22824-linearly-spaced-multidimensional-matrix-without-loop), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2014a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e MATLAB Answers
Riconoscimenti

Ispirato: NDLINSPACE (v1.1, feb 2008)

Versione Pubblicato Note della release
1.3.0.0

update comments

1.2.0.0

I fix the bug that occured when the first (or some) dimensions are singletons.

Thanks to Jos for your comments.

1.1.0.0

NO LOOP!!!

1.0.0.0