I cant figure out how to print a cell array in a static text box. I am trying to check three numerical values in an array. If the values are < 3 then I store the string into a cell array called warning. I want to display all the values of the cell array 'warning' into a static text box in matlab gui. I am having trouble with the last few lines. Not sure what's going on. Any help is appreciated. I am beginner level; please something I can understand.
arr=[mathtotal englishtotal sciencetotal] %three numerical values
warning={}; % storing the message that corresponds to the values.
for x=arr
if x<3.0
warning={warning 'warning your total is less than 3'};
else
warning={warning ''} % do nothing if the value is not less than 3.
end
end
% done gathering the messages. now trying to print. having trouble here.
for x=1:3
str=sprintf('%s ', warning{x}) % trying to iterate into a variable
end
set(handles.text8, 'String', str) % trying to print the warning but not working......