Is this meaningful? What do you want to happen, when 2 persons modify the same line of code? Even if different lines are modified, the code has no consistent state anymore. But if you want a mutual exclusive access,github might be sufficient already.
Well, MATLAB does havesource control integration , so you could use it with Git for example. Otherwise you could just use any file sharing service, although that is prone to conflicted copies.
I don't think there is a good reason to want to type in the same file at the same time, but you could do it with something like Google Docs of course. In general it is better to split the project up or collaborate through discussion.