Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab questions about finding zero elements of an array

Status
Not open for further replies.

bababui

Junior Member level 3
Joined
Apr 12, 2009
Messages
26
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,283
Location
USA
Activity points
1,474
I have an array say x=[1;2;3;4;5;0;5;3;0;1;2;3] and I need to find a comand or some way to find elements of array x that are = 0 and know their position within array x.
Can anyone think of a way to do this?
So something that given x=[1;2;3;4;5;0;5;3;0;1;2;3] would output y=[6,9] where 6,9, are positions of 0 value in array x

Something that I thought would be a simple problem got me stuck in my project

Please let me know if you have any suggestions.

Thanks
 

Just found a solution. So I'm answering my own question if anyone is interested:

index = find(A==0);
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top