Hi,
I have two codes. One with a base function code and another one which calls that function with a set of values for its inputs. Now 4 out of 5 parameters will have fixed values and the 5th parameter "wr" will be from 0 to 1 inclusive. Our code is able to generate a column vector for wr but not for the associated values of U. Using a For Loop in the calling script, I was able to output the values for U in the command window but I want them to be stored as an Nx2 matrix with column 1 giving values for wr and column 2 giving values for U. I have not shared the For Loop code here.
Base function:
<Start>
function Assignment = Function(Rf,Erp,Sigp,RAF,wr)Rf >= 0;Erp > Rf;Sigp > 0;RAF >= 1;(wr>=0) && (wr<=1);U = Rf + (Erp-Rf)*wr - RAF*(wr^2)*(Sigp^2)/2;Assignment = U;
<End>
Function which calls the above function:
<Start>
Rf = 0.02;Erp = 0.06;Sigp = 0.2;RAF = 1.5;wr = [0:0.1:1]';try Assignment = Function(Rf,Erp,Sigp,RAF,wr);end
<End>
Best Answer