LabKit MATLAB Workbench

reference

API ReferenceImage API

labkit.image.normalizePaths

Normalize image file path inputs to a string column.

Syntax

paths = labkit.image.normalizePaths(paths) paths = labkit.image.normalizePaths(paths, "AllowEmpty", false)

Description

Converts the path forms commonly returned by MATLAB file selection into one string column. Leading and trailing whitespace is removed and blank entries are discarded. Order and duplicate paths are preserved. A single character vector is treated as one path rather than one path per row.

This function normalizes text only. It does not expand relative paths, validate extensions, remove duplicates, or test file existence.

Inputs

paths
Character vector, string array, cell array, or empty value.

Outputs

paths
String column containing the nonblank normalized paths.

Name-Value Arguments

AllowEmpty
Logical scalar controlling whether zero paths are accepted. The default is true. false throws labkit:image:NoPaths when normalization produces an empty result.

Errors

labkit:image:InvalidPaths
paths is not char, string, cell, or empty.
labkit:image:NoPaths
No path remains and AllowEmpty is false.

Example

paths = labkit.image.normalizePaths([" frame01.png "; ""; "frame02.JPG"]);

Source

This page is generated from the MATLAB help text in +labkit/+image/normalizePaths.m.