Decrypt P File Matlab Matrix

Posted on -
Active1 year, 10 months ago
  1. Decrypt Any File

I need a matrix of nxn, where the first pxp of it contains ones and rest are zeros. I can do it with traversing the cells, so I'm not asking a way to do it. I'm looking for 'the MATLAB way' to do it, using built-in functions and avoiding loops etc.

To be more clear;

Stuart’s MATLAB Videos. Using debugger to walk through code. You would be better asking this on MATLAB Answers, or searching File Exchange or Google. Creating and Concatenating Matrices (p. 1-3) Create a matrix or construct one from other matrices. Matrix Indexing (p. Photoshop cs3 serial key for mac. 1-17) Access or assign to elements of a matrix using methods of row and column indexing. Getting Information About a Matrix (p. 1-23) Retrieve information about the structure or contents of a matrix.

let n=4 and p=2,

then the expected result is:

There are possibly more than one elegant solution to do it, so I will accept the answer with the shortest and most readable one.

P.S. The question title looks a bit irrelevant: I put that title because my initial approach would be creating a pxp matrix with ones, then expanding it to nxn with zeros.

Seçkin Savaşçı
Seçkin Savaşçı

Decrypt Any File

Seçkin Savaşçı
2,7362 gold badges17 silver badges37 bronze badges

4 Answers

The answer is creating a matrix of zeroes, and then setting part of it to 1 using indexing:

File

For example:

If you insist on expanding, you can use:

Decrypt p file matlab matrix onlineAndrey RubshteinAndrey Rubshtein
18.6k8 gold badges58 silver badges99 bronze badges
AmroAmro
117k21 gold badges218 silver badges405 bronze badges

You can create the matrix easily by concatenating horizontally and vertically:

nrznrz
8,8804 gold badges31 silver badges66 bronze badges
SergSerg
6,2767 gold badges28 silver badges45 bronze badges

Not the answer you're looking for? Browse other questions tagged matlabmatrixvectorization or ask your own question.

@Jan: Jan, I think you missed my point. I already said that the encryption was put in place on purpose to protect intellectual property, which is what I like. I meant to say that hacking P-code is possible but probably very difficult. I probably had a smirk on my face when I say 'hey, if you find a way, please let me know!'. I didn't know hacking P-code is not a real challenge and I still believe it is going to be very hard. Are you afraid that math98 will take my word for it and go cracking the encryption? He said he 'heard from an old MATLAB user that there are some ways to decrypt a pcode'. Is that 'old MATLAB user' referring to you? Walter didn't want to take that credit.