I have written a matlab function ;now as I simulate it the following error occurs
h(n) = (str.(n));
??? Attempt to reference field of non-structure array.; I could not figure it out . Can any one help ?
function control(varargin)
str = {
'violet';
'indigo';
'blue';
'green';
'yellow';
'orange';
'red';
};
N = length(str);
h = zeros(N,1);
for n =1:N
h(n) = str.(n);
end
What is the problem with statement h(n)? I want to store str elements in h(n). I also want to pass values to vibgyor from another function. How do I call it from other function?