Ask Question
10 June, 08:37

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.

+2
Answers (1)
  1. 10 June, 12:26
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers