how to write matlab code
2 ビュー (過去 30 日間)
古いコメントを表示
thatamon chantrasungnern
2019 年 4 月 3 日
コメント済み: Image Analyst
2021 年 7 月 18 日
I need to write matlab code to display number 20-50 except number that divisibility by 4 and 5 .How can i do it
2 件のコメント
Image Analyst
2021 年 7 月 18 日
Do you want to print out, using fprintf()
- numbers that are not divisible by either 4 or 5
- numbers that are not divisible by 4 and also not divisible by 5?
Those are different things. Or do you mean that the numbers you print out must be divisible by 4 and/or 5. That is yet a different thing.
採用された回答
Andreas Bernatzky
2019 年 4 月 3 日
%I need to write matlab code to display number 20-50 except number that divisibility by 4 and 5 .How can i do it
numbers=[];
for(a=20:1:50)
num=a;
numCheck4=mod(a,4);%check if there is a rest by division with 4
numCheck5=mod(a,5);%check if there is a rest by division with 5
if(numCheck4~=0&&numCheck5~=0)
numbers(end+1)=a;%pushback
end
end
0 件のコメント
その他の回答 (2 件)
Basher Alnour
2021 年 7 月 18 日
Q1
numer = [2 -9/4 0.5];
d = conv([1 -0.5],[1 -1]);
deno = conv(d,[1 -0.25]);
[R P K] = residue(numer,deno)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!