LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Input data type of Matlab script node

Hi,

 

I have 1D array of complex number in single precision.

Matlab script node is used to import data into Matlab and do some data processing, and then export.

Data type of input is currently double precision.

How to re-define this input data type of the Matlab script node?

 

Thanks,

 

0 Kudos
Message 1 of 5
(4,243 Views)

changshin,

 

you can change the data type of the input like this: 

matlab.png

However, the node does not support arrays of single precision numbers. Instead, to eliminate coersion, you'll have to convert your input array of singles into a double array by using "To Double Precision Float" VI (Numeric > Conversion).

Misha
0 Kudos
Message 2 of 5
(4,242 Views)

That's what I have in my code at this point.

 

Since the size of the data is large, which cause large memory usage, I want to import the data in single precision.

 

From you reply, it seems that Matlab Script node does not support single precision complex. Is it right?

 

Another question regarding memory.

 

This VI, which transfer data to the Matlab Script node, and receive processed data back.

Now when we look at the profile of the memory, this VI uses large memory.

My question is that the memory usage shown on the profile for this VI includes the memory usage of the Matlab. Is this right?

 

Thanks,

 

0 Kudos
Message 3 of 5
(4,236 Views)

Right, arrays of singles are not supported. See Comparison of MathScript RT Module and the MATLAB® Software Data Types in LabVIEW

 

As for memory usage, Profiling the VI should let you know how much memory Labview uses when running your code. Communication with MATLAB® is done through ActiveX, and I'm actually not 100% sure whether it will reflect memory usage from script execution. I think it'll be simple enough to profile your VI with and without the MATLAB Script node and note the memory usage difference...


Misha
0 Kudos
Message 4 of 5
(4,217 Views)

OK.

 

Thankyou.

0 Kudos
Message 5 of 5
(4,198 Views)