pad.m

From Spinach Documentation Wiki
Jump to: navigation, search

Pads or cuts a string with spaces to make it n characters long.

Syntax

    output_string=pad(input_string,new_length,side)

Arguments

  input_string - a character string

  new_length   - pad with spaces or truncate to this length

  side         - 'left' or 'right'

Outputs

  output_string - the resulting character string

Notes

Matlab has a similar function in an obscure toolbox, but users do not always have that toolbox installed.

See also

banner.m, report.m


Version 2.2, authors: Ilya Kuprov, Konstantin Pervushin