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

How to do the following on MATLAB For the following matrices: A 3 9 2 11 8 2 fre

ID: 3282388 • Letter: H

Question

How to do the following on MATLAB

For the following matrices: A 3 9 2 11 8 2 fred ralph ken susan 4 a. Create a cell array called A cell to store the following individual arrays: Note that you need to use B-char (T1, T2,. to create character array B where T1 and T2 are rows of B. Note that you can insert a single space between names b. Extract array A from A_cell. c. Extract the element at row 3 of the array C from A_cell d. Extract the name susan from A el.Remember that the name susan is a 1x3 array, not a single entity.

Explanation / Answer

MATLAB CODE:

clc

clear all

A_cell = {[1 3 5;3 9 2;11 8 2];char(['fred ' ' ralph'],['ken ' ' susan']);[4;6;3;1]};

b = A_cell(1,1);

Array_A = cell2mat(b)

c = A_cell(3,1);

C = cell2mat(c);

third_row_element = C(3)

d = A_cell(2,1);

C = cell2mat(d);

name = C(2,7:12)

OUTPUT:

Array_A =

     1     3     5
     3     9     2
    11     8     2


third_row_element =

     3


name =

susan

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote