I am looking for the recommended solution for this piece of code. The Matlab documentation says to use char instead of str2mat, but there is no example. Here, paramDisplay is an array of parameter names of varying length, are used as tick marks in a figure.
ticklabels=char(paramDisplay(1)); for paramNum=2:size(paramDisplay,2) ticklabels= str2mat(ticklabels, char(paramDisplay(paramNum))); end set(gca,'XTick',1:1:size(paramDisplay,2),'XTickLabel',ticklabels);
Best Answer