- It cannot convert the character vector to a scalar number.
- The value is NaN, blank, or a complex number.
- The value is a mathematical expression, such as 1 + 2.
- The value is less than the Limits property lower limit or greater than the upper limit.
How do i take complex number inputs in matlab appdesigner?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have to take both real and complex number inputs in appdesigner. I tried using Edit FIeld (Numeric) but it wont take complex inputs. Need something to take complex or real numbersas input
0 comentarios
Respuestas (1)
Voss
el 12 de Feb. de 2022
MATLAB rejects the value if:
But you can use an EditField (not Numeric), in which case the Value will be a string or character vector, which you can convert to a number using str2double() (or str2num() if you need to allow non-scalars). For example:
str = app.my_edit_field.Value; % say str is '1+1i'
num = str2double(str); % then num is 1+1i
0 comentarios
Ver también
Categorías
Más información sobre String en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!