MATLAB: How to concatenate two string vectors 5×1 and 1×18 to get a 5×18 text matrix

loopsstring

the vectors include Currencies =["ARS","BRL","CLP","COP","CZK","HUF","IDR","MXN","MYR","PEN","PHP","PLN","RON","RUB","ZAR","THB","TRY"] the 1×18 vector and Criteria = ["TR";"YC";"SPR";"SS"] the 5×18 vector, goal is to concatenate so that cell (1,1) of the 5×18 matrix equals "ARSTR", cell (2,2) = "BRLYC" etc.

Best Answer

Currencies = {'ARS','BRL','CLP','COP','CZK'}; % et cetera
Criteria = {'TR';'YC';'SPR';'SS'};
result = cellfun(@(x,y) [x,y], repmat(Currencies,numel(Criteria),1),
repmat(Criteria,1,numel(Currencies)),'UniformOutput',false);