Matlab homework help - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Matlab homework help

cargocargo Posts: 7Member
Hi,
I have a (beginners) matlab assignment and I'm having trouble getting started. I was given a 3 page xls called grades.xls. I'm supposed to create an .m file that will recreate the xls (including its 3-page layout) using cell arrays. The data from the xls will/should be hard-keyed into the .m file because the assignment is teaching about cell arrays and not file i/o.

In the .xls, the first column on each page is student names (and they're the same on each page). On the first page is a column for homework averages and a column for test averages (all numeric) of the grades (numeric) recorded on the next two pages. On the the second page are columns of their homework scores, and on the third page are columns of their test scores.

I'm not asking for details on how to do this, because I need to learn this stuff, but I do need help with an overall strategy to use.
Thanks.

Comments

  • jjasso5jjasso5 Posts: 41Member
    It can be convenient to store several variables
    of different size or type in one variable.
    A cell array is able to do that.
    A simple matrix cannot store data of different types.

    In general, cell arrays work like n-dimensional
    arrays with the exception of the use of {}
    as allocation and indexing operators, instead of [].

    I suggest you see a full example on cell arrays here:
    http://www.matrixlab-examples.com/cell-arrays.html


    You can read/write Excel files with instructions
    xlsread/xlwrite. See this example to learn how to
    read specific areas of an Excel sheet. Maybe you
    don't need it now, but you'll need it later:
    http://www.matrixlab-examples.com/ms-excel.html

Sign In or Register to comment.