How do i create a matrix of size 1 row and 1501 column, with values [1 -1 1 -1 1 -1.... etc
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
(countinuously 1 then -1 repeating.
thanks Dan
0 Commenti
Risposte (3)
Wayne King
il 1 Mag 2012
One way:
x = ones(1,1501);
x(2:2:end) = -1*x(2:2:end);
Another way
y = repmat([1 -1],1,751);
y(end) = [];
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!