Decrypt P File Matlab Matrix
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.
Decrypt Any File
Seçkin Savaşçı4 Answers
The answer is creating a matrix of zeroes, and then setting part of it to 1
using indexing:

For example:
If you insist on expanding, you can use:

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