Question
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 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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Operations management
Authors: Jay Heizer, Barry Render
10th edition
978-0136119418, 136119417, 978-0132163927
Students also viewed these Finance questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App