In a GUI, How do I accept user input and turn string into a function? ex. 3*x^2 +2*x -5
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ernesto Juarez
el 4 de Dic. de 2016
Respondida: Walter Roberson
el 4 de Dic. de 2016
% --- Executes on button press in Graph.
function Graph_Callback(hObject, eventdata, handles)
syms x y;
userInput = get(handles.user1,'String');
fun = @(x) userInput;
x=0:10;
y = fun(x);
axes(handles.axes1);
plot(x,y);
xlabel('x'); ylabel('y');
guidata(hObject,handles);
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB 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!