create a matrix from a matrix x=[-2 -1 0 1 2]; which follow quadratic equations
조회 수: 3 (최근 30일)
이전 댓글 표시
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
채택된 답변
추가 답변 (1개)
Andrei Bobrov
2016년 11월 30일
편집: Andrei Bobrov
2016년 11월 30일
x = [-2 -1 0 1 2];
out = x(:).^(2:-1:0); % for R2016b
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!