How to generate a matrix of variables with continous values?

1 vue (au cours des 30 derniers jours)
SHASHANK RAGHAVAN
SHASHANK RAGHAVAN le 26 Nov 2019
P = [x(1) x(2) x(3) x(4) x(5) ;
x(6) x(7) x(8) x(9) x(10);
x(11) x(12) x(13) x(14) x(15);
x(16) x(17) x(18) x(19) x(20);
x(21) x(22) x(23) x(24) x(25);]
how to do this for a 100*100 matrix?
P = [ x(1) ............ x(10);
x(11)...............x(20);
...............................
.................................
x(90).......................x(100);]
Note: I dont want to use "sym code"
could please help me on this?

Réponses (1)

Akira Agata
Akira Agata le 27 Nov 2019
How about using reshape function?
The following is an example:
x = 1:100;
P = reshape(x,10,10)';

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by