Each cell of v contains a numeric vector. So your indexing here:
uses the wrtong type of brackets for indexing (curly braces are used to access the elements of a container array, e.g. the elements of a cell array, table, or string). The correct brackets for accessing the elements of a numeric array are parentheses, as shown here:
end
v =
{1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double} {1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double} {1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double} {1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double} {1×6 double} {1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double} {1×6 double} {1×6 double} {1×6 double}
v =
{1×6 double} {1×6 double} {1×6 double} {1×6 double} {1×6 double}
I strongly recommend preallocating v before the loop.
Best Answer