using MATLAB only
using the code below, complete the question
% Input the number of elements to be sorted num=input (‘Enter the number of numbers to be sorted: % Create an array arr= [ ] ; % Input numbers to the array for i-1:num % Input the numbers arr (i)-input (‘Enter the number ‘ end % For each pass for j-1:1:num-1 $Compare adjacent elements for i-1:1: num-1 % If adjacent elements in wrong order if arr(i) arr (i+1) % Swap the elements tem-arr (i) arr (i)-arr (i+1); arr ( i +1) =ten; end end end % Output the array fprintf (‘The elements in ascending order given below:n’) disp (arr)