LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I write a C program about a matrix in Formula Node function(in Structure)?

Dear All,
I want to write a C program about a matrix in Formula Node function (in Structure). However, I do not know how to define the matrix, anyone can help me? Here is the details about the C program:
 
for i=0:7;
   y(0,i)=data(0,i);
end
 
data is an input terminal and y is an output terminal.
 
I know I can achieve this purpose by other function in LabView. But I think it will be more convenient if I can write a program like this. Thanks in advance!
 
Quanzeng
 
0 Kudos
Message 1 of 4
(2,717 Views)
Hi,
 
you should do it like this:
 
int y_matrix[10][10];              //matrix with size 10x10
int data_matrix[10][10];
int i=0;
for ( i=0; i<8; i++)
{
    y_matrix[0][i] = data_matrix[0][i];
 
}
 
 
But it is not clear for me what you want to do, because you are only writing data from one matrix to an other one.
 
 
Regards,
Christian

Message Edited by Christian_M on 08-08-2006 03:46 AM

Message 2 of 4
(2,710 Views)

Hi,

Thank you for your reply. But I can not make the program work in the LavView. Are there some tricks?

 

0 Kudos
Message 3 of 4
(2,695 Views)

Hi

Please try the MathScript Node, it is easy to create a matrix and perform matrix operation in MathScript Node.

Message 4 of 4
(2,681 Views)