Continuous plot while plotting inside a loop in MATLAB -


i trying plot variables dynamically in matlab. have array (set of states) needs plotted time. tried plot(time,theta), theta 1*5 array. command, error saying theta should scalar because time scalar. tried using for-loop plot(time,theta(i)). problem data points @ discrete time intervals on plot. need continuous plot. wonder how can done.

you need use hold on when plotting.

for example:

time = 1; theta = [1:100]; figure  i=1:100      plot(time, theta(i),'r.')     hold on  %--> keeps previous data in plot     time = time + 1;  end 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -