0
我有串S1和S2比較不同尺寸
s1={'1' '631' '618' '574' '678'}
s2={'1' '596' '674' '' '';'674' '631' '1' '631' '1';'641' '617' '674' '631' '654';'674' '673' '674' '673' '674';'674' '618' '1' '618' '631';'631' '1' '631' '674' '740';'739' '740' '733' '674' '631';'674' '673' '674' '1' '641';'618' '1' '631' '618' '631';'674' '631' '618' '631' '618';'674' '631' '1' '631' '625';'641' '642' '618' '631' '618';'618' '631' '1' '631' '1'}
我想比較S1的字符串和其子
{'1'}
{'1' '631'}
{'1' '631' '618'}
{'1' '631' '618' '574'}
{'1' '631' '618' '574' '678'}
{'631'}
{'631' '618'}
{'631' '618' '574'}
{'631' '618' '574' '678'}
{'618'}
{'618' '574'}
{'618' '574' '678'}
{'574'}
{'574' '678'}
{'678'}
與S2:我用的strcmp(S1,S2),但我沒有獲得預期的結果。你可以幫我嗎?
對於'str2double'你不需要包裝在'cellfun'和'cellmat'。只要做'str2double(s2)',因爲它可以接受一個字符串的單元數組。 – Suever
@Suever ohhh很好,沒有看到那個 – GameOfThrows