Borrar filtros
Borrar filtros

Preventing repeat values in an edit text

1 visualización (últimos 30 días)
jacques baptiste
jacques baptiste el 1 de Mzo. de 2018
Respondida: ES el 1 de Mzo. de 2018
Hello,
I did a GUI without GUIDE. Basically the GUI is a form, so people can fill it and implement a structure without scripting experience. One of the fields filled must be unique (no duplicates, e.g: serial number/ID is unique), and i want to test if the new ID entered in the edit text is available (ID are stored in excel).
I tried to read excel file, then use "ismember" function but i had issues with ismember and I'm not even sure that is the best solution. I would like some advises about the way to proceed or an example of how people do it usually.
English isn't my first language, so if something isn't clear feel free to tell me ! :)
I put Matlab error :
Error using cell/ismember (line 34)
Input A of class char and input B of class cell must be cell arrays of strings, unless one is a string.
Thanks for reading me, best regards,
Baptiste

Respuesta aceptada

ES
ES el 1 de Mzo. de 2018
>> cellExcelData = {'String1'; 'String2'; 'String3'}
cellExcelData =
'String1'
'String2'
'String3'
>> ismember('String', cellExcelData)
ans =
0
>> ismember('String1\', cellExcelData)
ans =
0
>> ismember('String1', cellExcelData)
ans =
1
>>

Más respuestas (0)

Categorías

Más información sobre String Parsing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by