help-octave
[Top][All Lists]
Advanced

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

Fw: how loading a data file with complex number from a\ .dat\ file to a


From: Tina Shord
Subject: Fw: how loading a data file with complex number from a\ .dat\ file to a matrix in octave
Date: Mon, 17 Oct 2011 14:07:20 -0700 (PDT)



Dear octave users,

I am a beginner in octave software. for doing my projects I needed to load data from a \ .dat\ file by octave.
when my \ .dat\ file was like this:

transmitted field:,    0.0,          0.0
transmitted field:,    0.025,     2.499
transmitted field:,    0.050,     8.744
transmitted field:,    0.075,     0.001
.
.
.

I used the following command to load this two column number and collect them in a matrix:

fid = fopen (transmited_data_file, 'r'); ‍
[val, count] = fscanf (fid, ' transmited field:, %f , %f', Inf);
fclose(fid);

    
but now my \.dat\ file consist complex number like this:

transmitted field:,    0.0,          0.0
transmitted field:,    0.025,     2.49980469004312e-4-3.12491862042745e-6i
transmitted field:,    0.050,     8.74462952547355e-4-2.96808679768089e-5i
transmitted field:,    0.075,     0.00159104818877218-9.17427368087194e-5i
transmitted field:,    0.1,          0.00216403420364298-1.87084801577104e-4i
transmitted field:,    0.125,     0.00255133003954042-3.06091873691879e-4i
transmitted field:,    0.15,        0.00288402756349901-4.4210946665116e-4i
transmitted field:,    0.175,     0.00331455558925927-5.96758485768472e-4i
.
.
and above command can not load complex numbers.I really don't know what command I should use
to load these complex number.
It would be a great hand if you help me and I will be great full.

regards,
tina,
address@hidden







tr



reply via email to

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