LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

matlab and labview

Hello,

I have Labview 7.0, further more I have matlab install as it is required. 
I would like to know if I am missing anything to be able to run an .m script from matlab in Labview.
I followed the instructions as per NI guided lines and was able to import the m file into a matlab node.
 Labview crashes when I hit the run button.
Then I decided to strip the comments and just leave it bare bones and that works.

The following doesn't work:

%script file: tempconver
%
%Purpose: to convert an input temperature from F to K.
%
%
%temp_f --temp in degrees Farenheit
%temp_k --temp in Kelvins
%Prompt the user for the input temp.
temp_f = input ('enter the temp in degrees Farenheit: ');

%convert to kelvins
temp_k = (5/9)* (temp_f - 32) + 273.15;

%write out the result.
fprintf ('%6.2f degrees Fahrenheit = %6.2f kelvins. \n', temp_f, temp_k);


The following works:

temp_f;
temp_k = (5/9)* (temp_f - 32) + 273.15;

Am I missing something?  what am I doing wrong?

Thanks






0 Kudos
Message 1 of 2
(8,971 Views)

Hi,

This forum is dedicated solely to Mathscripts. Since your question is related to Matlab Script Node, please post it on the LabVIEW discussion forum so that the LabVIEW champions or other LabVIEW community may address your question.

As a side note, I tested your program and it appears that the problem is not due to the commented lines of code but due to the input command.

Regards,

Ankita

0 Kudos
Message 2 of 2
(8,954 Views)