NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
ILuvPenguins
Posts: 1
0 Kudos

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

Active Participant
ttrr
Posts: 225
0 Kudos

回复: Some problems using some Matlab functions

[ Edited ]

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.

 

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page