how to initialize population as matrix

3 vues (au cours des 30 derniers jours)
Kalpana  Dalwai
Kalpana Dalwai le 14 Juin 2017
Commenté : Kalpana Dalwai le 1 Juil 2017
In image i treated pixels as population..how can i initialize image pixels as population in matrix..

Réponses (1)

Image Analyst
Image Analyst le 19 Juin 2017
Use ones(). For example to set up a matrix where every value is 10, do this
populationImage = 10 * ones(rows, columns);
If you want random values instead, use
populationImage = 10 * rand(rows, columns); % Range = 0 to 10.

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by