LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

xlim ylim zlim in mathscript

Solved!
Go to solution
Hi,
 
Im not great at matlab, however i have been given a script with the following functions in it.
 
xlim([0 100]);
ylim([0 200]);
 
The script was written in Matlab and i intend to run it under mathscript.  However the functions do not seem to be recognised in the mathscript window.  Is there an alternative way of achieving these functions?  From what i understand the functions set scale limits on the x and y axis respectively.
 
Thanks in advance
 
Craig
LabVIEW 2012
0 Kudos
Message 1 of 4
(7,006 Views)

Hi Also i have another problem, although i get the feeling i am doing something silly.

 

If i have the following line in a mathscript node it works fine

Results = csvread('C:\results.csv')

However i created a string input on the mathscript node and called it FileIn.  I then placed a Path control box on the front panel and used the Path to string converter and wired this to the mathscript node.  Then replacing the above mathscript line with the following

Results = csvread('FileIn')

I double checked the string going into the node with a probe and it is correct.

Any thoughts? i know i am probably just missing something silly like not initialising the Variable FileIn or something.  Any help would be appreciated.

Thanks in advance

Craig

LabVIEW 2012
0 Kudos
Message 2 of 4
(7,005 Views)
Solution
Accepted by topic author craigc
Hello Craig,

The XLim, YLim, and ZLim functions are not currently supported in LabVIEW MathScript.  However, we have added new functionality in LabVIEW 8.5 so you can still achieve the desired result by simply setting the XLim or YLim attribute of the current plot (the ZLim attribute is still unsupported).  To do this, issue the following commands:
ca = gca;       % Get the current plot area
set(ca, 'XLim', [0 100]);
set(ca, 'YLim', [0 200]);


For your second question, the variable FileIn should be initialized correctly if you have wired it.  The problem is that you typed single quotes around FileIn.  Single quotes are used to denote a string literal (this is why you need them in your first example).  Since you are now using a variable, you don't need the single quotes.  Simply type
Results = csvread(FileIn);

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
Message 3 of 4
(6,997 Views)

Thanks Grant,

By removing the single quotes i managed to read in the .csv file fine thankyou.  I have commented out the xlim functions and everything is rosy!

Craig

LabVIEW 2012
0 Kudos
Message 4 of 4
(6,990 Views)