Here is a basic example of how to make NT and matlab communicate. It just passes the data to matlab and computes an SMA then passes the data back to ninja.
Note that this is only one way to make NT communicate with matlab, there are a number of other ways some of which are slightly easier than this but they require the NE toolbox (matlab .net compiler addon) which many people may not have.
Here I am using an open source .NET wrapper over the matlab COM API. The wrapper can be found at codeplex but the source of it is also included here.
I would suggest you open the MatlabBridge project in visual studio first and make sure its sample app runs ok. If not then there is some problem with your matlab install that you need to fix first, check your windows path to make sure matlab directory is there. Otherwise look at Mathworks help section.
Before using the indicator you must also copy the MatlabBridge dll into your ninjatrader directory and add it to the Ninja dll references.
Also note that the MatlabBridge.dll that is included here is 32bit since I am using it with NT 6.5, if you are using NT7 64bit then you would need to recompile the MatlabBridge as a 64bit dll (although note that I have not tested it in that configuration)
AND LAST BUT NOT LEAST.. BE AWARE that NT is very fickle when it comes to exceptions. If it recieves an exception from Matlab, NT will crash because they have really poor exception handling. For that reason I have disabled the MatlabBridge library from throwing exceptions, however it is still possible to get unhandled exceptions if you do something crazy in matlab. So be careful, and do not experiment with this when you have an important trade open or are running a strategy or whatever.. I recommend testing it in a virtual machine if at all possible.