using Matlab to do this problem This function already contains code that creates
ID: 3697841 • Letter: U
Question
using Matlab to do this problem This function already contains code that creates a cell array, as shown below.myCell = {'GR2 example', [1 2 3 4 5 6]; true, [10 20 30; 40 50 60]};Add output statements that will display the following values:•the 3rd character of the text string in the first cell.•the last value in the row vector.•the Boolean value.•the value on the 2ndrow and 1stcolumn of the matrix in the last cell. Note that your code must use the variable myCell to display its values, not simply "hard code" the output of the required values.
Explanation / Answer
Cell Array accessing:
* When we use ( ) we access the element of the cell array
* When we use { } we access the value of the cell
* the 3rd character of the text string in the first cell
mycell {1,1} (3) where {1,1} access the first cell of the array (3) the third character.
* the last value in the row vector.
mycell{1,2} (6)
* the Boolean value
mycell {2,1}
* the value on the 2ndrow and 1stcolumn of the matrix in the last cell.
mycell {2,2} (2,1)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.