Lab 5_ Cell Arrays and Data Visualization
.pdf
keyboard_arrow_up
School
University of Michigan *
*We aren’t endorsed by this school
Course
101
Subject
Industrial Engineering
Date
Apr 3, 2024
Type
Pages
21
Uploaded by MajorComputerRaccoon33
ENGR 101
Lab # 5
Cell Arrays and Data Visualization
interesting picture related to the lab here
perhaps something related to one of the exercises
needs to be related to engineering
Lab 5: Cell Arrays and Data Visualization
Due Saturday, 2/12, 2022 at 11:59PM EDT
on Gradescope. NO EXCEPTIONS! Your lab MUST be submitted to Gradescope by the deadline or you will not receive credit!
This lab is worth 40 points and is graded for completion. However, earning a grade depends on attendance and participating during the lab. Your lab instructor will record the attendance for each lab.
Our team name is...
The Detroit Lions Name
Roles
(groups of 3)
Roles
(groups of 4)
Roles
(groups of 5)
Person A
Vienna Chafart Leader + Googler
Leader + Googler
Leader
Person B
Andrea Liu Scribe + Questioner
Scribe
Scribe
Person C
Chris Robinson Coder
Coder
Coder
Person D
Ayse Uzan
Questioner
Questioner
Person E
Googler
Staff
Instructions:
One group member should create an editable copy of this worksheet and share the document with all group members and your IA/GSI. (
+/NTWMJP ##' 65IFLVMJP IFL ((,Z[U^
in the menu.) Fill in the tables below.
Lab 5: Cell Arrays, Excel Files, Data Visualization
MATLAB has a huge variety of ways to visualize data. It’s a platform which is well designed to both read, store, and display data which makes it excellent for many engineering applications. You don't need to memorize all of these visualization functions - MATLAB provides good documentation for you to reference. Each member of your team should open up the documentation (
link
) and list one of the plots that MATLAB supports in the box below. Put N/A if you don't have a person D and/or E.
This lab has less instructions than others because we want you to use the Mathworks documentation extensively when plotting. One helpful way to open documentation (when you already know a function’s name) is typing the following command into the command window: EhBelp
Cfun@ctFion°>amBe
Have your coder type: EhBelp su?bplot
>anAd
EhBelp @comBet3
into the command window and see what pops up in the command window. These two functions will aid you later on during the lab. This even works for functions which you’ve written (not built in) provided that you’re in the correct folder. Person A
Person B
Person C
Person D
Person E
Type of Plot: ±FinBe plot
s@c>attBer
EhFistoDgr>am
²BesEh
°/³
Exercise 1: Cell Array Practice (20 mins)
The *aTTUVWJWWX
should share their screen and launch MATLAB. Create a cell array named @cBelBery
with the following values:
Write the MATLAB expression used to build this cell array:
Type, and Size of Result:
celery = {2.06, [17 22 21 5]; 'hi'
, 'A'
};
2x2 ±!ll
‘hi’
2.06
17
22
21
5
‘A’
Exercise 1: Cell Array Practice
For the cell array created, what would the return value, type, and size be for the following MATLAB expressions?
Discussion Leader
MATLAB expression
Value, Type, and Size of Result
Person A
´ = @cBelBery{1,2}
1 x 4, double
Person B
´ = @cBelBery(1,1)
1 x 1 cell Person C
´ = @cBelBery{1,:}
1 x 1 double
Person D
´ = @cBell2m>at(@cBelBery(1,:))
1 x 5 double
The *aTTUVWJWWX
should share their screen and launch MATLAB. For each of the following expressions, make a prediction of the value of the variable first
and then double check by trying it out in MATLAB. Each has a different discussion leader. The :EUWWX[NTWJ
records and the 8ZZ[WJXXYYYZ[NaTTU`SSWJWWX
tracks any questions the .aTTUaTTUYL^QQWJWWX
is unable to find an answer to.
Exercise 1: Cell Array Practice
Continue working with the @cBelBery
cell array. For the following exercise, each discussion leader should write code for the desired operation on their own. If your letter isn’t included, pick one to do. The group should reconvene to discuss each operation. The :EUWWX[NTWJ
records and the 8ZZ[WJXXYYYZ[NaTTU`SSWJWWX
tracks any questions the .aTTUaTTUYL^QQWJWWX
is unable to find an answer to.
Write code to perform each of the following operations on the cell array @cBelBery
:
Discussion Leader
Desired Operation
MATLAB Code
Person E
Replace the value 2.06 with the value 4.06.
@cBelBery{1,1} = 4.06;
Person A
Replace the value 17 with the value 15.
celery{1,2}(1) = 15;
Person B
Create a new matrix called ²ro±±oli
that is the same as ±!l!ry
, but has an extra 3rd column that is a duplicate of the 1st column.
broccoli = {celery{1, :}, celery{1,1}; celery{2,:}, celery{2,1}};
Person C
Swap the strings 'hi'
and ‘³’
in the cell array with a single line of code.
celery(2, 1:1:2) = celery(2, 2:-1:1);
# of mins this exercise took our team:
15
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help