필터 지우기
필터 지우기

What is the best way to manipulate complex vectors in MatLAB?

조회 수: 14 (최근 30일)
M G
M G 2018년 4월 25일
답변: M G 2018년 4월 25일
I am new to MatLAB. I would like to define complex vectors of the form {a + bi}, then manipulate those vectors according to the rules of complex vector addition, subtraction, multiplication and division. I cannot seem to find any "canned" functions for this. I've resorted to some sledgehammer techniques but surely (??) there must be some elegant ways of manipulating complex vectors, rather than piece-wise manipulating each of the real and imaginary components....

채택된 답변

KSSV
KSSV 2018년 4월 25일
YOu need not to worry about that..you may straight away use the operations on complex numbers. MATLAB will take care if it. To check whether given number is complex or not you can use isreal. This will be logical 0 iff the number is complex.
a = 1+1i*2 ;
b = 2+1i*3 ;
% sum
a+b
% difference
a-b
% multiplication
a*b
% division
a/b

추가 답변 (1개)

M G
M G 2018년 4월 25일
Unexpectedly simple, in fact. I had encountered problems due to how I was storing the values and once I resolved that it was smooth sailing. THANKS!

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by