How to do this? need help
1 回表示 (過去 30 日間)
古いコメントを表示
% Use a for-loop to check if each integer from 1 to 100 is a prime, % square or divisible by 6.
% Collect the integers that meet the above conditions to the % correspondent arrays Prime, Square or FactorOf6.
% Create count variables pCount, sCount and fCount which are updated % each time you find a new Prime, Square or FactorOf6 element and use % these counters to add new elements to your arrays.
% Print Prime, Square & FactorOf6 after your for- loop is finished.
1 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!