How to read only numerical values of serial output data in MATLAB?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Sohail Ahmed
el 6 de Nov. de 2021
Comentada: Walter Roberson
el 10 de Nov. de 2021
I just want to read the integer values (number) in the output text file (serial data)...... I need some assistance.....
0 comentarios
Respuesta aceptada
Walter Roberson
el 8 de Nov. de 2021
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/791754/Log_file.txt';
data = readmatrix(filename, 'Range', 'C:C')
0 comentarios
Más respuestas (2)
Yongjian Feng
el 6 de Nov. de 2021
Your data file looks like a configuration file with key/value pair separated by ':'. One way to parse the data is to do this for each row:
rowStr = 'ADC0/F1 : 1562';
tokens = split(rowStr, ':');
intValue = str2double(strtrim(tokens(2)));
1 comentario
Ver también
Categorías
Más información sobre Text Files 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!