how to transfer complex results into excel??
8 次查看(过去 30 天)
显示 更早的评论
when i am copying my complex results using xlsread command its copying only the real part and not imaginary part.please help
3 个评论
Hikaru
2014-8-7
xlsread Read Microsoft Excel spreadsheet file.
xlswrite Write to Microsoft Excel spreadsheet file.
回答(2 个)
Azzi Abdelmalek
2014-8-7
[a,b,c]=xlsread('file.xlsx')
idx=cellfun(@isstr,c)
c(idx)=cellfun(@str2num,c(idx),'un',0)
2 个评论
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
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)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!