Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ASSIgnillent 2. ells unctions and Branching Problem 1: Creating Cells Create a 2

ID: 3742519 • Letter: A

Question

ASSIgnillent 2. ells unctions and Branching Problem 1: Creating Cells Create a 2x2 Cell called myProblCell with the following Where the: 1,1 entry is the following 1x15 char array 'ENGR 215 Lab 02 1,2 entry is the following 4x3 char array ['Ali'; 'Yin'; 'JoeJim'] 2,1 entry is the following 3x3 double array O 5 7 0 107 0 15 2,2 entry is the following function handle f(x,y) sin(x)ty Using only myProb1Cell create the following arrays in your workspace with one line of code for each variable AAli Ali' Yin' C-'ENGR 215 Lab 02 is fun' D-0 5 0 15 E sin(/2)+52 Replace the first row of myProblCell 2,1 entry with ones myProbl1Cell will now be 1,1 entry is the following 1x15 char array 'ENGR 215 Lab 02 1,2 entry is the following 4x3 char array [ 'Ali' ; ' Yin ' ; 'Bob ' ; ' Jim' ] 2,1 entry is the following 3x3 double array 5 7 10 7 1 15 7 2,2 entry is the following function handle fx,y)-sin(x)ty

Explanation / Answer

%creating a 2X2 cell myProb1Cell
myProb1Cell = cell([2 2]);
%adding value at (1,1)
myProb1Cell(1,1) = 'ENGR 215 Lab 02';
%adding value at (1,2)
myProb1Cell(1,2) = ['Ali';'Yin';'Joe';'Jim'];
%adding value at (2,1)
myProb1Cell(2,1) = [0 5 7; 0 10 7;0 15 7];
%adding value at (1,2)
myProb1Cell(2,2) = 'sin(x)+y.^2';

%creating the given variables
A = 'Ali';
B = ['Ali','Yin'];
C = 'ENGR 215 Lab 02 is fun';
D = [0 5; 0 15];
E = sin(pi/2)+5.^2;

%replacing the first row of the cell 2,1 with ones
myProb1Cell(2,1) = [1 5 7; 1 10 7; 1 15 7];

%finally the cell will be
myProb1Cell