import ods or xls to matlab and refresh data

5 visualizaciones (últimos 30 días)
javi diciembre dosmidieciocho
javi diciembre dosmidieciocho el 25 de Dic. de 2018
Respondida: Akshat el 24 de Nov. de 2024 a las 18:15
Hi
How can I import data from and ods or xls to matlab and refresh data every 3 seconds?

Respuestas (1)

Akshat
Akshat el 24 de Nov. de 2024 a las 18:15
You can run an infinite loop which pauses every three seconds and reads the data from an XLS file.
You can modify the following code to suit your use case the best:
fileName = 'data.xlsx'; % or 'data.ods'
sheetName = 'Sheet1';
while true
try
data = readtable(fileName, 'Sheet', sheetName);
disp(data);
catch ME
disp(['Error reading file: ', ME.message]);
end
pause(3);
end
Feel free to ask any follow-ups, hope this helps!

Categorías

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

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by