Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Complex structure to text file

Subject: Complex structure to text file

From: Anthony

Date: 09 Aug, 2007 19:31:33

Message: 1 of 17

I am trying to take a data that's in a matrix in matlab and
output it to a file. In each cell there is a complex
number. Is there a way to write this complex number to a
file? and maintain the precision, or change the precision?

Subject: Re: Complex structure to text file

From: Rick Rosson

Date: 09 Aug, 2007 20:13:02

Message: 2 of 17

Hi Anthony,

It is definitely possible to write complex numbers to a text file, but the
exact syntax depends on how you want to format the numbers.

  1. Do you want to show the numbers as strings using "i" or "j"
     to represent the imaginary unit? For example:

        2.512 + 3.718i OR
        2.512 + 3.718j

  2. How do you want the numbers delimited? In other words, do
     you want to separate each element with a space, a comma, a
     tab, or some other character?

Thanks.

Rick


"Anthony " <anthony.campos@baesystems.com> wrote in message
news:f9fq2l$2vi$1@fred.mathworks.com...
>I am trying to take a data that's in a matrix in matlab and
> output it to a file. In each cell there is a complex
> number. Is there a way to write this complex number to a
> file? and maintain the precision, or change the precision?


Subject: Re: Complex structure to text file

From: Anthony

Date: 09 Aug, 2007 20:20:00

Message: 3 of 17

It would be nice to have one complex number per row, in the
following format:
a + bi

"Rick Rosson" <rrosson@mathworks.com> wrote in message
<f9fsgh$a17$1@fred.mathworks.com>...
> Hi Anthony,
>
> It is definitely possible to write complex numbers to a
text file, but the
> exact syntax depends on how you want to format the
numbers.
>
> 1. Do you want to show the numbers as strings using "i"
or "j"
> to represent the imaginary unit? For example:
>
> 2.512 + 3.718i OR
> 2.512 + 3.718j
>
> 2. How do you want the numbers delimited? In other
words, do
> you want to separate each element with a space, a
comma, a
> tab, or some other character?
>
> Thanks.
>
> Rick
>
>
> "Anthony " <anthony.campos@baesystems.com> wrote in
message
> news:f9fq2l$2vi$1@fred.mathworks.com...
> >I am trying to take a data that's in a matrix in matlab
and
> > output it to a file. In each cell there is a complex
> > number. Is there a way to write this complex number to a
> > file? and maintain the precision, or change the
precision?
>
>

Subject: Re: Complex structure to text file

From: Rick Rosson

Date: 09 Aug, 2007 20:26:34

Message: 4 of 17


