Вопрос

I have quite a big array of strings that's in the format ['name1';name2';...], where names don't have the same size.

I know I have to use cells in MATLAB, but I can't figure out how to use it in this case.

The best I came up with was this, but it doesn't work.

names = cell(1,n);
names(1:n) = ['name1';'name2';...;'namen'];
Это было полезно?

Решение

The cell array concatenation operator is {};

names = {'name1';'name2';...;'namen'};
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top