create a matrix from a matrix x=[-2 -1 0 1 2]; which follow quadratic equations
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Abinash Baral
il 30 Nov 2016
Commentato: Abinash Baral
il 30 Nov 2016
Hi everyone, i want to create a matrix from this matrix x=[-2 -1 0 1 2] in such a way that resultant matrix is [ (-2^2),(-2^1),(-2^0); (-1^2),(-1^1),(-1^0); (0^2),(0^1),(0^0); (1^2),(1^1),(1^0); (2^2),2^1),(2^0) ]
0 Commenti
Risposta accettata
Più risposte (1)
Andrei Bobrov
il 30 Nov 2016
Modificato: Andrei Bobrov
il 30 Nov 2016
x = [-2 -1 0 1 2];
out = x(:).^(2:-1:0); % for R2016b
0 Commenti
Vedere anche
Categorie
Scopri di più su Multidimensional Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!