How to take comlex number from edit text into listbox in Matlab?
1 view (last 30 days)
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
- User enters in editText : 2 + 2i -> Add
- 0.3 -> Add
i couldnt store entries in an array..
Joseph Cheng on 27 Mar 2016
Edited: Joseph Cheng on 27 Mar 2016
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'
however read a bit more about regexp as depending on how people type it in you get different answers.