MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Matlab使用Excel RTD记录和绘图 (https://www.labfans.com/bbs/showthread.php?t=22492)

poster 2019-12-07 07:35

Matlab使用Excel RTD记录和绘图
 
目标:通过rtd将数据从excel导入到matlab,记录数据,绘制数据,直到手动停止为止。

当前产品:以下代码将通过rtd从excel导入,从price变量保存为matp,从datetime('now')保存为matt,并且将绘制标记数据,但仅限随机间隔。有时它将运行50次循环迭代,有时运行5000次,而我遇到了错误:

未定义的函数或变量“价格”。

PROTOTYPE1_5(第9行)中的错误matp(end + 1,:)= [price]';

figure hold on wl=0; matp=[price]; matt=[ctime]; while wl>=0 ctime=datetime('now'); matp(end+1,:)=[price]'; matt(end+1,:)=[ctime]'; wl=wl+1; x=ctime; y=price; a=plot(matt(end),matp(end),'o-'); drawnow; pause(0.15) end 我不知道为什么这是一个未定义的变量。我假设暂时与excel rtd元素断开连接,该断开连接的长度足以导致价格不存在?任何帮助,将不胜感激。感谢您的时间。



[url=https://stackoverflow.com/q/59221450]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 16:47

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.