filename={'EX1','EX2','FX1','FX2','PR1','PR2',... 'RU1','RU2','SP1','SP2','UL1','UL2'};for i=1:12genvarname(filename{i})) =importdata([filename{i},'.mat']);end
MATLAB: Hi, i have cell that consisting string value.i want to use every cell element as variable name. for example filename{1}= [1 2 3] then i have EX1=[1 2 3] in work space. i wrote this code but it doesn’t work.
cell arraysvariable namevariables
Best Answer