MATLAB Answers

How to gte a whole column from a cell

1 view (last 30 days)
Ga Ma
Ga Ma on 3 Apr 2020
Commented: Ga Ma on 4 Apr 2020
Now, i have a table looks like this, how can i get the 4th column? Like [Asia; Europe;Europe;Africa;Australia;and so on]
In addition, i still want to write some codes to identify them. For example, i want to know if it is 'Asia' or 'Europe' or not, i want to get a 245x1 matrix and the elements
should be logical number 1 or 0, but i don't know how to do that, please help me! Thanks.

  2 Comments

madhan ravi
madhan ravi on 3 Apr 2020
Your lease rephrase your first question.
Ga Ma
Ga Ma on 3 Apr 2020
Hello, what I mean is that i want to get the fourth column as a 245x1 cell, like 【Asia;Europe;Europe;Africa;Australia;...】, is it clear?

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 3 Apr 2020
Wanted1 = fieldarray(:,4);
Wanted2 = ismember(fieldarray,{'Asia','Europe');

  1 Comment

Ga Ma
Ga Ma on 4 Apr 2020
It works, thank you very much!

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags


Translated by