
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

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