convert two columns( one real number and the other is imaginary but without (i) symbol) in txt file to complex number and one column.

조회 수: 3 (최근 30일)
Hello, I have two columns in a (txt file or xls file I have both) one represent the real part of a complex number and the other represent the imaganary part( without symbol (i)) of the complex number. I want to make one column and each cell in that column countain a complex number by adding the two columns with the considration there is no (i) symble in the imaganary number so we should add it and represent it as imaganary part.

채택된 답변

Star Strider
Star Strider 2019년 3월 14일
Try this:
D = xlsread('New Microsoft Excel Worksheet.xlsx');
Cplx = complex(D(:,1),D(:,2));

추가 답변 (1개)

dpb
dpb 2019년 3월 14일
Use xlsread or what other import functions you care to use to read the data depending on how much of the header info you need, then
c=complex(real_part,imag_part);

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by