Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I've been stuck on this problem for a while now, so it would be greatly appreciate if you could help me, (PLEASE COMPLETE USING

Hi, I've been stuck on this problem for a while now, so it would be greatly appreciate if you could help me,

(PLEASE COMPLETE USING MATLAB)

image text in transcribed

Part A (Based off Week 2 Content) An H-bridge is a circuit that can be used to control a motor using simple on/off switches (see figure below S1 S3 S2 S4 Fig. 1. H-bridge Cireuit We can describe the state of the switches in this circuit using an array. Within the array, 0 means the switch is off and 1 means the switch is on. Example: [1,0,1,0] means switches 1 and 3 are on, while 2 and 4 are off The switch state wl determine the state of the motor If the switch state is [1,0,0,1] then the motor moves right If the switch state is [0,1,1,0] then the motor moves left If the switch state is [1,0,1,0] or [0,1,0,1] then the motor stalls Otherwise, the motor is off Questions: 1. Create a function that checks whether the input vector if in the correct format. If the input array is a 4-element row vector containing only ones and/or zeros, then the function returns 1. Otherwise, the function returns 0. 2. Create a function that returns 1 if the motor moves right, 2 if it moves left, 3 if it stalls, and 4 if the motor is off. You may assume that the input vector is in the correct format. Useful Control Structures and Functions: if, elseif, else, isequal

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 15th International Conference Dasfaa 2010 International Workshops Gdm Benchmarx Mcis Snsmw Diew Udm Tsukuba Japan April 2010 Revised Selected Papers Lncs 6193

Authors: Masatoshi Yoshikawa ,Xiaofeng Meng ,Takayuki Yumoto ,Qiang Ma ,Lifeng Sun ,Chiemi Watanabe

2010th Edition

3642145884, 978-3642145889

More Books

Students also viewed these Databases questions

Question

Where and how is treasury stock reported on the balance sheet?

Answered: 1 week ago

Question

What is Accounting?

Answered: 1 week ago