Borrar filtros
Borrar filtros

How to extract data in text file

2 visualizaciones (últimos 30 días)
chengwei zhang
chengwei zhang el 22 de En. de 2020
Comentada: chengwei zhang el 22 de En. de 2020
Hi guys
I am trying to extract the data inside the text file and i am using:
data=readtable('GeT.txt','Format','%s%s')
which shows me that there are 3 variables but in the file i only see 2. what is wrong with this? Pls help me out
Thx in advance

Respuesta aceptada

Bhaskar R
Bhaskar R el 22 de En. de 2020
Editada: Bhaskar R el 22 de En. de 2020
No need of specifying format(%s) there, MATLAB takes automatically respective data type
data = readtable('Ge single crystal transmission.txt'); % there is empty column(3rd)
data.Var3 = []; % remove 3rd variable because its empty
If you want data as numberic array
data = readmatrix('Ge single crystal transmission.txt'); % numeric array and empty column(3rd)
data(:,3) = []; %remove 3rd column because its nan values(empties)
  1 comentario
chengwei zhang
chengwei zhang el 22 de En. de 2020
rly rly big thx bud :). problem solved

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by