用MATLAB循环结构列出50以内的质数

2025-02-26 04:24:19
推荐回答(1个)
回答1:

k=1;

for ii=1:50

if isprime(ii)==1

s(k)=ii;

k=k+1;

end

end

s