<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#330000">
    Hi<br>
    <br>
    <br>
    Actually, i was wrong when I said that <br>
    <pre wrap="">
[a(1) a(2)] = f(b,c,d,e)

is illegal syntax in scilab.


In that case, the problem may come from the format of your processed data table.

Do you know which separators (spaces? tabs?) are used in the raw and in the processed data table? If not, can you join the raw and processed tables?

And, again, are you sure that it will not be preferable to read the whole matrix at once? try this:
help read_csv
</pre>
    <br>
    <br>
    On 16/06/2011 18:58, Peng Du wrote:
    <blockquote
      cite="mid:BANLkTik41W9TjQ_V3mFo-H23gP_PF0kRKw@mail.gmail.com"
      type="cite">
      <pre wrap="">Thanks Adrien,

The thing confuses me is that the method I used works fine with the
un-processed raw data but fails with the processed file which has
basically the same structure.

And how can I loop through the file if I use the fscanfMat?

Regards,

Peng

On 16 June 2011 17:28, Adrien Vogt-Schilb <a class="moz-txt-link-rfc2396E" href="mailto:vogt@centre-cired.fr"><vogt@centre-cired.fr></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi


as far as i know, you cannot use a syntaxe like

[a(1) a(2)] = f(b,c,d,e)

in scilab

a workaround could be

[a1 a2] = f(b,c,d,e)
a = [a1 a2]


in your case, i believe you could use something more direct, like :

val = fscanfMat(fid )

BR,
AVS


On 16/06/2011 18:18, Peng Du wrote:

Hi everyone,

I collected some raw data which looks like:

-112 -100 -95 -91 -114 -112 -95 -90 -112 -112 -113 -107 -100 -109 -111 -106
-70 -98 -95 -111 -114 -114 -113 -111 -113 -103 -112 -109 -111 -112 -114 -112
...

-64 -57 -57 -112 -110 -93 -84 -86 -105 -98 -107 -99 -94 -113 -113 -115
-64 -55 -88 -113 -82 -83 -85 -88 -100 -114 -113 -99 -91 -109 -113 -110

So there are 16 columns per line.

I wrote a c++ program to do some calculation on the raw data and
reproduce a file with similar format which looks like:

-112 -100 -95 -91 -114 -112 -95 -90 -112 -112 -113 -107 -100 -109 -111 -106
-91 -99 -95 -101 -114 -113 -104 -100 -112 -108 -112 -108 -106 -110 -112 -109
-91 -97.3 -98.7 -105 -113 -113 -107 -96.7 -112 -109 -109 -102 -102
-111 -111 -109

Then I tried to read the file in Scilab using:

[num_read, val(1), val(2), val(3), val(4), val(5), val(6), val(7),
val(8),val(9), val(10), val(11), val(12), val(13), val(14), val(15),
val(16)] = mfscanf(fid, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d
%d");

However the raw data work ok, but with the process data file Scilab
always reports "invalid index error". Why this is happening?

Thanks very much.

Regards,

</pre>
      </blockquote>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <style>
<!--
  p
        {margin:0pt;
           color:teal;
           font-family:"Cambria Math"
        font-size:12.0pt;
        }
-->
</style>
      <p><b>Adrien Vogt-Schilb</b></p>
      <p>Research Fellow</p>
      <p><a a="" href="mailto:vogt@centre-cired.fr"
          style="text-decoration: none; color: teal;">vogt@centre-cired.fr</a></p>
      <p>Tel: (+33) 1 43 94 73 96</p>
      <p>Fax: (+33) 1 43 94 73 70</p>
      <table style="border: medium none; margin-left: 1pt; margin-top:
        4pt;" cellspacing="0">
        <tbody>
          <tr>
            <td style="padding: 0pt;">
              <p><img src="cid:part1.07000106.00000303@centre-cired.fr"
                  alt="CIRED" width="54"></p>
            </td>
            <td style="padding: 0pt 7pt;" valign="middle">
              <p style="font-size: 10pt;">45 bis, Av de la Belle
                Gabrielle</p>
              <p style="font-size: 10pt;">F-94736 Nogent-sur-Marne</p>
              <p style="font-size: 10pt;"><a
                  href="http://www.centre-cired.fr/" style="color:
                  teal;">http://www.centre-cired.fr/</a></p>
            </td>
          </tr>
        </tbody>
      </table>
      <p> </p>
    </div>
  </body>
</html>