Reputation: 16978
having trouble with the following code which I thought would work:
OriginalSamples = {'BeforeWeDepart','ImSoGlad','NotToday', 'WellNowYouKnow'};
numOriginalSamples = length(OriginalSamples);
for i=1:numOriginalSamples
disp(OriginalSamples(i));
end
Error I get is:
Error using ==> vertcat
CAT arguments dimensions are not consistent.
How to do this simple operation?
Thanks.
Upvotes: 0
Views: 67
Reputation: 1835
Try to change disp(OriginalSamples(i))
to disp(OriginalSamples{i})
Indexing with ()
returns a cell array, while indexing with {}
return the content of the cell
Upvotes: 2