import ods or xls to matlab and refresh data

조회 수: 9 (최근 30일)
javi diciembre dosmidieciocho
javi diciembre dosmidieciocho 2018년 12월 25일
답변: Akshat 2024년 11월 24일
Hi
How can I import data from and ods or xls to matlab and refresh data every 3 seconds?

답변 (1개)

Akshat
Akshat 2024년 11월 24일
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!

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by