As an example, you could try something like this:

    imchar = 'j';

    [ M N ] = size(X);

    filename = 'myData.txt';
    fid = fopen(filename,'w');

    for row = 1:M

        for col = 1:N
            fprintf(fid,'%f + %f%c
',real(X(row,col)),imag(X(row,col)),imchar);
        end

        fprintf(fid,'\n');

    end

    fclose(fid);


where 'X' is an array of complex-valued numbers.


Rick



"Anthony " <anthony.campos@baesystems.com> wrote in message
news:f9fq2l$2vi$1@fred.mathworks.com...
>I am trying to take a data that's in a matrix in matlab and
> output it to a file. In each cell there is a complex
> number. Is there a way to write this complex number to a
> file? and maintain the precision, or change the precision?


Subject: Re: Complex structure to text file

From: Rick Rosson

Date: 09 Aug, 2007 20:32:36

Message: 5 of 17

Hi Anthony,

I send the previous solution before I saw your latest response. To create a
file with one number on each line, try the following:


    imchar = 'i';

    L = length(X(:));

    filename = 'myData.txt';
    fid = fopen(filename,'w');

    for k = 1:L
        fprintf(fid,'%f + %f%c ',real(X(k)),imag(X(k)),imchar);
        fprintf(fid,'\n');

    end

    fclose(fid);


I hope that helps.

Thanks.

Rick



"Anthony " <anthony.campos@baesystems.com> wrote in message
news:f9fstg$ft6$1@fred.mathworks.com...
> It would be nice to have one complex number per row, in the
> following format:
> a + bi
>
> "Rick Rosson" <rrosson@mathworks.com> wrote in message
> <f9fsgh$a17$1@fred.mathworks.com>...
>> Hi Anthony,
>>
>> It is definitely possible to write complex numbers to a
> text file, but the
>> exact syntax depends on how you want to format the
> numbers.
>>
>> 1. Do you want to show the numbers as strings using "i"
> or "j"
>> to represent the imaginary unit? For example:
>>
>> 2.512 + 3.718i OR
>> 2.512 + 3.718j
>>
>> 2. How do you want the numbers delimited? In other
> words, do
>> you want to separate each element with a space, a
> comma, a
>> tab, or some other character?
>>
>> Thanks.
>>
>> Rick
>>
>>
>> "Anthony " <anthony.campos@baesystems.com> wrote in
> message
>> news:f9fq2l$2vi$1@fred.mathworks.com...
>> >I am trying to take a data that's in a matrix in matlab
> and
>> > output it to a file. In each cell there is a complex
>> > number. Is there a way to write this complex number to a
>> > file? and maintain the precision, or change the
> precision?
>>
>>
>


Subject: Re: Complex structure to text file

From: Anthony

Date: 09 Aug, 2007 20:47:03

Message: 6 of 17

That worked great. I had to change the 'w' to 'wt' because
it wasn't showing right in notepad. Thanks for your help

"Rick Rosson" <rrosson@mathworks.com> wrote in message
<f9ftl6$qgi$1@fred.mathworks.com>...
> Hi Anthony,
>
> I send the previous solution before I saw your latest
response. To create a
> file with one number on each line, try the following:
>
>
> imchar = 'i';
>
> L = length(X(:));
>
> filename = 'myData.txt';
> fid = fopen(filename,'w');
>
> for k = 1:L
> fprintf(fid,'%f + %f%c ',real(X(k)),imag(X
(k)),imchar);
> fprintf(fid,'\n');
>
> end
>
> fclose(fid);
>
>
> I hope that helps.
>
> Thanks.
>
> Rick
>
>
>
> "Anthony " <anthony.campos@baesystems.com> wrote in
message
> news:f9fstg$ft6$1@fred.mathworks.com...
> > It would be nice to have one complex number per row, in
the
> > following format:
> > a + bi
> >
> > "Rick Rosson" <rrosson@mathworks.com> wrote in message
> > <f9fsgh$a17$1@fred.mathworks.com>...
> >> Hi Anthony,
> >>
> >> It is definitely possible to write complex numbers to a
> > text file, but the
> >> exact syntax depends on how you want to format the
> > numbers.
> >>
> >> 1. Do you want to show the numbers as strings
using "i"
> > or "j"
> >> to represent the imaginary unit? For example:
> >>
> >> 2.512 + 3.718i OR
> >> 2.512 + 3.718j
> >>
> >> 2. How do you want the numbers delimited? In other
> > words, do
> >> you want to separate each element with a space, a
> > comma, a
> >> tab, or some other character?
> >>
> >> Thanks.
> >>
> >> Rick
> >>
> >>
> >> "Anthony " <anthony.campos@baesystems.com> wrote in
> > message
> >> news:f9fq2l$2vi$1@fred.mathworks.com...
> >> >I am trying to take a data that's in a matrix in
matlab
> > and
> >> > output it to a file. In each cell there is a complex
> >> > number. Is there a way to write this complex number
to a
> >> > file? and maintain the precision, or change the
> > precision?
> >>
> >>
> >
>
>

Subject: Re: Complex structure to text file

From: Rick Rosson

Date: 09 Aug, 2007 20:54:09

Message: 7 of 17


Glad to help.

There is some additional formatting you can do with the FPRINTF function.
Take a look at the help for how to adjust the spacing and precision of the
numerical outputs. Type

    doc fprintf

at the command prompt, or search for "fprintf" in the Help Browser.

Rick



"Anthony " <anthony.campos@baesystems.com> wrote in message
news:f9fug7$9lq$1@fred.mathworks.com...
> That worked great. I had to change the 'w' to 'wt' because
> it wasn't showing right in notepad. Thanks for your help
>
> "Rick Rosson" <rrosson@mathworks.com> wrote in message
> <f9ftl6$qgi$1@fred.mathworks.com>...
>> Hi Anthony,
>>
>> I send the previous solution before I saw your latest
> response. To create a
>> file with one number on each line, try the following:
>>
>>
>> imchar = 'i';
>>
>> L = length(X(:));
>>
>> filename = 'myData.txt';
>> fid = fopen(filename,'w');
>>
>> for k = 1:L
>> fprintf(fid,'%f + %f%c ',real(X(k)),imag(X
> (k)),imchar);
>> fprintf(fid,'\n');
>>
>> end
>>
>> fclose(fid);
>>
>>
>> I hope that helps.
>>
>> Thanks.
>>
>> Rick
>>
>>
>>
>> "Anthony " <anthony.campos@baesystems.com> wrote in
> message
>> news:f9fstg$ft6$1@fred.mathworks.com...
>> > It would be nice to have one complex number per row, in
> the
>> > following format:
>> > a + bi
>> >
>> > "Rick Rosson" <rrosson@mathworks.com> wrote in message
>> > <f9fsgh$a17$1@fred.mathworks.com>...
>> >> Hi Anthony,
>> >>
>> >> It is definitely possible to write complex numbers to a
>> > text file, but the
>> >> exact syntax depends on how you want to format the
>> > numbers.
>> >>
>> >> 1. Do you want to show the numbers as strings
> using "i"
>> > or "j"
>> >> to represent the imaginary unit? For example:
>> >>
>> >> 2.512 + 3.718i OR
>> >> 2.512 + 3.718j
>> >>
>> >> 2. How do you want the numbers delimited? In other
>> > words, do
>> >> you want to separate each element with a space, a
>> > comma, a
>> >> tab, or some other character?
>> >>
>> >> Thanks.
>> >>
>> >> Rick
>> >>
>> >>
>> >> "Anthony " <anthony.campos@baesystems.com> wrote in
>> > message
>> >> news:f9fq2l$2vi$1@fred.mathworks.com...
>> >> >I am trying to take a data that's in a matrix in
> matlab
>> > and
>> >> > output it to a file. In each cell there is a complex
>> >> > number. Is there a way to write this complex number
> to a
>> >> > file? and maintain the precision, or change the
>> > precision?
>> >>
>> >>
>> >
>>
>>
>


Subject: Re: Complex structure to text file

From: us

Date: 09 Aug, 2007 21:50:25

Message: 8 of 17

Anthony:
<SNIP textual complexity...

one of the many solutions

% the data
     fnam='foo.txt'; % <- your file name
     rr=pi*(1:10);
     ii=1:numel(rr);
     c=complex(rr.',ii.');
% the engine
     dlmwrite(fnam,c,...
             'delimiter','\t',...
             'precision','%.4f %.1f i');
% the result
     c
     type(fnam)

us

Subject: Re: Complex structure to text file

From: Jamie James

Date: 27 Nov, 2007 18:46:09

Message: 9 of 17

"Rick Rosson" <rrosson@mathworks.com> wrote in message
<f9futi$fmb$1@fred.mathworks.com>...
>
> Glad to help.
>
> There is some additional formatting you can do with the
FPRINTF function.
> Take a look at the help for how to adjust the spacing
and precision of the
> numerical outputs. Type
>
> doc fprintf
>
> at the command prompt, or search for "fprintf" in the
Help Browser.
>
> Rick
>
>
>
> "Anthony " <anthony.campos@baesystems.com> wrote in
message
> news:f9fug7$9lq$1@fred.mathworks.com...
> > That worked great. I had to change the 'w' to 'wt'
because
> > it wasn't showing right in notepad. Thanks for your
help
> >
> > "Rick Rosson" <rrosson@mathworks.com> wrote in message
> > <f9ftl6$qgi$1@fred.mathworks.com>...
> >> Hi Anthony,
> >>
> >> I send the previous solution before I saw your latest
> > response. To create a
> >> file with one number on each line, try the following:
> >>
> >>
> >> imchar = 'i';
> >>
> >> L = length(X(:));
> >>
> >> filename = 'myData.txt';
> >> fid = fopen(filename,'w');
> >>
> >> for k = 1:L
> >> fprintf(fid,'%f + %f%c ',real(X(k)),imag(X
> > (k)),imchar);
> >> fprintf(fid,'\n');
> >>
> >> end
> >>
> >> fclose(fid);
> >>
> >>
> >> I hope that helps.
> >>
> >> Thanks.
> >>
> >> Rick
> >>
> >>
> >>
> >> "Anthony " <anthony.campos@baesystems.com> wrote in
> > message
> >> news:f9fstg$ft6$1@fred.mathworks.com...
> >> > It would be nice to have one complex number per
row, in
> > the
> >> > following format:
> >> > a + bi
> >> >
> >> > "Rick Rosson" <rrosson@mathworks.com> wrote in
message
> >> > <f9fsgh$a17$1@fred.mathworks.com>...
> >> >> Hi Anthony,
> >> >>
> >> >> It is definitely possible to write complex numbers
to a
> >> > text file, but the
> >> >> exact syntax depends on how you want to format the
> >> > numbers.
> >> >>
> >> >> 1. Do you want to show the numbers as strings
> > using "i"
> >> > or "j"
> >> >> to represent the imaginary unit? For example:
> >> >>
> >> >> 2.512 + 3.718i OR
> >> >> 2.512 + 3.718j
> >> >>
> >> >> 2. How do you want the numbers delimited? In
other
> >> > words, do
> >> >> you want to separate each element with a
space, a
> >> > comma, a
> >> >> tab, or some other character?
> >> >>
> >> >> Thanks.
> >> >>
> >> >> Rick
> >> >>
> >> >>
> >> >> "Anthony " <anthony.campos@baesystems.com> wrote in
> >> > message
> >> >> news:f9fq2l$2vi$1@fred.mathworks.com...
> >> >> >I am trying to take a data that's in a matrix in
> > matlab
> >> > and
> >> >> > output it to a file. In each cell there is a
complex
> >> >> > number. Is there a way to write this complex
number
> > to a
> >> >> > file? and maintain the precision, or change the
> >> > precision?
> >> >>
> >> >>
> >> >
> >>
> >>
> >
>
>

Subject: Re: Complex structure to text file

From: Jamie James

Date: 27 Nov, 2007 18:53:40

Message: 10 of 17

Hello Rick,

I have been loking at you solution for writing complex
data in a file using fprintf. That will work well, if your
imaginary number is always positive.

I am in the same situation, but my imaginary number might
change a sign, then using the solution posted on web, e.g.,
gives me a+-jb, what I will be looking for a-jb

Could you please help, to write complex structure in a
file for negative imaginary number.

Thanks in advance.
Jamie



"Rick Rosson" <rrosson@mathworks.com> wrote in message
<f9futi$fmb$1@fred.mathworks.com>...
>
> Glad to help.
>
> There is some additional formatting you can do with the
FPRINTF function.
> Take a look at the help for how to adjust the spacing
and precision of the
> numerical outputs. Type
>
> doc fprintf
>
> at the command prompt, or search for "fprintf" in the
Help Browser.
>
> Rick
>
>
>
> "Anthony " <anthony.campos@baesystems.com> wrote in
message
> news:f9fug7$9lq$1@fred.mathworks.com...
> > That worked great. I had to change the 'w' to 'wt'
because
> > it wasn't showing right in notepad. Thanks for your
help
> >
> > "Rick Rosson" <rrosson@mathworks.com> wrote in message
> > <f9ftl6$qgi$1@fred.mathworks.com>...
> >> Hi Anthony,
> >>
> >> I send the previous solution before I saw your latest
> > response. To create a
> >> file with one number on each line, try the following:
> >>
> >>
> >> imchar = 'i';
> >>
> >> L = length(X(:));
> >>
> >> filename = 'myData.txt';
> >> fid = fopen(filename,'w');
> >>
> >> for k = 1:L
> >> fprintf(fid,'%f + %f%c ',real(X(k)),imag(X
> > (k)),imchar);
> >> fprintf(fid,'\n');
> >>
> >> end
> >>
> >> fclose(fid);
> >>
> >>
> >> I hope that helps.
> >>
> >> Thanks.
> >>
> >> Rick
> >>
> >>
> >>
> >> "Anthony " <anthony.campos@baesystems.com> wrote in
> > message
> >> news:f9fstg$ft6$1@fred.mathworks.com...
> >> > It would be nice to have one complex number per
row, in
> > the
> >> > following format:
> >> > a + bi
> >> >
> >> > "Rick Rosson" <rrosson@mathworks.com> wrote in
message
> >> > <f9fsgh$a17$1@fred.mathworks.com>...
> >> >> Hi Anthony,
> >> >>
> >> >> It is definitely possible to write complex numbers
to a
> >> > text file, but the
> >> >> exact syntax depends on how you want to format the
> >> > numbers.
> >> >>
> >> >> 1. Do you want to show the numbers as strings
> > using "i"
> >> > or "j"
> >> >> to represent the imaginary unit? For example:
> >> >>
> >> >> 2.512 + 3.718i OR
> >> >> 2.512 + 3.718j
> >> >>
> >> >> 2. How do you want the numbers delimited? In
other
> >> > words, do
> >> >> you want to separate each element with a
space, a
> >> > comma, a
> >> >> tab, or some other character?
> >> >>
> >> >> Thanks.
> >> >>
> >> >> Rick
> >> >>
> >> >>
> >> >> "Anthony " <anthony.campos@baesystems.com> wrote in
> >> > message
> >> >> news:f9fq2l$2vi$1@fred.mathworks.com...
> >> >> >I am trying to take a data that's in a matrix in
> > matlab
> >> > and
> >> >> > output it to a file. In each cell there is a
complex
> >> >> > number. Is there a way to write this complex
number
> > to a
> >> >> > file? and maintain the precision, or change the
> >> > precision?
> >> >>
> >> >>
> >> >
> >>
> >>
> >
>
>

Subject: Re: Complex structure to text file

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 27 Nov, 2007 19:05:27

Message: 11 of 17

In article <fihp3k$sau$1@fred.mathworks.com>,
Jamie James <jamie.james.nospam@mathworks.com> wrote:

Please do not post your reply at the top of what you are
commenting on: it makes it more difficult to hold a conversation.

>> > "Rick Rosson" <rrosson@mathworks.com> wrote in message
>> > <f9ftl6$qgi$1@fred.mathworks.com>...

>> >> for k = 1:L
>> >> fprintf(fid,'%f + %f%c ',real(X(k)),imag(X
>> > (k)),imchar);
>> >> fprintf(fid,'\n');
>> >>
>> >> end

>I am in the same situation, but my imaginary number might
>change a sign, then using the solution posted on web, e.g.,
>gives me a+-jb, what I will be looking for a-jb

signs = '-++';

for k = 1:L
   fprintf(fid, '%f %c %f%c ', real(X(k)), signs(2+sign(imag(X(k)))), ...
           imag(X(k)), imchar)
end
fprintf(fid, '\n');

sign(x) is -1, 0, or 1; add 2 to that to take it to the range
1 2 3, which you then index into the signs() table of characters
to print out to indicate the sign.
--
  "All is vanity." -- Ecclesiastes

Subject: Re: Complex structure to text file

From: Peter Boettcher

Date: 27 Nov, 2007 19:35:10

Message: 12 of 17

"Jamie James" <jamie.james.nospam@mathworks.com> writes:

> Hello Rick,
>
> I have been loking at you solution for writing complex
> data in a file using fprintf. That will work well, if your
> imaginary number is always positive.
>
> I am in the same situation, but my imaginary number might
> change a sign, then using the solution posted on web, e.g.,
> gives me a+-jb, what I will be looking for a-jb
>
> Could you please help, to write complex structure in a
> file for negative imaginary number.

fprintf('%f%+fi\n', real(x), imag(x));

The trick is the %+f flag, which says print the sign of the variable,
even if it's plus.

-Peter

Subject: Re: Complex structure to text file

From: Jamie James

Date: 28 Nov, 2007 09:45:41

Message: 13 of 17

Peter Boettcher <boettcher@ll.mit.edu> wrote in message
<muyhcj78osx.fsf@G99-Boettcher.llan.ll.mit.edu>...
> "Jamie James" <jamie.james.nospam@mathworks.com> writes:
>
> > Hello Rick,
> >
> > I have been loking at you solution for writing complex
> > data in a file using fprintf. That will work well, if
your
> > imaginary number is always positive.
> >
> > I am in the same situation, but my imaginary number
might
> > change a sign, then using the solution posted on web,
e.g.,
> > gives me a+-jb, what I will be looking for a-jb
> >
> > Could you please help, to write complex structure in a
> > file for negative imaginary number.
>
> fprintf('%f%+fi\n', real(x), imag(x));
>
> The trick is the %+f flag, which says print the sign of
the variable,
> even if it's plus.
>
> -Peter
***********************************************************
Peter,

That works, great. Thanks for the help.
JamieJames

Subject: Re: Complex structure to text file

From: Jamie James

Date: 28 Nov, 2007 09:51:15

Message: 14 of 17

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fihppn$ipt$1@canopus.cc.umanitoba.ca>...
> In article <fihp3k$sau$1@fred.mathworks.com>,
> Jamie James <jamie.james.nospam@mathworks.com> wrote:
>
> Please do not post your reply at the top of what you are
> commenting on: it makes it more difficult to hold a
conversation.
>
> >> > "Rick Rosson" <rrosson@mathworks.com> wrote in
message
> >> > <f9ftl6$qgi$1@fred.mathworks.com>...
>
> >> >> for k = 1:L
> >> >> fprintf(fid,'%f + %f%c ',real(X(k)),imag(X
> >> > (k)),imchar);
> >> >> fprintf(fid,'\n');
> >> >>
> >> >> end
>
> >I am in the same situation, but my imaginary number
might
> >change a sign, then using the solution posted on web,
e.g.,
> >gives me a+-jb, what I will be looking for a-jb
>
> signs = '-++';
>
> for k = 1:L
> fprintf(fid, '%f %c %f%c ', real(X(k)), signs(2+sign
(imag(X(k)))), ...
> imag(X(k)), imchar)
> end
> fprintf(fid, '\n');
>
> sign(x) is -1, 0, or 1; add 2 to that to take it to the
range
> 1 2 3, which you then index into the signs() table of
characters
> to print out to indicate the sign.
> --
> "All is vanity." --
Ecclesiastes
***********************************************************
Hello Walter,

Have a comment about your soultion, it will not work, e.g.,
in a case, if you have a complex number with the negative
sign,e.g., a-jb. Because signs(2+sign(imag(X(k)))) will
return a value of 1 (if the imaginary part is neagtive),so
from the the signs'-++', the '-' will be selected and the
final result will be in the form a- -jb.

Thanks for your reply.

Jamie


Subject: Re: Complex structure to text file

From: us

Date: 29 Nov, 2007 20:04:11

Message: 15 of 17

"Jamie James"
<SNIP complex complexity...

a hint:

the utility array2str, which is available on the FEX, most
likely does exactly what you want

http://www.mathworks.com/matlabcentral/fileexchange/loadFile
.do?objectId=17484&objectType=FILE

it comes with many options and may serve as a nice front
end engine for appps that require a certain ascii input...

just a thought
us

Subject: Re: Complex structure to text file

From: Randy Poe

Date: 29 Nov, 2007 20:24:46

Message: 16 of 17

On Nov 29, 3:04 pm, "us " <u...@neurol.unizh.ch> wrote:
> "Jamie James"
> <SNIP complex complexity...
>
> a hint:
>
> the utility array2str, which is available on the FEX, most
> likely does exactly what you want
>
> http://www.mathworks.com/matlabcentral/fileexchange/loadFile
> .do?objectId=17484&objectType=FILE
>
> it comes with many options and may serve as a nice front
> end engine for appps that require a certain ascii input...
>
> just a thought
> us

My utility WRITEVAR does a similar function.
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=989&objectType=file

             - Randy

Subject: Re: Complex structure to text file

From: Prabhat Shankar

Date: 20 Jun, 2008 14:47:02

Message: 17 of 17

"Anthony " <anthony.campos@baesystems.com> wrote in message
<f9fq2l$2vi$1@fred.mathworks.com>...
> I am trying to take a data that's in a matrix in matlab and
> output it to a file. In each cell there is a complex
> number. Is there a way to write this complex number to a
> file? and maintain the precision, or change the precision?

Hi Anthony
You can use function num2str for this purpose. For example :

x = 1 + 2 * i
fprintf ( 1, 'X = %s\n', num2str ( x ) );

This works for both +ve as well as -ve imaginary parts and
you won't have to do other tricks as mentioned in the other
solutions.
Hope that helps.

Prabhat

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
array2str us 29 Nov, 2007 15:05:04
fex us 29 Nov, 2007 15:05:04
reference us 29 Nov, 2007 15:05:04
dlmwrite us 09 Aug, 2007 17:55:35
file io us 09 Aug, 2007 17:55:35
code us 09 Aug, 2007 17:55:35
complex Anthony 09 Aug, 2007 15:35:03
read Anthony 09 Aug, 2007 15:35:03
write Anthony 09 Aug, 2007 15:35:03
file Anthony 09 Aug, 2007 15:35:03
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics