how to create matrix from another matrix?

I need to use a matrix A to create a matrix B
matrix a
A=[123;456;789]
matrix b
B=[1+2i 2+3i 3+4i;4+5i 5+6i 6+7i;7+8i 8+9i 9+10i]

답변 (1개)

Jos Jordan
Jos Jordan 2021년 2월 6일

0 개 추천

I'm not sure exactly how you are expecting this to be done, but you could simply just do:
A = [1,2,3;4,5,6;7,8,9];
A_imaginary = [2*i,3*i,4*1;5*i,6*1,7*i;8*i,9*i,10*i];
B = A + A_imaginary;
if that's all you needed to do?

댓글 수: 4

Jos Jordan
Jos Jordan 2021년 2월 6일
편집: Jos Jordan 2021년 2월 6일
(Assuming you meant it as a 3x3 matrix, not a 3x1 vector of
[123;
456;
789];
)
Czarek Czarek
Czarek Czarek 2021년 2월 6일
hmm, maybe the next example will be easier
matrix A
A=[123;456;789]
and i need somehow change matrix A with command to creat matrix B, and matrix B should looks like this
B=[-123;-456;-789]
B=-A
in that case?
Czarek Czarek
Czarek Czarek 2021년 2월 6일
no, only first number should be wtich minus
its should looks like this
-1 2 3
-4 5 6
-7 8 9

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

질문:

2021년 2월 6일

댓글:

2021년 2월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by