LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reshape array in labview from matlab coding

Solved!
Go to solution

I have following matlab code and I want to do it without using LabView MathScript. I want to do it using labview reshape array function. Can any body guide me how to do it.

 

 

Reshape a 3-by-4 matrix into a 2-by-6 matrix in MATLAB

A =
    1    4    7    10
    2    5    8    11
    3    6    9    12
          
B = reshape(A,2,6)
          
B =
    1    3    5    7    9   11
    2    4    6    8   10   12

 

So how can do this in LabView using reshape array function. See attached image below for details.

 

reshape array.jpg

The result is not as same as matlab. Can any body guide me how can i get same result as matlab.

 

Thanks 

 

JK

0 Kudos
Message 1 of 4
(1,670 Views)
Solution
Accepted by topic author josephkirmani

Hi Joseph,

 

atleast a quick&dirty two-step process:

check.png

(Using an older LV version I cannot use the concatenating output tunnel.)

 

Altenbach may simplify this. 😄

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 4
(1,665 Views)

Also If I have 1-D input array then what change do I ned to make in it?

0 Kudos
Message 3 of 4
(1,647 Views)

Hi Joseph,

 

in my snippet you see that "array1" indicator. This will be your 1D array input when you want such an input - if it has the same/similar content as array1…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 4 of 4
(1,637 Views)