フィルターのクリア

Preventing repeat values in an edit text

1 回表示 (過去 30 日間)
jacques baptiste
jacques baptiste 2018 年 3 月 1 日
回答済み: ES 2018 年 3 月 1 日
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

採用された回答

ES
ES 2018 年 3 月 1 日
>> cellExcelData = {'String1'; 'String2'; 'String3'}
cellExcelData =
'String1'
'String2'
'String3'
>> ismember('String', cellExcelData)
ans =
0
>> ismember('String1\', cellExcelData)
ans =
0
>> ismember('String1', cellExcelData)
ans =
1
>>

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by