11-26-2006 12:22 PM
11-27-2006 12:16 PM
Hi Chen56,
The CHANNELS variable should just be an array of integers (check out "help aiwf"), so ai2 would just be 2. For example:
DEVICE = 'Dev1';
CHANNELS = [0, 1];
RATE = 1000;
SAMPLES = 2000;
DATA = aiwf(DEVICE, CHANNELS, RATE, SAMPLES);
This would sample off of ai0 and ai1. As far as looking at your variables graphically, you will want to sample at the same rate and number of samples if you want it to look exactly the same. Also, you may need to plot DATA. You can do this many different ways, the simplest being something along these lines:
A = DATA(1,1:1000);
B = DATA(2,1:1000);
X = 1:1000;
plot (X, B, 'b', X, A, 'r');
There are several other ways as well.
Hope this helps, let us know if there is anything else we can help with.
Andrew S.
National Instruments