I am trying to write my own sort function.. it gave me an error idk how to fix.
for j = 1:length(x) for i = 1:length(x)-1 if x(i) < x(i+1) minval = x(i); val = x(i); x(i) = []; end end sortval(j) = val;endfprintf(sortval);
Best Answer