Matlab写一个小程序
发布网友
发布时间:2022-05-06 12:48
我来回答
共1个回答
热心网友
时间:2022-06-30 14:46
%%
clc;
clear;
m = linspace(1,100,100)
flag = 0;
res = 0;
for i = 3:length(m)
for j = 2:i-1
if mod(m(i),j) == 0
flag = 1;
break;
else
flag = 0;
end
end
if flag == 0
r = [res,m(i)];
res = r;
end
end
r(2:length(r))