about function rats and how to output to .txt

2 visualizaciones (últimos 30 días)
han han
han han el 11 de Nov. de 2019
Editada: Adam Danz el 11 de Nov. de 2019
In Figure 1, I want to express the number of numbers in my file (test1.txt) plus pi
擷取.JPG
For example: -1.17809724509617 convert to -3/8*pi
The problem I am having now is that I have a large space after using rats.
Causes me to output to txt when there is a comma in front like Figure 2
72714257_2227369354035516_2028957041850056704_n.jpg
what should I do?

Respuesta aceptada

Adam Danz
Adam Danz el 11 de Nov. de 2019
a1 = strtrim(rats(a/pi));
Use strtrim() to remove leading and trailing white space.
  2 comentarios
han han
han han el 11 de Nov. de 2019
Thank you so much!
Adam Danz
Adam Danz el 11 de Nov. de 2019
Editada: Adam Danz el 11 de Nov. de 2019
Glad I could help.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by