How to process this text file containing multiple coordinates in Matlab

6 ビュー (過去 30 日間)
Sara K Takiguchi
Sara K Takiguchi 2023 年 4 月 20 日
コメント済み: Walter Roberson 2023 年 4 月 20 日
Linked above is the kaggle dataset of parkinson's coordinates I need to preprocess in order to put into DNN. I am speciically looking at the Drinking_all_export.txt text file but I could not attatch it because it is too large. Is there a way I can read this text file in matla and seperate the x coordinates and y coordinates into seperate arrays? Also is there a way to seperate it by each catergory(head position,Larm, Rarm, etc.). When I use importdata it puts all of the numbers into one array and doesn't seem to be the correct number either.

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 4 月 20 日
It looks to me as if you would use jsondecode and get back a struct()
  2 件のコメント
Sara K Takiguchi
Sara K Takiguchi 2023 年 4 月 20 日
when I use that code: value=jsondecode('Drinking_all_export.txt');
I get this error code:
Error using jsondecode
JSON syntax error at line 1, column 1 (character 1):
expected value but found 'Drinking'.
Error in textconversion (line 3)
value=jsondecode('Drinking_all_export.txt');
Walter Roberson
Walter Roberson 2023 年 4 月 20 日
S = fileread('Drinking_all_export.txt');
value = jsondecode(S);

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeJSON Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by