Create the following matrix A (matlab)

  • Thread starter Thread starter Firben
  • Start date Start date
  • Tags Tags
    Matlab Matrix
Click For Summary
To create the matrix A in MATLAB, define it as a 3x6 matrix with the specified values. The six-element row vector hc should include the first three elements from the second row of A (8, 9, 10) and the last three elements from the third row of A (16, 17, 18). To achieve this, start with hc = A(2, 1:3) and then concatenate it with A(3, 4:6). This will result in hc being defined as [8, 9, 10, 16, 17, 18]. Understanding the indexing of MATLAB is crucial for correctly extracting these elements.
Firben
Messages
141
Reaction score
0
A =
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18

Create a six-element row vector named hc that contains the first three elements of the second row of A and the last three elements of the third row of A

If i start with hc=a(

What should i do next?
 
Physics news on Phys.org
What are "the first three elements of the second row of A"?

What are "the last three elements of the third row of A"?
 

Similar threads

  • · Replies 32 ·
2
Replies
32
Views
2K
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K