Hi dears,
I am new member of mathgroups,my outputs in matlab are as complex numbers,I want to know how can I write them into an excel file.
Thanks
Maryam
|
|
0
|
|
|
|
Reply
|
maryam
|
5/19/2010 9:49:04 AM |
|
"maryam " <maryam_tayefi@yahoo.com> wrote in message <ht0c6g$jqe$1@fred.mathworks.com>...
> Hi dears,
> I am new member of mathgroups,my outputs in matlab are as complex numbers,I want to know how can I write them into an excel file.
> Thanks
> Maryam
Hey,
store the complex numbers in a matrix and use the 'xlswrite' function.
|
|
0
|
|
|
|
Reply
|
Varun
|
5/19/2010 10:02:05 AM
|
|
"Varun " <var3161@yahoo.co.in> wrote in message <ht0cut$8n9$1@fred.mathworks.com>...
> "maryam " <maryam_tayefi@yahoo.com> wrote in message <ht0c6g$jqe$1@fred.mathworks.com>...
> > Hi dears,
> > I am new member of mathgroups,my outputs in matlab are as complex numbers,I want to know how can I write them into an excel file.
> > Thanks
> > Maryam
>
> Hey,
>
> store the complex numbers in a matrix and use the 'xlswrite' function.
Dear Varun,
Many thanks for your reply, I have already stored the data which are complex number in a matrix but xlswrite function writes the real unit in a excel file only and discards the imaginary unit. What can I do to solve this problem?
Thanks,
Maryam
|
|
0
|
|
|
|
Reply
|
maryam
|
5/19/2010 10:30:26 AM
|
|
On May 19, 10:30=A0pm, "maryam " <maryam_tay...@yahoo.com> wrote:
> "Varun " <var3...@yahoo.co.in> wrote in message <ht0cut$8n...@fred.mathwo=
rks.com>...
> > "maryam " <maryam_tay...@yahoo.com> wrote in message <ht0c6g$jq...@fred=
..mathworks.com>...
> > > Hi dears,
> > > I am new member of mathgroups,my outputs in matlab are as complex num=
bers,I want to know how can I write them into an excel file. =A0
> > > Thanks
> > > Maryam
>
> > Hey,
>
> > store the complex numbers in a matrix and use the 'xlswrite' function.
>
> Dear Varun,
> Many thanks for your reply, I have already stored the data which are comp=
lex number in a matrix but xlswrite function writes the real unit in a exce=
l file only and discards the imaginary unit. What can I do to solve this pr=
oblem?
>
> Thanks,
> Maryam
I wasn't aware that Excel could handle complex numbers.
What version are you using?
|
|
0
|
|
|
|
Reply
|
TideMan
|
5/19/2010 10:49:54 AM
|
|
"maryam " <maryam_tayefi@yahoo.com> wrote in message <ht0ek2$p0s$1@fred.mathworks.com>...
> "Varun " <var3161@yahoo.co.in> wrote in message <ht0cut$8n9$1@fred.mathworks.com>...
> > "maryam " <maryam_tayefi@yahoo.com> wrote in message <ht0c6g$jqe$1@fred.mathworks.com>...
> > > Hi dears,
> > > I am new member of mathgroups,my outputs in matlab are as complex numbers,I want to know how can I write them into an excel file.
> > > Thanks
> > > Maryam
> >
> > Hey,
> >
> > store the complex numbers in a matrix and use the 'xlswrite' function.
>
> Dear Varun,
> Many thanks for your reply, I have already stored the data which are complex number in a matrix but xlswrite function writes the real unit in a excel file only and discards the imaginary unit. What can I do to solve this problem?
>
> Thanks,
> Maryam
Hey Maryam,
just convert all the complex numbers in the matrix to string using 'num2str' and then use 'xlswrite'. I think that should work.
Regards,
Varun
|
|
0
|
|
|
|
Reply
|
Varun
|
5/19/2010 11:16:07 AM
|
|
"maryam " <maryam_tayefi@yahoo.com> wrote in message <ht0c6g$jqe$1@fred.mathworks.com>...
> Hi dears,
> I am new member of mathgroups,my outputs in matlab are as complex numbers,I want to know how can I write them into an excel file.
> Thanks
> Maryam
Simplest solution:
put the complex numbers into cell array, then use xlswrite.
|
|
0
|
|
|
|
Reply
|
ade77
|
5/19/2010 3:47:04 PM
|
|
Hi maryam,
I have no idea on what your code is about, so maybe the following suggestion is not convenient to implement...
It's just an idea. How about creating for each of your complex numbers in Matlab separate matrices / arrays with its real and imaginary parts.
c = sqrt(-1)
c =
0 + 1.0000i
rpart = real(c)
rpart =
0
ipart = imag(c)
ipart =
1
You may then write rpart and ipart into Excel by xlswrite. In Excel 2003 e.g. there is function =complex(real_num,i_num,suffix) that converts the two supplements into a complex number. From a practical point of view, I think this is cumbersome and you may need control over eventual complex numbers in your output. I would love to help you, but I am not strong enough in programming for that...
Good luck!
|
|
0
|
|
|
|
Reply
|
tinne123
|
5/19/2010 5:26:04 PM
|
|
"maryam " <maryam_tayefi@yahoo.com> wrote in message <ht0c6g$jqe$1@fred.mathworks.com>...
> Hi dears,
> I am new member of mathgroups,my outputs in matlab are as complex numbers,I want to know how can I write them into an excel file.
> Thanks
> Maryam
Hi,
I had the same problem and there is a small piece of code for your help
Considering Cnoise, as a 2-D complex matrix . then the complex data can be written to excel using the following code
%%%%%%%%%%%%%
a=strcat('=COMPLEX(',num2str(real(Cnoise(:))),',',num2str(imag(Cnoise(:))),')');
b=mat2cell(a,ones(1,size(a,1)),size(a,2));
d=(reshape(b,size(Cnoise,1),size(Cnoise,2)));
xlswrite('Noise.xlsx',d,1); %Write Attenuation
%%%%%%%%%%%%%
It worked for me, I hope this helps you too.
Kind Regards
Dr. Saqib Ali
|
|
0
|
|
|
|
Reply
|
saqib78 (1)
|
11/18/2011 6:14:29 PM
|
|
|
7 Replies
580 Views
(page loaded in 0.422 seconds)
Similiar Articles: Formatting a cell in Excel file using xlswrite - comp.soft-sys ...Writing in from excel - comp.soft-sys.matlab Formatting a cell in Excel file using xlswrite - comp.soft-sys ... write output to excel - comp.soft-sys.matlab Formatting a ... xlswrite to merged cells - comp.soft-sys.matlabI have a cell array that I want to write to a cell in Excel, say 'E1'. However, for ... write output to excel - comp.soft-sys.matlab how to use xlswrite for image files ... Run awk95 using VBA Shell(...) in Excel 2000 - comp.lang.awk ...write output to excel - comp.soft-sys.matlab Run awk95 using VBA Shell(...) in Excel 2000 - comp.lang.awk ... For error output: Write all output to a file defined in your ... active x - formatting excel cells from Matlab - comp.soft-sys ...write output to excel - comp.soft-sys.matlab active x - formatting excel cells from Matlab - comp.soft-sys ... write output to excel - comp.soft-sys.matlab active x ... error writing to new file - comp.emacswrite output to excel - comp.soft-sys.matlab > > > Hi dears, > > > I am new member of ... For error output: Write all output to a file defined in your awk. ... how to write multi column listbox? - comp.lang.java.guiwrite output to excel - comp.soft-sys.matlab... my outputs in matlab are as complex numbers,I want to know how can I write them into ... Naming columns in output excel ... Error when using xlswrite - comp.soft-sys.matlabMy solution was simply to not write the cells that I skipped when creating the cell array for the output to Excel. Hope this helps, Steve Reshaping Matrix when "Blocks" Have Unequal Number of Rows - comp ...write output to excel - comp.soft-sys.matlab... Many thanks for your reply, I have already stored the data which are complex number in a matrix ... size(a,1)),size(a,2 ... Arena - Reading Formatted Input from File - comp.simulation ...... for trying %g - one of the example files which come with Arena uses %g for writing output ... Re: Question about read in Excel date data - comp.soft-sys.sas ..... could ... Parsing report output. - comp.lang.awkwrite output to excel - comp.soft-sys.matlab parsing output for Excel - comp.lang.awk I run a script that does some checks on many ... with Query output by Tim Garver If ... Write a Excel file with Query output by Tim GarverIf you are like me, my bosses all ask for reports. This is how I give them the reports. I use an advanced query to pull the appropriate data then write it all in an ... MS Access Output to Excel | eHow.comHow to Append a PowerShell Output to an XLS Excel File. Windows PowerShell is a command ... How to Write an Excel File from the COBOL Program 7/23/2012 7:44:11 PM
|