I am having trouble iterating through a cell array of strings which is a constant property in a class. Every time I try to index the cell array from 1 to end, Matlab crashes. What could I be doing wrong?
Code looks like this:
classdef classA
properties(Constant)
ValidElements = {'Elem1', 'Elem2', 'Elem3'};
end
properties
AInfo
end
function this = classA(info)
1stvalidelement = classA.ValidElements{1};
validelementslist = classA.ValidElements{1:end};
...
...
this.AInfo = info;
end
...
end
Inside the constructor, 1st line executes well without any problem but at the 2nd line matlab crashes. I am totally clueless as to why this could be. Please help me.
Thanks.