how to transfer complex results into excel??

20 visualizaciones (últimos 30 días)
saba
saba el 7 de Ag. de 2014
Comentada: Hikaru el 7 de Ag. de 2014
when i am copying my complex results using xlsread command its copying only the real part and not imaginary part.please help
  3 comentarios
saba
saba el 7 de Ag. de 2014
its a huge array.i cant copy paste it.
Hikaru
Hikaru el 7 de Ag. de 2014
xlsread Read Microsoft Excel spreadsheet file.
xlswrite Write to Microsoft Excel spreadsheet file.

Iniciar sesión para comentar.

Respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 7 de Ag. de 2014
[a,b,c]=xlsread('file.xlsx')
idx=cellfun(@isstr,c)
c(idx)=cellfun(@str2num,c(idx),'un',0)
  2 comentarios
saba
saba el 7 de Ag. de 2014
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 el 7 de Ag. de 2014
a=[1+i 2 3;4 i 0;-i 2-i 14]
b=arrayfun(@num2str,a,'un',0)
xlswrite('file.xlsx',b)

Iniciar sesión para comentar.


Hikaru
Hikaru el 7 de Ag. de 2014
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)

Community Treasure Hunt

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

Start Hunting!

Translated by