Docsity

MATLAB Array Manipulation: Finding Smallest and Largest Values, Exercises of Signals and Systems Theory

Partial preview of the text

Download MATLAB Array Manipulation: Finding Smallest and Largest Values and more Exercises Signals and Systems Theory in PDF only on Docsity!

clear clc a=[2 5 7 9 4 12 5 0 -5 2]; b=sort(a); disp('Smallest value in array= ') b(1,1) disp(' ') z=length(b); disp('Greatest value in array= ') b(1,z) clear clc n=input ('enter the value of n= ') n=n*2; for x=1:2:n a(x)=1; end for x=2:2:n a(x)=0; end a

docsity.com