For the case you describe you have to add information about how X and p varies with time. Are they constant over some fixed intervalls, are they varying continuously in some manner (piece-wise linearly, like polynomial splines)?
For many cases where I have time-varying parameters obtained at fixed times I typically integrate the system of ODEs numerically and interpolate the time-varying coefficients as best I can. For this case that would be something like:
function duvwdt = yourODE(t,uvw,t4interp,X,Y,Z,p,q,r)
Xi = interp1(t4interp,X,t,'pchip');
Yi = interp1(t4interp,Y,t,'pchip');
Zi = interp1(t4interp,Z,t,'pchip');
pi = interp1(t4interp,p,t,'pchip');
qi = interp1(t4interp,q,t,'pchip');
ri = interp1(t4interp,r,t,'pchip');
This way you can integrate the ODEs with arbitrary smoothly varying coefficients - provided that the interpolation makes an OK representation of the time-variations (whatever OK means).
Then you integrate this with ode45 or any of its siblings:
[t,uvw] = ode45(@(t,uvw) yourODE(t,uvw,t4interp,X,Y,Z,p,q,r),t_span,uvw0);
Here you would have to make sure that your parameter-arrays (X,Y,Z,p,q,r) are available for the entire time-interval and that t4interp are the same for all 6 parameters, if they are at given at different "sampling-times" the modification should be trivial.
If your parameters are constant at different time-intervalls - then you will have to solve the equations intervall-for-intervall either numerically (by using the final values of the solution of the previous intervall as initial conditions for the following intervall) of analytically (for which you'll have to patch the solutions together at the intervall boundaries).