3
votes

I was trying to break a matrix into column vectors using the following command:

z = data(:, 3);

But, I keep on getting an error "Unbalanced or unexpected parenthesis or bracket"

My matrix data looks like as follows:

column1  column2    column3
'Color'  'Size'    'Length'
'blue'   'medium'   21.5
'green'  'large'    30
'gray'   'small'    31
[...]    [...]      [...] more values.

How can I split this one matrix into 3 different columns (x, y, z)?

1
What does whos data give you?Roney Michael

1 Answers

5
votes

It seems you have cell array instead matrix, because ordinary matrix can not contain data of different types.

In this case you should use curly brackets:

z=data{:,3}