How to compare two elements in an array with not equal operator(~=)?

1 回表示 (過去 30 日間)
Maxter Black
Maxter Black 2018 年 10 月 7 日
編集済み: Matt J 2018 年 10 月 7 日
for i=2:1:length(R)
if(R(i)==R(i-1))
else
dif=[dif,R(i)];
end
end
dif=[R(1)];
For example if my input is: [ 3 3 3] dif =dif =
3.0000 3.0000
  2 件のコメント
madhan ravi
madhan ravi 2018 年 10 月 7 日
What’s R ?
Image Analyst
Image Analyst 2018 年 10 月 7 日
Do you mean like
if R(i) ~= R(i-1)

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by