# Matlab question: Returning a value in the middle of a function

• Dec 31st 2011, 10:16 PM
asi123
Matlab question: Returning a value in the middle of a function
Hey guys.

I have the following statement

a = func(b,c,d,e);

this function runs for 100 ml sec for example, I want to return a value each 20 ml sec, I mean to update the variable a each 20 ml sec without interrupting the function.

Is that possible?

Thanks a lot.

Assaf.
• Dec 31st 2011, 10:43 PM
CaptainBlack
Re: Matlab question: Returning a value in the middle of a function
Quote:

Originally Posted by asi123
Hey guys.

I have the following statement

a = func(b,c,d,e);

this function runs for 100 ml sec for example, I want to return a value each 20 ml sec, I mean to update the variable a each 20 ml sec without interrupting the function.

Is that possible?

Thanks a lot.

Assaf.

You will need to be more specific, and set the function up to do this.

CB
• Dec 31st 2011, 10:49 PM
asi123
Re: Matlab question: Returning a value in the middle of a function
Hey.

The problem is that I don't control the statement

a = func(b,c,d,e);

I can only control func. Is there a command in matlab which can return a value from a function without interrupting it?

Thank you very much.

Assaf.
• Jan 1st 2012, 12:13 AM
CaptainBlack
Re: Matlab question: Returning a value in the middle of a function
Quote:

Originally Posted by asi123
Hey.

The problem is that I don't control the statement

a = func(b,c,d,e);

I can only control func. Is there a command in matlab which can return a value from a function without interrupting it?

Thank you very much.

Assaf.

As I said before be more specific. What is the function, and what do you want returned?

CB
• Jan 1st 2012, 09:25 PM
asi123
Re: Matlab question: Returning a value in the middle of a function
I found a solution.

I use the function assignin.

Thank you very much.

Assaf.