Heey ! Guys I need jıust some code examples. I looked whole site but I did not find any helpful things about that situation.
GUI function from Edit
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello matlab people community
I am so new to use matlab. I try to take some function respect to x, from edit1 which is name of the component, then I push a button , function of plot will see on the axes? I need a code how to call the function from the edit?
I write the codes here
function pushbutton1_Callback(hObject, eventdata, handles)
axes(handles.axes1);
x=0:0.1:10;
handles.a = get(handles.edit1,'String');
plot(x,a);
Thanks!!!
3 comentarios
Jan
el 13 de Mzo. de 2013
The question is not clear. Therefore bumping is a waste of time only.
What does this mean: "Try to take some function repsect to x"? What is "x" and "some function"? What does "function of plot will see on the axes"? What is the contents of the string obtained from the edit field?
Respuesta aceptada
engineerOfPhysics
el 13 de Mzo. de 2013
6 comentarios
Image Analyst
el 19 de Mzo. de 2013
Just FYI: generally you don't post an "Answer" to your own question when it's really a comment, and you don't accept _you_r Answer unless you were really the person who came up with the solution (instead of Allessandro).
Más respuestas (2)
Alessandro
el 13 de Mzo. de 2013
Editada: Alessandro
el 13 de Mzo. de 2013
you got there a string maybe you should first convert it to an array ! Try this simple solution:
handles.a = get(handles.edit1,'String');
tmpa = str2num(handles.a)
plot(x,tmpa);
2 comentarios
engineerOfPhysics
el 13 de Mzo. de 2013
Editada: engineerOfPhysics
el 13 de Mzo. de 2013
0 comentarios
Ver también
Categorías
Más información sobre Whos 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!