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 query, calculating threshold- need matlab code

Status
Not open for further replies.

rushida_k

Newbie level 3
Joined
Jan 27, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,298
Matlab query

Hi
I am calculating threshold
in that i got 1*250 matrix
now i have calculate the magnitude differance in between two adjacent column
if this differance is less than a certain value then do previous column as zero otherwise these values keep as it is

please send me its matlab code
Thankx in advance
Rushida
 

Matlab query

Hi friend

I think this is work

th=1.5; %threshold
data=randint(250,1,10);

for k=1:1:20

if k~=250

if data(k+1)-data(k)<th

data(k)=0;
else
data(k)=data(k);
end
data(k)'
end
end


enjoy

Added after 11 minutes:

you can modify it if there is an error
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top