How to create a row vector upto a particular distance with the help of a variable?
3 ビュー (過去 30 日間)
古いコメントを表示

taking n=4 i could add a vector of elements value 7 to a previously defined B.
but when i use second expression for n=4 , error occurs?
Anyone could help?
0 件のコメント
回答 (1 件)
Rajanya
2025 年 3 月 19 日
The error is because of a missing parentheses pair (the part in italics become separate completely leading to the error) -
B ( ( ( n - 1 ) / 3 ) + 1 ) : (2 * (n - 1) / 3 ) = 8
1 2 3 3 2 1
Adding an extra pair of parentheses '(.)' solves the error:
B( (((n-1)/3)+1):(2*(n-1)/3) )=8
Thanks.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Dynamic System Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!