필터 지우기
필터 지우기

How to Run an m.file from GUIDE push button?

조회 수: 2 (최근 30일)
Kai Hao Then
Kai Hao Then 2011년 3월 24일
편집: g z 2015년 8월 19일
I am using GUIDE to build my GUI. I need a push button to run an m.file which consists of my neural network. Please advise what should I put in the CreateFcn column if I want to run my m.file by pressing the push button. Thanks.

채택된 답변

Matt Fig
Matt Fig 2011년 3월 24일
Leave the CreateFcn alone for this task. Put the call to the M-file in the callback for the pushbutton. The callback is the function that is called when the button is pushed. For example, if the name of your M-file is myfile.m, then put this line in the callback for the pushbutton:
myfile;
Now if you need to pass argments to myfile, or get a return value, then we will have to add to this basic syntax.
  댓글 수: 3
Matt Fig
Matt Fig 2011년 5월 31일
Is myfile a function or script? Which workspace? Every function has its own workspace, and then there is the base workspace (command window). Do you mean the base workspace? What do you mean load the variables? Load them where? Perhaps you need to start your own question?? Please describe the problem more thoroughly, step-by-step what you want to happen!
preeti
preeti 2015년 2월 28일
thanks:)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

g z
g z 2015년 8월 19일
hello all . i do this work . but i want to get an array from a "Edit text" and use it in a for-end , but when i want to covert it to a numeric array , i failure . can i have a for-loop in GUI ? how ?
  댓글 수: 1
g z
g z 2015년 8월 19일
편집: g z 2015년 8월 19일
i found it :D
  1. one :just enter some number with out any thing in Edit Box
  2. two :then use :
  • x=get(handles.edit1,'String')
  • x=str2num(x);
  • have good time :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by