LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Outputting of of a Matlab Script

Solved!
Go to solution

Hello everybody

I am working on a project for school and had a question as far as outputting out of a Matlab Script node. I have data that is stored in the form T(:,:,i) so it is a 3D data that is calculated within the the script. 

 

The main thing I am wanting to do is output the data so I can graph it on a Labview front panel. I want to display a 2d image with a third dimension respresented as points on that 2d image. (2d as space with 3rd dimension being temperature).

 

It may not make sense why I am doing this in Labview but I have an entire GUI built for Labview and this is just one snippet of the things that I want to show. I included a file for the particular graphs I am trying to ultimately display. 

 

I apologize I am still learning the ropes to Labview.

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

Hello BroChill,

 

I'd suggest you take a look at the LabVIEW Intensity Graph/Chart:

 

LabVIEW Help: Intensity Charts

http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/types_of_graphs_and_charts/#Intensity_...

 

It's designed for exactly the sort of application you're describing.  There are several examples demonstrating their use that ship with LabVIEW (Help>>Examples), and more can be found in tutorials and community examples on NI.com- I'd recommend a search in your engine of choice if the shipping examples don't cover what you're looking for.

 

Best Regards,

Tom L.
0 Kudos
Message 2 of 5
(2,501 Views)

Thank you for the respone.

 

I know that there are graphs in labview that can accomplish this. My question is more about how to output the function T(:,:,i) into something managable in labview. It is my understanding that you can only output things of the type T(1,2). Unless I am mistaken. 

 

 

0 Kudos
Message 3 of 5
(2,480 Views)
Solution
Accepted by topic author BroChill

Hi Jakeyboy1,

 

Below is a link that demonstrates how to send a 3-Dimensional array from LabVIEW, however you should easily be able to modify the block diagram in the article to switch the processes.  In the article, the example code first auto-indexes a 3D array to assign T(:,:,i) within the script environment.  Then LabVIEW uses another script node to process the built 3-Dimensional array.

 

You can switch this process.  Out of the first script node wire out the length of the 3rd dimension and feed that into the N terminal of a for loop.  Within the for loop place the script node which reads T(:,:,i) and outputs the 2D array from the node.  You can wire this out of for loop and autoindexing should creat the 3D array in LabVIEW.  Since the N terminal matches the length of the 3rd dimension.  The resulting array in LabVIEW should be identical.

 

Send N-Dimensional Arrays into a MATLAB® Script Node

 

Regards,
Isaac S.
Applications Engineer
National Instruments
Message 4 of 5
(2,443 Views)
Thank you very much. Exactly what was I looking for and extremely helpful.
0 Kudos
Message 5 of 5
(2,426 Views)