function tf = trans_function(theta); % %****************************************************************** % This function performs the transformation from % theta in [0, pi] to z in [L_END;R_END] using the transformation % % z= .5*((R_END-L_END)*cos(theta)+L_END+R_END); % % and returns the value f(z), where f is a user specified function. % % Input % % theta value in interval [0, pi] % % Global Variables % % f Function name. Must be a string variable f='name'. % The user must construct an m-file that takes a scaler as % input and gives the scaler value of the function as output. % The name of the function must be assigned to the string % variable f. % L_END, R_END The interval [L_END,R_END] is the domain of the function f % % Output % % tf = f(z) %************************************************************************ % % Declare global variables global L_END global R_END global f % First executable statement % %************************************************ % Your code goes here: % % Transform from theta to z % % Evaluate f(z) %************************************************ return % %***End of function