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.

[SOLVED] Double condition in a matrix

Status
Not open for further replies.

tombraided

Newbie level 2
Joined
Jan 22, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
London
Activity points
1,295
Hi there,

I would like to impose two condition on a matrix

1. if the value is less than -1, then the value of respective element will be zero
2. if the value is greater than 1, then the value of respective element will be zero

I need to do it by one command (I don't want to use for loop since it would make the program slow)

Thanks in advance. :)

---------- Post added at 22:06 ---------- Previous post was at 21:50 ----------

I have got the solution. :D
Condition can be imposed by using '&'

If 'a' is a matrix containing random numbers. Then the command should be

a>=-1 & a<=1

Thank you for your interest. :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top