how can i put the value of find function output to other matrix?

조회 수: 1 (최근 30일)
nadia naji
nadia naji 2012년 10월 31일
i have an image that has many zero value i want to find non zero value and then put them in other matrix first i use find function and then save the row and column of this pixels now i should put this pixels into matrix with size(row)*1 i dont want to use for loop can you help me? % [row col]=find(y); % for i=1:size(row,1) % t(i,1)=y(row(i),col(i)); % end

채택된 답변

Matt J
Matt J 2012년 10월 31일
Just call FIND with 3 outputs instead of 2.
[row,col,t]=find(y)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by