早教吧 育儿知识 作业答案 考试题库 百科 知识分享

MATLAB中[100,999]之间能被21整除的数的个数步骤.(rem)

题目详情
MATLAB中[100,999]之间能被21整除的数的个数步骤.(rem)
▼优质解答
答案和解析
举个例子,希望有所帮助.代码% By lyqmath
clc; clear all; close all
t = 100 : 999;
t(rem(t,21)==0)
结果
ans = Columns 1 through 12 105 126 147 168 189 210 231 252 273 294 315 336 Columns 13 through 24 357 378 399 420 441 462 483 504 525 546 567 588 Columns 25 through 36 609 630 651 672 693 714 735 756 777 798 819 840 Columns 37 through 43 861 882 903 924 945 966 987>>