Find the exact match of a string from a cell array.

1 次查看(过去 30 天)
Hi! this looks to be easy but somehow its not working for me. So here is the problem statement, I have a cell array with all the parameters name
Parameter ={name_1000ms
name2_1000ms
name3_1000msCD
name4_200ms};
now i just want to extarct name_1000ms and name2_1000ms basically when i do strcmp for 1000ms i just want it to pull all the parameter name that has exact match of 1000ms and not 1000msCD.
  1 个评论
sc1991
sc1991 2018-12-11
Hello! I just wanted to update I found a quick solution to the above problem there is a function endsWith that works really well in my case. But i am still wondering if there is any other way that we can do. For now endsWith seems to have worked perfectly for me.
Please feel free to post your responses as well.Thanks

请先登录,再进行评论。

采纳的回答

sc1991
sc1991 2018-12-11
Hello! I just wanted to update I found a quick solution to the above problem there is a function endsWith that works really well in my case. But i am still wondering if there is any other way that we can do. For now endsWith seems to have worked perfectly for me.
Please feel free to post your responses as well.Thanks

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by