qgrid = sw_qgrid(Name,Value)


qgrid = sw_qgrid(Name,Value) generates n-dimensional grids (\(n<=3\)) in 3D space, e.g. points on a line in 3D. It uses \(n\) linearly independent vectors (“lattice vectors”) and bin values (coordinates in “lattice units” or “lu”) to generate the points. It works similarly as the d3d constructor in Horace.

Name-Value Pair Arguments

Row vector with 3 elements, determines the first axis in 3D space, default value is [1 0 0].
Second axis, default value is [0 1 0].
Third axis, default value is [0 0 1].
Row vector with 3 elements, determines the offset of origin in lu, (fourth element is accepted but discarded).
Bin points along the first axis. Can be a vector with 1, 2 or 3 elements:
  • [B1] single value along the \(u\)-axis at a coordinate of B1*u
  • [B1 B2] range along the \(u\)-axis at coordinates of [B1:1/nExt:B2]*u
  • [B1 dB B2] range along the \(u\)-axis at coordinates of [B1:dB:B2]*u
Same as ubin but along the \(v\)-axis.
Same as ubin but along the \(w\)-axis.
Vector with \(n\)-elements that can define fractional bin steps, default values is [1 1 1].
Cell array of projection axis labels with 3 elements (4th element discarded), e.g. {'x' 'y' 'z'}.

The dimension count \(n\) is determined by the number of given bins (\(1<=n<=3\)), so if only ubin is given, \(n=1\); if both ubin and vbin are defined then \(n=2\), etc.

Defines whether to provide text output. The default value is determined by the fid preference stored in swpref. The possible values are:
  • 0 No text output is generated.
  • 1 Text output in the MATLAB Command Window.
  • fid File ID provided by the fopen command, the output is written into the opened file stream.

Output Arguments

A matrix with dimensions of \([3\times n_{ax1}\times n_{ax2},...]\), where \(n_{axi}\) is the index of points along \(i\)th axis with \(1<=i<=n\).

See Also