MATLAB: Define a collection of variables

MATLAB

Suppose I have a table
date visitor city dummy_for_January dummy_for_February dummy_for_March
----------------------------------------------------------------------------------------------------------
I want to define a collection of such dummy variables so that I do not need to write them one by one each time. Please advise.

Best Answer

Since you already have the data in table form, you can just do things like,
mdl=fitlm(T(:,["Albania","Afghanistan","sales"]))