LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Addition assignment operator & nested loops

I'm trying to implement this particular MATLAB code in LabVIEW and I'm stuck. I'm facing issues regarding the usage of nested loops and addition assignment operator. Can someone help me get started?

imentropy_0-1632486441828.png

 

0 Kudos
Message 1 of 4
(755 Views)

Hi im,

 


@im.entropy wrote:

I'm trying to implement this particular MATLAB code in LabVIEW and I'm stuck. I'm facing issues regarding the usage of nested loops and addition assignment operator. Can someone help me get started?


To get you started you should take those "Training resources" offered at the top of the LabVIEW board!

 

  • Nested loops are really simple by nesting one loop inside the other one…
  • An addition function is found in the numerics function palette!
  • And that "assignment operator" will completely handled by LabVIEW once you learn the wonderful feature of autoindexing arrays at loop borders… 😄

Example:

A minor correction: the control labelled "k" should be labelled "n"!

(There might be problems due to the differences in array indexing between Matlab and LabVIEW…)

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(751 Views)

Also, check the use of a Shift Register to propagate the partial sum from one loop iteration to the following.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 4
(740 Views)

Hi,

 

in my previous suggestion a shift register is missing.

 

Here's a (more LabVIEW-like) version which doesn't need that shift register:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(707 Views)