Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

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

Asked by nadia naji on 31 Oct 2012

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

0 Comments

nadia naji

Tags

Products

No products are associated with this question.

1 Answer

Answer by Matt J on 31 Oct 2012
Accepted answer

Just call FIND with 3 outputs instead of 2.

[row,col,t]=find(y)

1 Comment

nadia naji on 31 Oct 2012

thanks alot

Matt J

Contact us