String Function MATLAB help

What is a MATLAB function you could use to find the number of characters in a string by using a single function call without displaying the string?

Respuestas (1)

Walter Roberson
Walter Roberson el 23 de Mzo. de 2019

0 votos

2 comentarios

Laura Blydenburgh
Laura Blydenburgh el 23 de Mzo. de 2019
Thank you, unfortunately this only finds the number of characters in a string while using a string. Example from MATLAB:
str = "Hello World"
L = strlength(str)
L = 12
Is there a way to find the length of the string without displaying the string?
Walter Roberson
Walter Roberson el 23 de Mzo. de 2019
That has nothing to do with string length. You simply need to add semi-colon to the end of the lines.
str = "Hello World"; %semi-colon tells MATLAB not to display result
L = strlength(str) %no semi-colon so that MATLAB will display result

Iniciar sesión para comentar.

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de Mzo. de 2019

Comentada:

el 23 de Mzo. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by