N-dimensionally spaced points

Multidimensional extension and generalisation of LINSPACE and LOGSPACE.
ダウンロード: 343
更新 2011/8/14

ライセンスの表示

NDSPACE N-dimensionally spaced points
NDSPACE(X1, X2) generates a column matrix of 10^n linearly
equally spaced points in the hypercube defined by the two diametrically
opposite cornerpoints X1 and X2 both n-by-1 vectors. If either is a
scalar it will be expanded to repmat(X,n,1).

NDSPACE(X1, X2, P) generates P^n points if P is a scalar or prod(P)
points if P is a n-by-1 vector.

NDSPACE(X1, X2, P, F) generates points using a function defined by the
function handle or string F which needs to have the calling syntax of
LINSPACE(X1, X2, N). If F is a n-by-1 cell of function handles or
strings different generating functions can be used per dimension.

Example

x = ndspace([0,0],[10,100],5,@linspace)
y = ndspace([0,1],[1,2],6,@logspace)
z = ndspace([10,1],[20,2],[5,8],{@linspace,@logspace})

plot(x(:,1),x(:,2),'bo'), hold on
plot(y(:,1),y(:,2),'gx')
plot(z(:,1),z(:,2),'r*'), hold off

引用

Christophe Lauwerys (2024). N-dimensionally spaced points (https://www.mathworks.com/matlabcentral/fileexchange/32512-n-dimensionally-spaced-points), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2010a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCreating and Concatenating Matrices についてさらに検索
タグ タグを追加

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.1.0.0

Fixed bug in case of 1-D inputs.

1.0.0.0