필터 지우기
필터 지우기

How can I convert a text file (.txt) to trace (.trc)?

조회 수: 45 (최근 30일)
JuanCa
JuanCa 2015년 8월 17일
댓글: MADRobot 2020년 7월 15일
I have a CAN bus recording saved as a text file. I need to get it into .trc format. Is there a tool in Matlab/SIMULINK to do this?
  댓글 수: 3
Eduardo Souza
Eduardo Souza 2018년 4월 6일
Hey i have the oposite problem. I have TRC file and want to put it in TXT so i can manipulate it as a Table in MatLab. I am using PEAK-System CAN interface.
MADRobot
MADRobot 2020년 7월 15일
Hey, I'm years too late with this, but in case anyone wants to convert A TRC file so it can be read in Matlab, you can download and use the function readtrc() here: https://uk.mathworks.com/matlabcentral/fileexchange/48919-readtrc-read-r-s-trc-files-into-a-matlab-cell-array
Here's an example of how I did it:
filepath = 'C:\Users\UserName\OSim\4.1\Models\Simbody\subject01_walk1.trc'; %Define the path to the file
opensimTable = TimeSeriesTableVec3(filepath); % Use the Vec3 TimeSeriesTable to read the Vec3 type data file.
% Use the OpenSim Utility function, osimTable2Struct to convert the OpenSim table into a Matlab Struct for ease of use.
matlabStruct_markerData = osimTableToStruct(opensimTable);
opensimTable
Hope this helps

댓글을 달려면 로그인하십시오.

채택된 답변

JuanCa
JuanCa 2018년 4월 6일
I ended up using Python for this process. Just formatted the file and save it as TRC. I assume you can do the same for your file

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by