I cannot get fscanf to work with my Arduino when plotting a graph in real-time. I've read the docs and cannot see where I am going wrong.
I have 4 Arduino Serial.println statements. 3 of which are strings which I don't need. The 4th is an integer which is what I want to plot in real-time.
Here is my code:
ard = serial('/dev/tty.usbserial-A601EQJ5', 'BaudRate', 9600);
i = 1;
N = 50;
x = zeros(0, N);
while i <= N
x(i) = fscanf(ard, '%*s %d');
axis([1, N, 0, 150])
i = i + 1;
I keep getting the error that I have written in my title no matter what I change.