Create a Slanted Linspace Matrix
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hugo Fortescue
le 20 Jan 2021
Réponse apportée : Stephen23
le 20 Jan 2021
Hi All, I am trying to generate noise in an image, and need a matrix of the form:
1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7
up to 1024x1024. Is there an east way to create this?
0 commentaires
Réponse acceptée
Plus de réponses (1)
Daniel Pollard
le 20 Jan 2021
If you have the signal processing toolbox, the buffer command will do exactly what you want.
If not, something like
x = linspace(xmin, xmax, numx);
matrix = zeros(numx, numx);
for ii = 1:numx
matrix(:, ii) = x + ii - 1;
end
should do the trick.
0 commentaires
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!