1

I have a square matrix M with 25x25 dimension. Then I want to create 25 matrices as follow:

  • the first matrix is matrix M without the first row and first column,
  • the second matrix is matrix M without the second row and second column, - ... so on until 25th matrix.
5
  • Generally you provide some demonstrated attempt of your own. Respectfully, this is not a coding service. Provide a specific problem and we can help. Commented Oct 30, 2015 at 20:22
  • It might also be helpful (and improve the usefulness of the answers to you as well as others) if you can give a little bit of context/reasons why you want to solve this particular problem ... (is this homework? if so, it's extra-important to explain what you tried and where you got stuck) Commented Oct 30, 2015 at 20:23
  • 1
    lapply(1:25, function(i) M[-i, -i]) Commented Oct 30, 2015 at 20:46
  • i am so sorry, to be honest i have to create quite complex function in r for my researh. I tried my best to solve it but i got stuck at this moment. i just ask a few question that maybe it's not difficult for you all. pardon me if i made some mistake, thanks for your great advice. thank you @jogo for your help. Commented Oct 30, 2015 at 21:13
  • @jogo, post as answer? Commented Oct 30, 2015 at 22:08

1 Answer 1

2

this little snippet will do:

lapply(1:25, function(i) M[-i, -i])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.