asked 199k views
1 vote
After creating the following vector, t, which of the following syntaxes will result in an error? Select all that apply. t=[

10


15


20


25


30


35

];
t([
1


4:5


6

])
t([
1


6


4

])
t([
1


.5


4

])
t(10)=13
t(2:4)
t(
2


3


4

)

To extract elements of a vector, the indexing vector must be a vector of indices. An index is a positive integer that is less than or equal to the length of the vector. You can call the indices in any order. While you cannot access the tenth element of t because it doesn't exist, you can assign a value to it. If you assign a vector element that doesn't already exist to a value, the vector is filled with zeros.
t(10)=13
[
10


15


20


25


30


35


0


0


0


13

]


asked
User Sabya
by
8.5k points

1 Answer

0 votes

Answer:

The syntax that will result in an error is t([1 .5 4]). The indexing vector must be a vector of integers, not a vector of decimals.

answered
User Ariel Gemilang
by
7.8k points