フィルターのクリア

hi every one , i need help to do this in matlab if it's possibile, thank you

2 ビュー (過去 30 日間)
mina massoud
mina massoud 2019 年 7 月 8 日
コメント済み: mina massoud 2019 年 7 月 8 日
A=[ 1 2 3 4 5 6 7 8 9 10 ]
B=[ 10 11 12 13 14 15 16 17 18 19 20]
C=[ 21 22 23 24 25 26 27 28 29 30]
for n=1:10
if n==1 & 6<=n<=9 % if n is uquale to this value i need to make this operation
X=A+B
if n==2 & 3<=n<=5 % if n is uquale to this value i need to make this operation
X=A+B+C
else % else in need to make this
X=B+C
end
end
tnak you
  2 件のコメント
Stephen23
Stephen23 2019 年 7 月 8 日
編集済み: Stephen23 2019 年 7 月 8 日
Disregarding the MATLAB syntax bug, when do you expect these logical conditions to be true?:
n==1 & 6<=n<=9
n==2 & 3<=n<=5
Can you give any value of n for which this will be true? Fixing the syntax bug gives:
n==1 & 6<=n & n<=9
n==2 & 3<=n & n<=5
but still no value of n that will ever produce a true output. Did you really mean to use OR ?:
n==1 | (6<=n & n<=9)
n==2 | (3<=n & n<=5)
mina massoud
mina massoud 2019 年 7 月 8 日
thank you very much , i accept ur wonderful answre now.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by