I encounter the same problems, and I believe at the moment the only solution is the simplest I can think of (and use ... :-)) reshape to 2D before passing to matlab script, reshape in matlab back to 3D, and take care of dimension order ....
goodluck
Wiebe