You can estimate the embedding dimension of your data using the phaseSpaceReconstruction command and use that value for the dimension argument of the correlationDimension command. You can code something like this:
[~, lag, dim] = phaseSpaceReconstruction(xdata);
cd = correlationDimension(xdata, lag, dim)
You can also experiment with the phaseSpaceReconstruction command by providing your own dimension (and lag, if you want) and look at the resulting plot to make sure that the dimension you provided makes sense. For example, you can try:
phaseSpaceReconstruction(xdata, lag, dim);
Once you are satisfied with the lag and dim values, then use them in the correlationDimension command.
Note that the length of your data vector, xdata, is NOT the dimension in question here. It is typically the dimension of the state-space of the system that generated the data. Think of it this way: you can have data of length Np from solving a second-order differential equation. Then, the dimension in question here is more like "2" rather than Np.
Hope this helps,