how to transfer complex results into excel??

조회 수: 18 (최근 30일)
saba
saba 2014년 8월 7일
댓글: Hikaru 2014년 8월 7일
when i am copying my complex results using xlsread command its copying only the real part and not imaginary part.please help
  댓글 수: 3
saba
saba 2014년 8월 7일
its a huge array.i cant copy paste it.
Hikaru
Hikaru 2014년 8월 7일
xlsread Read Microsoft Excel spreadsheet file.
xlswrite Write to Microsoft Excel spreadsheet file.

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

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 8월 7일
[a,b,c]=xlsread('file.xlsx')
idx=cellfun(@isstr,c)
c(idx)=cellfun(@str2num,c(idx),'un',0)
  댓글 수: 2
saba
saba 2014년 8월 7일
sir i get my results as a matrix whose elements are complex numbers. i need to transfer this matrix to excel with each element stored in a cell as xls file
Azzi Abdelmalek
Azzi Abdelmalek 2014년 8월 7일
a=[1+i 2 3;4 i 0;-i 2-i 14]
b=arrayfun(@num2str,a,'un',0)
xlswrite('file.xlsx',b)

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


Hikaru
Hikaru 2014년 8월 7일
Try this.
Say A is a vector containing the complex numbers.
A = [2+3i;3+i;4-2i]; % example
B = num2str(A);
C = cellstr(B);
xlswrite('filename.xlsx',C)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by