Colon operations. The following script should compute and display ten values of y=mx+b with x having integer values and plot values y(3) to y(8). Find the error in the script.
x = 0:10;
m = 3;
b = 1;
y = m*x+b
plot(x,y(3:8))
Solution
x = 0:10;
m = 3;
b = 1;
y = m*x+b
plot(x(3:8),y(3:8)) % <- x and y lengths must be equal
You might also like to view...
What NEC chapter would you expect to find rules that apply to the installation of branch circuits, feeders, services, fuses, circuit breakers, and grounding?
a. Chapter 2, Wiring and Protection b. Chapter 3, Wiring Methods and Materials c. Chapter 4, Equipment for General Use d. Chapter 5, Special Occupancies
Class 2 circuits may be installed in the same enclosure or cable with conductors of Class 3 circuits provided _________.
A. Circuit voltages are not above 150V B. They are functionally associated C. The class 2 conductors are insulated to a minimum of 300V D. The class 2 and Class 3 conductors are insulated to a minimum of 600V
A roof with no overhang normally has a closed cornice consisting of a _____.
a. frieze board b. ledger and lookouts c. soffit and fascia d. bed molding and rake soffit
When suspension systems are built from heavier weight components, these items can improve fuel economy and reduce CO2 emissions.
Answer the following statement true (T) or false (F)