Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given variable b that contains a row vector of length 10, assign the contents of the odd indices in b to variable odd , and
Given variable b that contains a row vector of length 10, assign the contents of the odd indices in b to variable odd , and assign the contents of the even indices of b to variable even. (Psst! the plural of index is indices. This has been your SAT vocabulary booster of the day) Examples: Input b = [8 -3 0 7 -6 -3 1 8 7 -2] Output odd = [8 0 -6 1 7] even = [-3 7 -3 8 -2] Function C Reset D MATLAB Documenta 1 function [odd even] = OddEven Ind(b) %replace the line below with code to assign to variable odd the contents in the odd indeces of input variable b odd = b; Nm 70 000 %replace the line below with code to assign to variable even the contents in the even indeces of input variable b even= b; end Given variable D that contains a matrix of any size, assign to variable col the contents of the first column in D Examples: Input D = [7 -3 9 4 0 8 -2 -5 4] Output col = [7 4 -2] Input D = [9 -4 -8 5 2] Output col = [9] Function function col = FirstColumn (D) %change the line below so that col is assigned the contents of the first column in D col =D
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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 Started