poster
2019-12-07, 07:35
目标:通过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元素断开连接,该断开连接的长度足以导致价格不存在?任何帮助,将不胜感激。感谢您的时间。
更多&回答... (https://stackoverflow.com/q/59221450)
当前产品:以下代码将通过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元素断开连接,该断开连接的长度足以导致价格不存在?任何帮助,将不胜感激。感谢您的时间。
更多&回答... (https://stackoverflow.com/q/59221450)