not enough input argument on while (arduino to matlab)

Hello,

I have some problem to understand the error message. It's actually code on matlab, but it has relation with arduino.
Here is my code:

function matlab_arduino(nm) %function decleration 
close all;
clc;
y=zeros(1,1000);
delete(instrfind({'Port'},{'COM41'}));
ps= arduino('COM41'); %connect to the arduino
warning('off','MATLAB:serial:fscanf:unsuccessfulRead');
cm=1;
grid on;
hold on;
while (cm<=nm)
ylim([0 5]);
xlim([cm-20 cm+5]);
y(cm)=ps.analogRead(0)* 0.48828125; %read the analog signal from arduino 
plot(cm,y(cm),'X-r'); %plot the wave of the analog signal
drawnow
cm=cm+1; 
end
delete(ps);
clear all;
end

I have problem on while(cm<=nm)

If there's any input for this, please kindly share it with me , thank you

It's actually code on matlab, but it has relation with arduino.

Sorry, but I don't see why you are posting this in the Arduino forum and not a Matlab forum. You may be lucky and get help here from someone who happens to know their way round Matlab but on a Matlab forum you will surely get an answer.