MATLAB: Run a function into a function

function into a functionMATLAB

Hi I have a function "a" called "function x=problem1(a,b,c,d)" I would like to create a function "b" that call function "a" and asign values to (a,b,c,d). Also, the function "b" have to run at least 6 times just with one call.

Best Answer

  • No, I'm talking about a function to run replace_me 5 times with diferents inputs. Like this:
    % code
    function problemb
    1 try
    v=[1 2 3 4];
    a=2
    b=8
    c=6
    end
    2 try
    v=[5 6 7 8];
    a=6
    c=2
    end
    3 try
    v=[1 2 6 9];
    a=2
    b=8
    c=6
    end
    In my example, I already define the inputs for each run, so, I just put both .m files together and run the problem one time to have 5 different solutions at once.