How to get an expression from a textbox in GUI?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi!
I'm working on a program in GUI which purpose is to solve non-linear equations. My idea is a simple interface with 4 buttons, axes and a text field where the user can write mathematical expressions (like @(x) 4-4*x^2-exp(x) ), hit a button with a predefined solver, and the program solves the eqation. (A have the functions for the solver already and it works) I know I should use the get() function to get the expression from the text field, but it cannot run, because there is an error somewhere. I tried to change the fromat of expression with str2sym() function but it didn't work. My idea is the following for the push button:
syms x
f=str2sym(get(handles.edit1,'string'))
myfunction(f)
Thank you for your answers!
0 comentarios
Respuestas (1)
Shadaab Siddiqie
el 27 de Abr. de 2021
Editada: Shadaab Siddiqie
el 27 de Abr. de 2021
0 comentarios
Ver también
Categorías
Más información sobre Loops and Conditional Statements 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!