how to initialize population as matrix

조회 수: 2 (최근 30일)
Kalpana  Dalwai
Kalpana Dalwai 2017년 6월 14일
댓글: Kalpana Dalwai 2017년 7월 1일
In image i treated pixels as population..how can i initialize image pixels as population in matrix..

답변 (1개)

Image Analyst
Image Analyst 2017년 6월 19일
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.

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by