TRIMWS-TrimleadingwhitespacefromastringNEWSTR=TRIMWS(STR)Trimsleadingspacesfromastring.
Thereisprobablynoreasonforthisfunctiontoexist,astheMatlabfunctionSTRTRIMseemstoperformitsfunction.Thisfunctionisprovidedforbackwardcompatibility.IrecommendsimplyusingSTRTRIMratherthanthisfunction,asitwillprobablyberemovedinafuturerelease.
TheonlydifferencebetweenSTRTRIMandTRIMWSisthatTRIMWSonlyoperatesonleadingspaces,whereasSTRTRIMremovestrailingwhitespaceandalsooperatesonanywhitespacecharacterasdefinedbythefunctionISSPACE.
Example:
m=trimws(' this string has leading whitespace')Seealso:STRTRIM,ISSPACE