lower — Convert text to lowercase in MATLAB and RunMat.
lower(text) converts alphabetic characters to lowercase while retaining the input text container and non-alphabetic content.
Syntax
out = lower(str)Inputs
str- Type
Any- Required
- Yes
- Description
- String, character array, or cell array of text scalars.
Returns
out- Type
Any- Description
- Lowercased text preserving the input container and element shape.
Errors
RunMat:lower:InvalidInput- When
- Input is not a string array, character array, or cell array of text scalars.
- Message
lower: first argument must be a string array, character array, or cell array of character vectors
RunMat:lower:CellElement- When
- Cell array contains a non-text element or non-row char array element.
- Message
lower: cell array elements must be string scalars or character vectors
RunMat:lower:InternalError- When
- Internal output container construction failed.
- Message
lower: internal error
Text containers
lower(text) converts alphabetic code points to lowercase. Non-alphabetic characters pass through unchanged; string arrays preserve shape, orientation and missing values.
Character arrays are processed row by row. MATLAB documents Latin-1 character-array case conversion and Unicode string-array conversion. RunMat currently applies Unicode lowercase mappings to character arrays as well; mappings outside the documented MATLAB character set, such as İ, can expand output width and are not claimed as verified MATLAB parity.
Cell arrays retain their dimensions. Character-vector cells are supported in both compatibility modes; cells containing string scalars are a RunMat-only extension. Numeric, logical, struct and resident numeric inputs are not text.
Execution
lower runs on host text with no provider kernel or fusion path. It does not implicitly convert or gather a numeric GPU handle; convert code points to host text explicitly first.
It reads no workspace or external resources and invokes no callbacks. Malformed input and output construction may throw.
Examples
Convert a string scalar
txt = "RunMat";
result = lower(txt)Expected output:
result = "runmat"Convert a string array
labels = ["NORTH" "South"; "EaSt" "WEST"];
lowered = lower(labels)Expected output:
lowered = ["north" "south"; "east" "west"]Convert character-array rows
animals = char("CAT", "DOGE");
result = lower(animals)Expected output:
result = ['cat '; 'doge']Convert cell text
C = {'HELLO', 'World'};
out = lower(C)Expected output:
out = {'hello', 'world'}Preserve a missing string
vals = ["DATA" string(missing) "GPU"];
converted = lower(vals)Expected output:
converted = ["data" <missing> "gpu"]Gather numeric code points before conversion
codes = gpuArray(uint16('RUNMAT'));
txt = char(gather(codes));
result = lower(txt)Expected output:
result = 'runmat'Using lower with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how lower changes the result.
Run a small lower example, explain the result, then change one input and compare the output.
FAQ
Does lower change non-alphabetic characters?⌄
No. Digits, punctuation, whitespace and symbols remain untouched; alphabetic code points with lowercase mappings change.
What happens to character-array dimensions?⌄
Rows stay rectangular. A lowercase mapping may expand a character, in which case the output gains columns and shorter rows are padded with spaces.
Can numeric arrays be passed to lower?⌄
No. Numeric, logical and struct inputs raise a type error. Convert them to strings or character arrays explicitly first.
How are missing strings handled?⌄
Typed missing string elements remain missing. Literal <missing> text is ordinary text and follows the same case mapping as other text.
Does lower execute on the GPU?⌄
No. There is no resident-text representation or provider string kernel. Numeric GPU handles reject without implicit gathering; gather code points and convert them to text explicitly first.
Related Strings functions
Transform
append · deblank · erase · eraseBetween · erasePunctuation · eraseURLs · extractAfter · extractBefore · extractBetween · insertAfter · insertBefore · join · pad · replace · replaceBetween · reverse · split · splitlines · strcat · strip · strjoin · strjust · strrep · strsplit · strtrim · upper
Text Analytics
addDependencyDetails · addEntityDetails · addLemmaDetails · addPartOfSpeechDetails · addSentenceDetails · addTypeDetails · bagOfNgrams · bagOfWords · cosineSimilarity · doc2sequence · encode · extractFileText · extractHTMLText · fastTextWordEmbedding · findElement · getAttribute · htmlTree · ind2word · isVocabularyWord · normalizeWords · readWordEmbedding · removeLongWords · removeShortWords · removeStopWords · removeWords · stopWords · tokenDetails · tokenizedDocument · trainWordEmbedding · vaderSentimentScores · vec2word · word2ind · word2vec · wordEncoding · writeWordEmbedding
Core
blanks · char · compose · convertCharsToStrings · convertContainedStringsToChars · convertStringsToChars · genvarname · int2str · isletter · isspace · isStringScalar · isstrprop · mat2str · native2unicode · newline · num2str · sprintf · sscanf · str2double · str2num · strcmp · strcmpi · string · string.empty · strings · strlength · strncmp · strncmpi · strtok · unicode2native
Search
contains · endsWith · matches · startsWith · strfind
Pattern
digitsPattern · lettersPattern · pattern · regexpPattern · textBoundary · wildcardPattern
Source you can read
Every RunMat function's source is public. Read exactly how lower is executed, line by line, in Rust.
- View the source for lower in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.