Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Begin a new script and start a new code cell for Problem 1 by using 88. Use rand to create an 8 x7 matrix

Begin a new script and start a new code cell for Problem 1 by using $8. Use rand to create an 8 x 7 matrix A of random number 

Begin a new script and start a new code cell for Problem 1 by using 88. Use rand to create an 8 x7 matrix A of random numbers in the range [0, 1]. (i) In one line of code, change rows 3 and 6 of A to two. (ii) Next, use one line of code to change columns 2 through 5 of A to three. (iii) Next, use one line of code to change elements of A that are in odd numbered rows and in even numbered columns to 0.5 (i.e. A(1,2), A(1,4), A(1, 6)..) (iv) Finally, use for loops and if statements to change all elements in A that are less than 0.5 to zero. Hint: Do a help search on size, :, for, if

Step by Step Solution

3.31 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

clear all clear clc create an 8x7 matrix A of random numbers within the range0 1 A rand8 7 dispA fprintf change the rows 3 and 6 of A to two A36 2ones... 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

Operations management

Authors: Jay Heizer, Barry Render

10th edition

978-0136119418, 136119417, 978-0132163927

More Books

Students also viewed these Finance questions

Question

What is the role of random numbers in a Monte Carlo simulation?

Answered: 1 week ago

Question

Explain how improving quality cart lead to reduced costs.

Answered: 1 week ago