Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
back and call function

Subject: back and call function

From: wahyoe Unggul

Date: 2 Apr, 2011 21:39:04

Message: 1 of 2

hi all
can you help me
I have some functions,
function 1 (main menu)
function 2. (calculations 1)
function 3. (calculations 2)
function 4. (output calculations )

I give the four functions as below which serves as a control program
function 4
comb_next=input('back to main menu, press 2, back to calculation, press 1, exit program, press 3')
if comb_next==1
    load function2.m %load function main menu
elseif comb_next==2
    load function1.m %load function 2
elseif comb_next==3
     close all %lExit Programe
end
   

Subject: back and call function

From: Steven_Lord

Date: 4 Apr, 2011 02:00:50

Message: 2 of 2



"wahyoe Unggul" <wahyoe_slipnot@yahoo.co.id> wrote in message
news:in851o$rpu$1@fred.mathworks.com...
> hi all
> can you help me
> I have some functions, function 1 (main menu)
> function 2. (calculations 1)
> function 3. (calculations 2)
> function 4. (output calculations )
>
> I give the four functions as below which serves as a control program
> function 4
> comb_next=input('back to main menu, press 2, back to calculation, press 1,
> exit program, press 3')
> if comb_next==1
> load function2.m %load function main menu

If you want to just call a function, just use its name.

function2

> elseif comb_next==2
> load function1.m %load function 2
> elseif comb_next==3
> close all %lExit Programe
> end

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us