Ask Question
10 July, 00:13

Create a cell array containing the same data as above (Do not use built-in functions such as cell2array, struct2cell, etc. but use direct definition). The first row of the array will contain Mercury, 35.98, 3031 etc.

+1
Answers (1)
  1. 10 July, 04:10
    0
    clc;

    clear all;

    disp ('Creating the cell arr of required values')

    arr = { 'Alejandro', 11, {3 5 7 9}, {0 0}, 'UCSD2016'; ...

    {8 6 4 2 0 - 2}, pi, 'Stephanie', {1 0}, {' (858) 273-0173'} }

    disp ('First row second column')

    exp1 = arr (1 : 2, 2)

    disp ('Third element of 2nd row 1st column')

    exp2 = arr{2, 1} (1,3)

    disp ('Deleting last 2 elements of 1st row 2nd column')

    arr{1, 3} (3:4) = []

    disp ('log of 2nd row 2nd column')

    arr{2, 2} = log (arr{2, 2})

    disp ('Swapping 1st row 1st column with 2nd row 3rd column')

    temp = arr{2, 3};

    arr{2, 3} = arr{1, 1}

    arr{1, 1} = temp

    disp ('Deleting 2nd row 1st column elements')

    arr{2, 1} (1:6) = []

    disp ('Deleting third column')

    arr (:,3) = []
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Create a cell array containing the same data as above (Do not use built-in functions such as cell2array, struct2cell, etc. but use direct ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers