From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Some problems using some Matlab functions

Hello,

 

I have some trouble with MathScript when i want to use some MATLAB functions in it such as unique or histc. (i'm using windows 7 and LV2010 SP1)

 

These functions are theoretically supported by MathScript insofar as they exist in MathScript Documentation but they return an error. This error explains that my matrix sizes are invalid but when we are doing exactly the same process with the same matrix in MATLAB, it ends well.

 

So I checked the two MATLAB and MathScript documentations in order to see if there is a difference between the same functions. It is proving to be the same functionning in MathScript and in MATLAB so I am a little lost.

 

In order to show you a concrete example :

If we have a X matrix equals to (77 77; 88 96) and we are doing unique(X). The result is supposed to be (77 88 96) but mathscript returns an error.

On the other hand, if X is not a matrix but a vector, unique ends well but i'm not interested in using some vectors (because it is exactly the same kind of problem with some others functions using only matrix).

 

I could use a matlab node script but in this project, we would to avoid the use of a Matlab Licence.

 

Do you have some idea in order to fix this kind of problem

 

Thanks a lot

0 Kudos
Message 1 of 2
(5,605 Views)

Hi,

 

Currently, the unique(X) in MathScript can accept vector input only. It reports error when X is a matrix. As a workaround, you can use

 

unique(X(:))

instead.

 

0 Kudos
Message 2 of 2
(5,591 Views)