You can use a trick to make it a single input function: use a vector.
f = @(x,t)cos(x)*exp(t^2);
B=fminbnd(@(b)f(b(1),b(2)),[0;1],[0;1]);
I use this trick often with fminsearch if I want to fit a function, but don't know if the end user has the curve fitting toolbox:
%needed input: x and yx
% Objective function (Exponential)
y = @(b,x) b(1)*exp(b(2)*x);
% Ordinary Least Squares cost function
OLS = @(b) sum((y(b,x) - yx).^2);
opts = optimset('MaxFunEvals',50000, 'MaxIter',10000);
% Use 'fminsearch' to minimise the 'OLS' function
fit_output = fminsearch(OLS, intial_b_vals, opts);
