MATLAB Answers

Cell of character arrays

1 view (last 30 days)
How to create a cell of character array of size 10*1 with first 5 rows containing 'cat' and next 5, 'dog'?
An example of this type of cell array can be found in MATLAB when 'fisheriris.mat' is located.
I am trying to create a cell similar to that of 'species' variable.
Please help me

  0 Comments

Sign in to comment.

Accepted Answer

Vladimir Sovkov
Vladimir Sovkov on 8 Dec 2019
S=cell(10,1);
S(1:5)={'cat'};
S(6:10)={'dog'};

  1 Comment

Pooja Patil
Pooja Patil on 8 Dec 2019
Thank you very much for the response. It is really helpful.

Sign in to comment.

More Answers (0)

Sign in to answer this question.