GUI function from Edit
이전 댓글 표시
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
engineerOfPhysics
2013년 3월 13일
Jan
2013년 3월 13일
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?
engineerOfPhysics
2013년 3월 13일
채택된 답변
추가 답변 (2개)
Alessandro
2013년 3월 13일
편집: Alessandro
2013년 3월 13일
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);
engineerOfPhysics
2013년 3월 13일
편집: engineerOfPhysics
2013년 3월 13일
0 개 추천
카테고리
도움말 센터 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!