Consider the following table:
mytable =
2x3 table
Var1 Var2 c
_____ _____ _______________
true true {1000x1 double}
false true {1000x1 double}
c is a cell array.
How can I create a variable based off, for example, the first element of the c vector for each row? Specifically, if c was a vector of 1000x1 vector of ones in row 1 of mytable, I would want to make a variable v with scalar value 1 in row 1 of mytable, and if c was a vector of zeroes in row 2 of mytable, I would want to make v have scalar value 0 in row 2 of mytable.
I have been trying something along the lines of mytable.v = mytable.c(:, 1) to no avail. I'm not sure of the proper way to index the cell array within the table.
Also, are cell arrays the recommended datatype for this sort of task (storing vectors/matrices in a table)? For context, c is the output of a function, and I will need to pass it to other functions using rowfun. I would rather not store each of the 1000 elements of c in a separate variable, if possible.
Thanks in advance.