How to create a row vector upto a particular distance with the help of a variable?
조회 수: 1 (최근 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!