MATLAB Answers

nadia naji

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

Asked by nadia naji
on 31 Oct 2012
Accepted Answer by Matt J

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




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.


  1 Comment

thanks alot

Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!