Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python 3.7 please help Question 2 (25 points) Define a matrix A = 1.2 2 45 3.4 8 -36 10.3 78 8 1. Write a

python 3.7 please help
image text in transcribed
Question 2 (25 points) Define a matrix A = 1.2 2 45 3.4 8 -36 10.3 78 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. A= 7 -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 if commands in order to get full points, simply typing the new matrix A = 1-5 100 100 100 -5 100 100 100 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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions