How do you sample a continuous-time signal in Matlab?
sampleRate = 100; samplePeriod = 1/sampleRate; signalFreq = 10; Now you want 2 seconds of this, so define your sampled time vector. nT = 0:samplePeriod:2; Now we create the signal, and plot the result.
How do you create a sampling rate in Matlab?
The sampling frequency or sampling rate, fs, is the average number of samples obtained in one second (samples per second), thus fs = 1/T. To sample a signal in MATLAB, generate a time vector at the appropiate rate, and use this to generate the signal. Plot using the stem function.