ENG 1002 Lecture Notes - Code Reuse, Group For The Study Of Reactive Motion, Matlab

7 views5 pages

Document Summary

Static 2d arrays are made up of a fixed number of rows and columns. A 2d array behaves the same as a 2d array or matric in matlab. Use the square bracket notation [ ] twice to specify the dimensions of a static 2d array: the first square bracket specifies the number of rows, the second square bracket specifies the number of columns. Create a 2x2 static integer array called grid. Create a 10 by 12 static double array called matrix. Create a 4 by 50 static character array called city. Use the square brackets notation [ ][ ] on the array to access the element by row and column, respectively. Get the 1st row, 1st column from the grid array grid[0][0]; Print the 4th row, 10th column from the matrix array. Use the square bracket notation [ ] [ ] on the array to update the element row and column, respectively, followed by the assignment operator.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions