I have two tasks to do in Matlab related with a pseudo-random number generator. 1. Generate a sawtooth wave, but I can not use a matlab sawtooth function. 2. Generate a sequence of real numbers using a recursive formula.
I've done a first task, and I think this is good:
size = 1000;
z = 3; %number of teeth
x = 0:1/size:1;
f = mod (x*z,1);
plot(x,f)
grid
But I don't know how to do the second task. Could anyone help me?
Aucun commentaire:
Enregistrer un commentaire