I have to write this down twice?
古いコメントを表示
X(i1:i2) = X(i1:i2) - const;
Do I have to use X(i1:i2) twice in the line to achieve the result above?
回答 (2 件)
Image Analyst
2015 年 10 月 18 日
0 投票
Yes, that's correct.
Would you expect some other way to add a constant to just some of the elements in the vector? If so, what?
Walter Roberson
2015 年 10 月 18 日
idx = i1:i2;
X(idx) = X(idx) - const;
カテゴリ
ヘルプ センター および File Exchange で Vehicle Dynamics Blockset についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!