Why is this while loop not working? Prime number from list
이전 댓글 표시
clear;
close all
clc;
N = 10;
list=2:N;
values = [2];
list(find(mod(list,2)==0))=[];
tester = 3;
while list ~= []
list(find(mod(list,tester)==0))=[];
tester = list(1);
values = values + [, tester];
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Profile and Improve Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!