how to transfer complex results into excel??

when i am copying my complex results using xlsread command its copying only the real part and not imaginary part.please help

3 件のコメント

Hikaru
Hikaru 2014 年 8 月 7 日
I'm not sure if I understood your question. You want to copy complex numbers from MATLAB to excel, right? If so, why are you using the xlsread command? How big is the array containing the complex numbers?
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 日

0 投票

[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 日

0 投票

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)

質問済み:

2014 年 8 月 7 日

コメント済み:

2014 年 8 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by