isDone

End-of-file status for signal reader object

Description

example

isDone(src) returns a logical value indicating whether or not the SignalSource object, src, has reached the end of the imported signal. If the SignalEndAction property of src is set to Cyclic repetition, this method returns true every time the reader reaches the end.

Examples

collapse all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject() becomes step(myObject).

Create a signal source to output one sample at a time.

src1 = dsp.SignalSource;
src1.Signal = randn(1024,1);
y1 = zeros(1024,1);
idx = 1;
while(~isDone(src1))
    y1(idx) = src1();
    idx = idx + 1;
end

Create a signal source to output vectors.

src2 = dsp.SignalSource(randn(1024,1),128);
y2 = src2(); % y2 is a 128-by-1 frame of samples

Input Arguments

collapse all

Signal reader object, specified as a dsp.SignalSource System object.

See Also

Objects

Introduced in R2012b