Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use matlab and show the screenshot 1. Write a 'for loop program to implement the following requirements: (a) First, creates a 25-element vector with

please use matlab and show the screenshot image text in transcribed
1. Write a 'for loop program to implement the following requirements: (a) First, creates a 25-element vector with random integers between 10 and 20 by using the command: x = randi([-10 20),1,25). (b) Then, use a "for loop' to examine each of the element in the vector x. If the element is a positive and odd number, its value is doubled. If the element is negative, its value is squared. Otherwise, its value is divided by 2. (e) Lastly, displays the original vector and the modified vector side-by-side

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

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions