readlines
- :
lines =readlines(filename)¶ - :
lines =readlines(filename, Name, Value)¶ Read a text file as a string array (MATLAB R2022a+ / R2026a compat).
Supported name-value options:
"EmptyLineRule""skip"removes empty lines;"read"(default) keeps them;"error"errors when an empty line is found."WhitespaceRule""preserve"(default),"trim", or"trimleading"/"trimtrailing"."EmptyValue"Value used for empty lines when
EmptyLineRuleis"read"(default empty string)."Encoding"Passed through to
fileread.