フィルターのクリア

For this given code, what would the variable var equal?

1 回表示 (過去 30 日間)
Kristopher
Kristopher 2014 年 6 月 21 日
回答済み: Image Analyst 2014 年 6 月 21 日
What value does var have given the code fragment?
for index = 1:2:7
if index <= 4
var(index) = index;
elseif index == 5
var(index) = 2;
else
var(index+1) = 1;
end
end

採用された回答

Image Analyst
Image Analyst 2014 年 6 月 21 日
Why not simply run it and find out?????
Just add var on a line by itself after the code you have and you'll see the value of var spit out to the command window. You'll see it says this:
var =
1 0 3 0 2 0 0 1

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by