Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python 3.7 Question 2 (25 points) 78 Define a matrix 10.3 2 45 -36 8 1. Write a loop and using if commands replace all

Python 3.7
image text in transcribed
Question 2 (25 points) 78 Define a matrix 10.3 2 45 -36 8 1. Write a loop and using if commands replace all the numbers in the main diagonal (top left to bottom right diagonal) with 5. You need to write a loop to replace the numbers in the main diagonal. You need to demonstrate how to loop over an array and how to use if - statements! I will NOT give you points if you simply type the solution or use a built in command such as diag() etc. -5 2 45 3.4 -5 -36 10.3 78 -5 2. Next, use this newly created matrix and write a loop and replace numbers in the off-diagonal with 100. Again, use a loop and it commands in order to get full points, simply typing the new matrix -5 100 100 100 -5 100 100 100 5 will not result in any points

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

Describe ways the production cost report can be used by management.

Answered: 1 week ago

Question

=+What kind of love? Virtue Appeal

Answered: 1 week ago