Results 1 to 5 of 5

Math Help - Matlab question: Returning a value in the middle of a function

  1. #1
    Member
    Joined
    May 2008
    Posts
    171

    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.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

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

    Quote Originally Posted by asi123 View Post
    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
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    May 2008
    Posts
    171

    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.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

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

    Quote Originally Posted by asi123 View Post
    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
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Member
    Joined
    May 2008
    Posts
    171

    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.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. plot of a function of time a matlab question
    Posted in the Math Software Forum
    Replies: 7
    Last Post: December 12th 2011, 12:12 PM
  2. middle school logic question
    Posted in the Math Puzzles Forum
    Replies: 3
    Last Post: September 1st 2010, 02:55 AM
  3. Replies: 1
    Last Post: June 25th 2010, 08:57 PM
  4. A prime returning function?
    Posted in the Number Theory Forum
    Replies: 4
    Last Post: June 9th 2010, 08:23 AM
  5. Matlab not returning variable as intended
    Posted in the Math Software Forum
    Replies: 7
    Last Post: April 18th 2010, 03:35 PM

Search Tags


/mathhelpforum @mathhelpforum