フィルターのクリア

how to solve this code ??

2 ビュー (過去 30 日間)
yasmeen hadadd
yasmeen hadadd 2016 年 9 月 26 日
コメント済み: yasmeen hadadd 2016 年 9 月 26 日
Hello;
how i can change this code to get the specific output
clc;clear all;
for i=1:10;
a=i+5;
end
the final value of a =15 , i need a =[ 6 7 8 9 10 11 12 13 14 15];
thanks

採用された回答

Walter Roberson
Walter Roberson 2016 年 9 月 26 日
You are overwriting all of a each iteration of the loop. You need to instead only assign to one particular vector element:
a(i) = i + 5;
  1 件のコメント
yasmeen hadadd
yasmeen hadadd 2016 年 9 月 26 日
thanks alot

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by