# MATRIX ALGEBRA

I have a matrix A. Let's say 10 columns and 50 rows. Problem: I want to delete rows 25 to 30, and use the remaining part of the matrix in the calculations. I checked the Shazam manual (pp. 406-407), but the example was not easy to understand. Any good ideas how to delelete rows (and columns)?

Regards, TL

edit retag close merge delete

Sort by » oldest newest most voted

You are on the right track using the COPY command. You just need to specify the starting and ending rows. Here is an example:

* Create random matrix
matrix A = uni(10,2)
print A

* Copy the last 5 rows of A into the 1st 5 rows of B
dim B 5 2
copy A B / frow=6;10 trow=1;5
print B


Hope this helps.

more

It helps, but not 100%. Question: Let's say you want to delete rows # 5, 6, and 7. Great if you can provide us with a solution.

TL.

Solution: I think the following script will do:

sample 1 4 8 10
copy A:1 A:2 B


Yes that is correct. Note that you don't need to specify the columns if taking the whole matrix so the

copy A:1 A:2 B


can just be

copy A B