You have not given enough information about what you want the resulting plot to look like.
Effectively after running the function you have an output array B which is length(x) by length(y) by length(t), and you want to plot that 3D array. Plotting a 3D array requires 4 dimensions of output -- x, y, z, and value. surf() is for 3 dimensions only, x, y, value.
You can code the additional dimension as colour, shape of a marker, size of a marker, or (as a hint rather than directly) as transparency. Or you can slice() the data or you can create isosurfaces. scatter3() can be pretty useful. Transparency can be useful for voxel rendering. Another possibility is to represent the additional dimension through time (an animation.)
I suspect that you were thinking of something similar to a waterfall plot in which an additional dimension of data is represented through a regular displacement in space. Waterfall plots themselves really only have three dimensions though, such as (x, value, time). You can use the spacial displacement technique with surf() plots, making a stack of hills; if you are thinking about that approach keep in mind the difficulty that the user would have in attempting to clearly examine the values in the "lower" stacks.
Best Answer