help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octave realtime plot


From: Gabriel Soo
Subject: Octave realtime plot
Date: Fri, 14 Oct 2016 11:26:20 +0800

And how to plot a realtime graph? The signal i read from my arduino is : 
1111.PNG


Then i use this coding in my octave to read and plot the graph:

srl_flush(s);       %Flush the pending input/output.
y_temp = cell(10,1)
y = 0
while true
  for i = 1:10
    y_serial = str2num(char(srl_read(s,5)))  %Convert the string (or character array) s to a number (or an array).
    y_temp {i,1} = y_serial
  endfor
  y = cat(1, y, y_temp{1:10})
  plot(y)
  pause(1)
endwhile
srl_close(s)



The result:
2222.PNG
Why there is a single digit data there????

Attachment: 1111.PNG
Description: PNG image

Attachment: 2222.PNG
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]