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 "make specific values in specific regions"

Status
Not open for further replies.

intoptics

Newbie level 2
Joined
Jul 7, 2008
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,293
Hi dear all,

my function values is like this:
a(1) for x<0,a(2) for 0<x<l(1),a(3) for l(1)<x<l(2),..,a(n) for x>l(n-2),
that these 2 are known:
a=[a1 a2 .. an] and l=[l1 l2 .. l(n-2)] l(n-2) just means this matrix have 2 values less than a.
for less values of a & l, I put them directly in function like this:
for example a=[1 2 3 4] and l=[2 3]
p=@(x) a(1)*(x<0)+(a(2))*(x>0)+(a(3)-a(2))*(x>l(1))+(a(4)-a(3))*(x>(l(1)+l(2)));

now I wanna use this type function in loop with more values in a and l matrices.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top