Hi Shreesha,
GregMo is correct. The Matlab script node uses the copy of Matlab installed on the machine, but when running in LabVIEW RT, the Real-Time target does not have that application installed.
Compiling the code into a dll will work as long as is doesn't have dependence on other functions that require Matlab or Windows.
Here's a
link to a knowledgebase that will be helpful.
http://digital.ni.com/public.nsf/websearch/0BF52E6FAC0BF9C286256EDB00015230?OpenDocument
Regards,
Vineet A
Applications Engineer
National Instruments