set(handles.edit1,'string',[get(handles.edit1,'string'),'*'])
属性:passwordchar='*'就可以了
你直接获取字符串的长度,有多少个字符,输出多少个字符,应该就行吧