How to read specific columns of a Txt file and store them in an array?

10 Ansichten (letzte 30 Tage)
I need to calcilate from coloum 4, initial data : row 1 coloum 4........... the from initial data i need to subtrct others data from coloum . then save the data . For better understnding. i have upload two photo. Please help me to solve this problem.

Akzeptierte Antwort

Star Strider
Star Strider am 12 Mär. 2021
Try this:
T1 = readtable('Data.txt','HeaderLines',1);
T1.Properties.VariableNames = {'t', 'vd', 'zd', 'mdro'};
T1.mdro = T1.mdro-T1.mdro(1);
and:
FirstFiveRows = T1(1:5,:)
produces:
FirstFiveRows =
t vd zd mdro
_____ _______ __________ ________
0 -10 0.00012 0
1e-07 -9.9908 0.000119 -3.7e-11
2e-07 -9.9704 0.000118 -5.4e-11
3e-07 -9.9576 0.00011701 -6.6e-11
4e-07 -9.924 0.00011601 -7.4e-11
.
  4 Kommentare

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by