Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Star Strider
Star Strider el 12 de Mzo. de 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 comentarios

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by