help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: load ascii data to octave(complex value)


From: Macy
Subject: Re: load ascii data to octave(complex value)
Date: Tue, 9 Aug 2011 08:38:16 -0700

load value.asc;
rv=value(:,2)';
iv=value(:,3)';
nucomplexvalue=rv+1i*iv;
size(nucomplexvalue)


--- address@hidden wrote:

From: 손민경<address@hidden>
To: <address@hidden>
Subject: load ascii data to octave(complex value)
Date: Tue, 09 Aug 2011 21:12:45 +0900

I have
'value.asc'
 as follows. (ascii)
 1 1.000000 0.000000 2 0.157376 -0.987539 3 -0.165522 -0.986206 4 0.995348 
-0.096349 5 0.986746 -0.162273 6 0.802929 0.596075 7 0.629992 -0.776601 8 
-0.182941 -0.983124 9 -0.434815 -0.900520 10 -0.227926 -0.973678 11 -0.030833 
-0.999524 12 -0.748147 -0.663533 13 0.718962 -0.695050 14 0.777737 0.628590 15 
0.340350 0.940299 16 0.115246 0.993337
idummy / real part / imaginary part
What I want to do is..
a construction 4*4 complex matrix A using those values.
A=[2+3i 1+2i -1+3i 3+3i; 3-1i 2-2i -2-3i 3-1i; ....
This is a semi-code about what I'm thinking..
open('values.asc')for j=1,4for k=1,4 //'because data is from 4*4 complex matrix 
read('values.asc') idummy, real, imaginary 
complexMatrixA(j,k)=(real)+(imainary)*i // or 
complexMatrixA(j,k)=cmplx(real,imaginary)
please help me...................


_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]