Question: 1 ) initialize and access array elements ( 5 points ) - Define a 1 d array ( row vector ) A with values from
initialize and access array elements points
Define a d array row vector A with values from to
access and display the rdth and last element in the array.
array modification points
change the value of the th element in A to
display the modified array
section : array operations
elementwise operations points
create a d array column vector B with values to in increments of
compute the sum of the transpose of A and B and store it in a new array C
compute the elementwise product of transpose of array A and B and store it in D
display arrays C and D
logical operations points
Create a d array row vector of length E with the integer values:
use a logical condition to identify the elements in E that are greater
than and store the result in an array named greaterthan
count how many elements meet this condition and store the result in nelements
display the result nelements
section : D arrays matrices
matrix initialization and access points
define a x matrix F with values from to in the top row,
in the second row and in the third row
access and display the element in the second row, third column
Change the element in the third row, first column to and display the updated matrix.
matrix operations points
define another x matrix G with values ; ;
calculate the matrix sum of F and G and store it in summatrix
calculate the product elementwise of F and G and store it in prodmatrix
display the resulting matrices summatrix and prodmatrix
Section : array slicing and concatenation
array slicing points
define a d array H with values from to
create a new array Hsubset that extracts every th element from H
display Hsubset
array concatenation points
define two d arrays row vectors I with values from to and I with values from to
concatenate I and I along rows horizontally to form a new array Icombinedh
concatenate I and Ivertically to form a new d array Icombinedv
display the horizontally concatenated array Icombinedh
display the vertically concatenated array Icombinedv
section : comprehensive task
temperature conversion points
create an array tempsc with temperatures in degrees celsius
convert each element in tempsc to fahrenheit and store the results in an array tempsf
note: conversion from celsius to fahrenheit: Fahrenheit
Celsius
Display both arrays side by side in a twocolumn format hint vector concatenation
array manipulation points
define a d array J as reshape:
manually flip the matrix J horizontally by reordering the columns and
store the result in Jflip
column n should become column
column n should become column
transpose the manually flipped matrix display the matrices J Jflip and Jfinal
MATLAB Code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
