Hi folks, i'm implementing a software on appDesigner and i want to prevent wrong entries from users.
I've tried to use the folowing code but it's not working. My gol would be, check if the user entered with a number or character. If it's a number then OK, otherwise open a warning dialog box informing the error and then stop the program.
The way i've writed it's not working.
Sbase_gerador = str2double(strrep((app.potencia.Value),',','.'));% Read entry data and convert comma to '.' if needed
teste_potencia = isnumeric(Sbase_gerador) if teste_potencia==0 opts= struct('WindowStyle','modal','Interpreter','tex'); tensao_incorreta_t2 = warndlg('\fontsize{11}Caracteres diferentes de números não são aceitos.',... 'Entrada incorreta de dados', opts); app.potencia.Value='0'; end
Best Answer