Azzera filtri
Azzera filtri

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

3 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Star Strider
Star Strider il 12 Mar 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 Commenti

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Tables in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by