Explore BrainMass

MATLAB: Break Function Script

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

(See attached file for full problem description)

How would you rewrite the following script without using break?

for p = 7:8
for q = 3:5
for r = 1:2
fprintf(' %3.0f, %3.0f, %3.0fn' , p, q, r)
if q = = 4, break; end

© BrainMass Inc. brainmass.com October 24, 2018, 6:47 pm ad1c9bdddf


Solution Summary

A break function script for MATLAB is determined.

See Also This Related BrainMass Solution

Basic 1D signal presentation and plotting in MATLAB

Include answers for Problems and include MATLAB coding along with any output plots that support solutions

1. The input-output equation characterizing an amplifier that saturates once the input reaches certain values is:

(see attached file for equations)

Where x(t) is the input and y(t) the output.

a. Plot the relation between the input x(t) and the output y(t). Is this a linear system? For what range of input values is the system linear, if any?

b. Suppose the input is a sinusoid x(t) = 20 cos(2t)u(t), carefully plot x(t) and y(t) for t = -2 to 4.

2. The following op-amp circuit is used to measure the changes of temperature in a system. The output voltage is given by:

Suppose that the temperature in the system changes cyclically after t = 0, so that:

Let the input be Vi(t) = 1 volt.

a. If the switch closes at t0 = 0 msec., plot the output voltage V01(t) for 0≤t≤0.2 sec. in time-intervals of 0.01 sec.

b. If the switch closes at t0 = 50 msec., plot the output voltage V01(t) for 0≤t≤0.2 sec. in time-intervals of 0.01 sec.

3. A zener diode is such that the output corresponding to an input Vs(t) = cos(t) is a "clipped" sinusoid

(see attached file for equations)

Use MATLAB to generate the input and output signals and plot them in the same plot for 0≤t≤4 at time intervals of 0.001.

a. Is this system linear? Compare the output obtained from Vs(t) with that obtained from 0.3 Vs(t).

View Full Posting Details