ABCs_arrays

ABCs_arrays - function [A B C D_rows D_cols E F G H I J] =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 function [A B C D_rows D_cols E F G H I J] = ABCs_arrays(num1, arr1, arr2, i, j, arr3, arr4, arr5, vec1) % PROBLEM 3. THe ABCs of Arrays % This is a multi-part problem. Do each of the parts below. % % DO NOT CHANGE THE FUNCTION HEADER (the first line of code). % %a) Creating arrays. Create an array that has the numbers 2, 4, and 6 in %the first row, and the numbers 8, 10, and 12 in the second. % % Store your answer in the variable A. Write your code here: A = [2 4 6 %b) Assigning values to arrays. Set the value of num1 to position (2,2) in %the array B. % % Store your answer in the variable B. Write your code here: B(2,2) = num1 %c) Indexing indirectly. i and j are variables that contain positive %integer indicies that exist in the array arr1. Find the value of arr1 that %is at the row specified by i, and the column specified by j. % % Store your answer in the variable C. Write your code here: C = arr1(i,j) %d) Size. Find the number of rows and columns of the array arr2. % % Store your answer in the variables D_rows and D_cols.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

ABCs_arrays - function [A B C D_rows D_cols E F G H I J] =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online