convert strings of multiple numbers into matrices
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!