Using or Creating block matrices in Matlab

  • #1

Main Question or Discussion Point

I am trying to put a lot of data into a matrix to call upon later in plotting. From a masterfile, I need to call on the (:,1) values on x and y, and the (:,2) values in x and y. It is easy to construct a 12x3 matrix to contain all of this information, however when I am plotting I want to call only a 4x3 portion of this 12x3 matrix. Which command could I use to limit this call to just that portion of my larger matrix? Thank you in advance!!
 

Answers and Replies

  • #2
272
0
You can use a code like this, I will define a matrix of ones for clarity.

Code:
%create matrix
matrix = ones(12,3);

%define 4x3 portion
four_by_three = matrix(1:4,1:3); [I]%note matrix(1:4,:) also works here[/I]
display(four_by_three);
 

Related Threads on Using or Creating block matrices in Matlab

  • Last Post
Replies
2
Views
2K
Replies
28
Views
54K
Replies
6
Views
937
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
5
Views
4K
Replies
1
Views
4K
Replies
3
Views
47K
  • Last Post
Replies
4
Views
2K
Top