MATLAB for 循环,怎么让它只输出最后一次?
fprintf('抽样次数');n=input('n=');x1=normrnd(0,1,1,n);x2=normrnd(0,1,1,n);x3=normrnd(0,1,...
fprintf ('抽样次数');
n = input ('n=');
x1 = normrnd (0,1,1,n);
x2 = normrnd (0,1,1,n);
x3 = normrnd (0,1,1,n);
m=0
for i=1:1:n
if x3(i)>x1(i).^2 + x2(i)
m=m+1
end
end
print m 展开
n = input ('n=');
x1 = normrnd (0,1,1,n);
x2 = normrnd (0,1,1,n);
x3 = normrnd (0,1,1,n);
m=0
for i=1:1:n
if x3(i)>x1(i).^2 + x2(i)
m=m+1
end
end
print m 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询