what does the x(10:15) mean?
Show older comments
Hello everyone,
I am reading a code developed by someone else and don't understand what does the x(10:15).'*x(4:9).
I know that you can solve a set of variables by using a function and going like this: x(1) x(2) etc.
Here's the section of the code: y_hat = x(10:15).'*x(4:9);
How do you call that notation? x(10:15) so I can look it up and read about it in forums.
Thanks!
Accepted Answer
More Answers (1)
madhan ravi
on 31 Oct 2018
Edited: madhan ravi
on 31 Oct 2018
x(10:15)
it means elements from 10 to 15 are picked from vector x
see example:
>> x=1:15
x =
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 15
14 15
>> x(11:15)
ans =
11 12 13 14 15
>>
1 Comment
madhan ravi
on 31 Oct 2018
Edited: madhan ravi
on 31 Oct 2018
How do you call that notation?
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!