convert strings of multiple numbers into matrices
Mostrar comentarios más antiguos
Hello,
I am trying to convert the output log of a software into a ready-to-use matrix.
The output of the software is a txt file that contains a serie of strings like this one:
[[-0.4888 -0.4661 -0.7374 54.5679]
[-0.4835 0.8483 -0.2157 25.8953]
[ 0.7262 0.2511 -0.64 58.3138]
[ 0. 0. 0. 1. ]]
I am trying to read in these strings and extract the numbers in order to obtain the following format AKA a normal matlab matrix double precison :
[-0.4888 -0.4661 -0.7374 54.5679;
-0.4835 0.8483 -0.2157 25.8953;
0.7262 0.2511 -0.64 58.3138;
0 0 0 1 ];
I have been able to read in the txt file but I do not understand how to extract all numbers and put it in a normal matrix.
Thanks for your help!
Giacomo
2 comentarios
KSSV
el 6 de Sept. de 2021
How are you reading the txt file?
Giacomo Bertazzoli
el 6 de Sept. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!