I have fitted some data where I have excluded the first point and now would like to plot it. I'm using the command
exclude = 1; handle = plot(fit,'b',time,data,'+k',exclude,'xr');
From that I get the error
Subscript indices must either be real positive integers or logicals. Error in cfit/plot (line 229) xpoints(outliers),ypoints(outliers),S3,... Error in calcFRETDecayDelta_broken (line 558) handle = plot(fit,'b',time,data,'+k',exclude,'xr');
Setting
exclude = 2;
or
exclude = [1 2];
or typecasting the 1 to a boolean works just fine. I'm reading the exclude vector from a textfile and would like to keep it in the index format there.
So I have now made a workaround by making the index exclude a boolean, which is also accepted by plot:
ex = zeros(max(exclude),1); ex(exclude) = 1; exclude = boolean(ex);
The question however is, why does plot not accept a simple 1 for exclusion? This is unnecessary cumbersome.
Best Answer