Cody

# Problem 838. Check if number exists in vector

Solution 1249176

Submitted on 10 Aug 2017 by Martijn
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
a = 1; b = [1,2]; y_correct = 1; assert(isequal(existsInVector(a,b),y_correct))

2   Pass
a = 12; b = [1,3,4,5,6,7,8,1,2]; y_correct = 0; assert(isequal(existsInVector(a,b),y_correct))

3   Pass
a = -1; b = [1,2]; y_correct = 0; assert(isequal(existsInVector(a,b),y_correct))

### Community Treasure Hunt

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

Start Hunting!
{"ft_lang_label":"__label__en","ft_lang_prob":0.57160854,"math_prob":0.98473996,"size":683,"snap":"2020-45-2020-50","text_gpt3_token_len":223,"char_repetition_ratio":0.13696612,"word_repetition_ratio":0.03846154,"special_character_ratio":0.3396779,"punctuation_ratio":0.19078948,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98380095,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-12-01T09:34:59Z\",\"WARC-Record-ID\":\"<urn:uuid:36e809c0-c48b-4a59-bdb4-4fd301109ce7>\",\"Content-Length\":\"78783\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:2d4468e7-c897-4f16-8583-adaabbe673bd>\",\"WARC-Concurrent-To\":\"<urn:uuid:19b2f802-9164-4794-a22a-d7a73fb744a0>\",\"WARC-IP-Address\":\"23.223.252.57\",\"WARC-Target-URI\":\"https://uk.mathworks.com/matlabcentral/cody/problems/838-check-if-number-exists-in-vector/solutions/1249176\",\"WARC-Payload-Digest\":\"sha1:FMV3GUW2DKDQUUYRGIHRTJ7I5U3YYEHB\",\"WARC-Block-Digest\":\"sha1:NJ57WGFQ272NOFE4WNUQO3HFRO6JDUEL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141672314.55_warc_CC-MAIN-20201201074047-20201201104047-00551.warc.gz\"}"}