widthConstrainedDataRepresentation
Class: matlab.mixin.CustomCompactDisplayProvider
Namespace: matlab.mixin
Build compact display representation based on available character width
Since R2021b
Syntax
Description
[
builds a compact display representation of the object array rep,num] = widthConstrainedDataRepresentation(obj,displayConfiguration,width)obj that is
adjusted to the available character width, using the string converter method defined by the
class of obj. The method returns the representation and number of
elements included in the representation in rep and
num, respectively. To construct a representation suitable for display
within the container, the method uses the current display context as described in
displayConfiguration.
widthConstrainedDataRepresentation tries to build a plain-text
representation by fitting as many elements of obj within the available
character width as possible. Depending on the value of width, the
representation might include the data in all or a portion of obj
elements. If width is not large enough to fit any array elements, then
the method returns a representation using the array dimensions and class name.
[
builds a compact display representation using additional options specified by one or more
name-value arguments.rep,num] = widthConstrainedDataRepresentation(obj,displayConfiguration,width,Name=Value)
Input Arguments
Name-Value Arguments
Output Arguments
Examples
Tips
widthConstrainedDataRepresentationis a utility method. You can call it from within thecompactRepresentationForSingleLineorcompactRepresentationForColumnmethods to customize the compact display of your objects.