Docsity

MATLAB Function to Identify Consecutive Repeating Numbers, Exercises of Signals and Systems Theory

Partial preview of the text

Download MATLAB Function to Identify Consecutive Repeating Numbers and more Exercises Signals and Systems Theory in PDF only on Docsity!

a=[1 2 2 2 3 1] %input dsc (a) % calling function function z=dsc(a) %function definition c=2; b(1)=a(1); for(x=2:1:length(a)) if (a(x)==a(x-1)) x=x+1; else b(c)=a(x); x=x; c=c+1; end end b %output

docsity.com