ENED 1100 – ACTIVITIES AND HOMEWORK W7D1: LABVIEW REPETITIONPython

Java Python ENED 1100 – ACTIVITIES AND HOMEWORK

W7D1: LABVIEW REPETITION

TASK 1 (OF 2)

PART A

Create a Flowchart and develop a LabVIEW VI that computes a sum of odd integers using the equation:

The value of x should start at 0. The final value of the equation 2x+1 (ie: the final odd number added to the sum) should be defined by the user using a numeric input (control) on the Front Panel. The final value of y (ie: the sum of odd numbers) should be displayed for the user using a numeric output (indicator) on the Front Panel.

PART B

To check that your LabVIEW VI is operating correctly, create a trace table that tracks the values of x andy for five iterations (the final value of y should be 1+3+5+7+9=25). Add your trace table to the same file containing your flowchart for submission.

TASK 2 (OF 2)

Repetition flow is often used to create simulations. Using repetition, you can repeatedly simulate events to determine the probability of a given outcome.

Create a LabVIEW VI that simulates the s ENED 1100 – ACTIVITIES AND HOMEWORK W7D1: LABVIEW REPETITIONPython imple experiment of flipping a coin. Remember, flipping a coin can only have two outcomes: Heads, or Tails. Your flow diagram should:

•   allow the user to input the number of times to flip the coin,

•   determine the result of the coin flip by randomly producing a value corresponding to 1 (heads) or 0 (tails),

•   record/track the number of times the coin landed on aheads or a tails, and

output the final percentage of flips that were heads and the percentage that were tails after all flips have been simulated.

Use the Random Number (0-1) block from the Numeric section of the Functions Palette to simulate your coin flip.

This block will randomly generate a decimal number between 0 and 1. You can use this decimal to determine the result of a coin flip in a number of different ways. You can round the number to the nearest integer (0 or 1), compare the random number to 0.5 to see if it is above or below that midpoint (x>0.5?), or use another similar method         

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值