Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

%matplotlib inline import numpy as np import matplotlib.pyplot as plt a = 1 + 5 b = 2 c = a + b print(a /

image text in transcribedimage text in transcribed

%matplotlib inline import numpy as np import matplotlib.pyplot as plt

a = 1 + 5 b = 2 c = a + b print(a / b) print(a // b) print(a - b) print(a * b) print(a**b)

a = np.array([[3, 1], [1, 3]]) b = np.array([[3], [5]]) print(a * b) print(np.dot(a, b)) print(np.dot(b.T, a)) c = a**(-1.0) print(c * a)

t = np.arange(10) g = np.sin(t) h = np.cos(t) plt.figure() plt.plot(t, g, 'k', t, h, 'r');

t = np.arange(0, 9.1, 0.1) g = np.sin(t) h = np.cos(t) plt.figure() plt.plot(t, g, 'ok', t, h, '+r');

t = np.linspace(0, 10, 20) print(t) t = np.logspace(0.001, 10, 9) print(t) t = np.logspace(-3, 1, 9) print(t) y = np.exp(-t)

plt.figure() plt.plot(t, y, 'ok') plt.figure() plt.semilogy(t, y, 'ok')

LW 1 Lab 0 - Python and Jupyter notebook introduction In [ ]: %matplotlib inline import numpy as np import matplotlib.pyplot as plt 1.1 1 Warm-up Exercises Try the following commands on your jupyter notebook or python editor and see what output they produce. In [ ]: a = 1 + 5 b = 2 C = a + b print(a / b) print(a // b) print(a - b) print(a * b) print(a**b) In [ ]: a = np.array([[3, 1], [1, 3]]) b = np.array([[3], [5]]) print(a * b) print(np. dot(a, b)) print(np. dot (b.T, a)) c = a**(-1.0) print(c * a) In [ ]: t = np.arange(10) 8 = np. sin(t) h = np.cos(t) plt.figure() plt.plot(t, g, 'k', t, h, 'r'); LW t = np.arange(0, 9.1, 0.1) 1 8 = np.sin(t) h = np. cos(t) plt.figure() plt.plot(t, g, 'ok', t, h, '+r'); In [ ]: t = np. linspace(0, 10, 20) print(t) t = np.logspace(0.001, 10, 9) print(t) t = np.logspace(-3, 1, 9) print(t) y = np. exp(-t) plt.figure() plt.plot(t, y, 'ok') plt.figure() plt.semilogy (t, y, 'ok')

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

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

Brief the importance of span of control and its concepts.

Answered: 1 week ago

Question

What is meant by decentralisation?

Answered: 1 week ago

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago