convert strings of multiple numbers into matrices
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!