Vectorization

조회 수: 4 (최근 30일)
Aravin
Aravin 2012년 4월 15일
Dear Community,
Let say I have Matrix M. In Matrix M, each Column is feature of Image. Now what I want to get a binary matrix B by following way.
for given image feature i:
B(1,i) = M(1,i) >= M(2,i);
its mean for each image feature, each cell is compared to its next cell. I want to do it without loops for speed.
  댓글 수: 1
Oleg Komarov
Oleg Komarov 2012년 4월 15일
"Without loops for speed" is really not the right statement anymore.
Many times loops are much faster is correctly set up.

댓글을 달려면 로그인하십시오.

채택된 답변

Oleg Komarov
Oleg Komarov 2012년 4월 15일

추가 답변 (1개)

Jan
Jan 2012년 4월 15일
B = (M(1:end-1, :) >= M(2:end, :));
  댓글 수: 2
Jan
Jan 2012년 4월 15일
It is worth to investigate the similarities and differences to Oleg's (faster) solution.
Aravin
Aravin 2012년 4월 18일
Jan, Oleg worked on my small examples. I could find any dissimilarity. If you have in your mind then please share.
Thanks for your help too.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by