Hi everyone,
I have a cell:
mycell ={'text','-1','0','','textnumber01234','3123','0.111'}
I'm trying using if condition for showing a error window with each value of each cell element except two last elements ('3123','0.111'). These string elements which are converted to number by str2double have values greater than 0.
mycell={'text','-1','0','','text-with-number01234','3123','0.111'}for ii=1:length(mycell) if strcmp(mycell(ii),'') || str2num(mycell(ii))<=0 || isempty(mycell(ii)) % --- FIGURE -------------------------------------
figure1= figure( ... 'Tag', 'figure1', ... 'Units', 'pixels', ... 'Position', [515 655 310 90], ... 'Name', 'Wrong format data', ... 'MenuBar', 'none', ... 'NumberTitle', 'off', ... 'Color', [0.941 0.941 0.941]); % --- STATIC TEXTS -------------------------------------
uicontrol( ... 'Parent', figure1, ... 'Tag', 'text1', ... 'Style', 'text', ... 'Units', 'pixels', ... 'Position', [25 17 250 50], ... 'FontSize', 10, ... 'String', {'Please enter right format data'}, ... 'HorizontalAlignment', 'left'); return endend
My code doesn't work properly.
Could someone help me?
Thanks.
Best Answer