A force of 4 N acts at 30° above the horizontal. To find its vertical component in newtons, you type
Fy = 4*sin(30)
What does MATLAB return, and why?
Fy = 2, because sin treats 30 as an angle in degrees
Fy = -3.9521, because sin treats 30 as an angle in radians
Fy = 0.5806, because MATLAB evaluates sin(4*30)
Unlock full course notes by signing up
Translating a deflection formula into MATLAB
The tip deflection of a cantilever beam with an end load is
The values F=500 NF = 500\ \text{N}F=500 N, L=2 mL = 2\ \text{m}L=2 m, E=200×109 PaE = 200 \times 10^9\ \text{Pa}E=200×109 Pa and I=4×10−6 m4I = 4 \times 10^{-6}\ \text{m}^4I=4×10−6 m4 are already stored in MATLAB as F, L, E and I. Which line computes δ\deltaδ in metres?
Left-to-right evaluation of chained operators
A student types the following four assignments into the MATLAB Command Window to check how MATLAB groups chained operators:
Give the value MATLAB stores in each of the variables p, q, r and s. Each result is an exact integer; enter it with no decimal places.
Debugging an exponential decay expression
The voltage across a discharging capacitor is
with V0=12 VV_0 = 12\ \text{V}V0=12 V, t=3 mst = 3\ \text{ms}t=3 ms, R=2.2 kΩR = 2.2\ \text{k}\OmegaR=2.2 kΩ and C=1 μFC = 1\ \mu\text{F}C=1 μF. A student types
Rounding and remainder functions with negative inputs
Some of MATLAB's rounding and remainder functions, such as fix and floor or rem and mod, agree for positive inputs but can differ when a negative number is involved. Enter the value MATLAB returns for each expression in the table below. Every result is an exact integer, so type it as an integer with its sign where needed.