我正在尝试在 matlab 上绘制实时序列值,但我无法通过任何演示成功。我的嵌入式系统已经在发送由串行终端检查的数据。当我试图让它们通过 matlab 时,会出现这样的错误:
Warning: Matching failure in format.
??? In an assignment A(I) = B, the number of
elements in B and
I must be the same.
Error in ==> real_time_data_plot at 81 voltage(count) = fscanf(serialObject,'%f'); %#ok<SAGROW>
作为matlab中的一个序列,我正在使用这个文件: http: //www.mathworks.com/matlabcentral/fileexchange/25519-collect-and-plot-data-from-an-instrument-in-real-time 在嵌入式端,我只是发送固定值 100 以减少错误情况的概率
sprintf(str,"%d\n",100);
USART_puts(USART2,str);
该代码可以绘制几个样本,但稍后它会因上述错误通知而崩溃。你有什么建议吗?谢谢