フィルターのクリア

NEED HELP, I am trying to take data from txt file and save as an array to plot later

2 ビュー (過去 30 日間)
Dominic Roybal
Dominic Roybal 2021 年 2 月 14 日
編集済み: Walter Roberson 2021 年 2 月 18 日
Hello, please see the attached picture of my text file. I am trying to make arrays for poition and time. I want to use these arrays to plot them time, position. I need the position and time in two different arrays. That is all I need I am not sure what to do. I have tried multiple ways to get the data but having a hard time.
Under_Damped_Test1_15cm
Is the name of the file. Any help would be apreciated.
  3 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 14 日
Please attach the actual text file, not screenshot
Walter Roberson
Walter Roberson 2021 年 2 月 14 日
It looks like tab delimited text that readtable() could handle.
It might be necessary to detectImportOptions and adjust the datetime import format for the first variable.

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

回答 (1 件)

Ani Singh
Ani Singh 2021 年 2 月 18 日
編集済み: Walter Roberson 2021 年 2 月 18 日
Using below command you will data into array in MATLAB:
t = readtable('C:\somewhere\somefile.ext', 'ReadVariableNames', false, 'DatetimeType','text');
that's it. However, you'd then give the column some meaningful names, e.g.:
t.Properties.VariableNames = {'var1', 'var2'};
Then you can modify data accroding to your need.

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by