How to take comlex number from edit text into listbox in Matlab?
조회 수: 1 (최근 30일)
이전 댓글 표시
i want to take the double number from the editText into an array(when user pressed Add button) displaying in listbox, then do some calculations
For ex:
- User enters in editText : 2 + 2i -> Add
- 0.3 -> Add
i couldnt store entries in an array..
댓글 수: 0
답변 (1개)
Joseph Cheng
2016년 3월 27일
편집: Joseph Cheng
2016년 3월 27일
Take a look at the function regexp() http://www.mathworks.com/help/matlab/ref/regexp.html and with the input like the example below you get both the real and complex return
txt = '1+2i'
regexp(txt,'\w*i*\w*','match')
however read a bit more about regexp as depending on how people type it in you get different answers.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Data Preparation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!