Hi,,
I have a String array that contains Names, I want to allow the user to choose a Name to change either by writing the name as a string OR by writing it's index as a number..
So I wrote this code, but it seems faulty.. Can anyone help with this..
Thanks in advance:
clear all clcNums=[1:5]%NumsStr=num2str(Nums)
for i=1:5 s=input('s= ','s') s=strtrim(s); S{i}=(s); clcendSfor i=1:5 tst=input('edit what ','s') try res=strmatch(tst,S,'exact') if((length(res)~=0) && (length(res)<2)) S{res(1)}=input('TEXT_MODE, New String =','s') else %NumRes=strmatch(tst,num2str(Nums))
NumRes=find(Nums==tst) if((length(NumRes)~=0) && (length(NumRes)<2)) S{NumRes(1)}=input('NUMBER_MODE, New String = ','s') end end catch ME end end
Best Answer