向matlab编程大佬求助!!!
clc;clear;
i=0;
a=[34 34 34 34 34 34 34 34 34 34 46 46 46 46 85 85 85 128 128 128 142 142 142 142 142 142 142 142 142 142 142 142 142 142 142 142 142 142 142 194 194 194 194 194 215 350];
S=0;
while (i<=10)
rand=randperm(length(a));
index=rand(1:4);
b=a(index)
a(index)=[];
i=i+1;
M=abs(mean(b)/5-19);
S=S+M;
end
D=S+abs(mean(a)/5)-19
就这个程序,怎么求D的最小值?