<!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>
as far as i know, you cannot use a syntaxe like <br>
<br>
[a(1) a(2)] = f(b,c,d,e) <br>
<br>
in scilab<br>
<br>
a workaround could be<br>
<br>
[a1 a2] = f(b,c,d,e) <br>
a = [a1 a2]<br>
<br>
<br>
in your case, i believe you could use something more direct, like :
<br>
<br>
val = fscanfMat(fid
)<br>
<br>
BR,<br>
AVS<br>
<br>
<br>
On 16/06/2011 18:18, Peng Du wrote:
<blockquote
cite="mid:BANLkTinc4h=SGQ4OUo-E5tpO3iySDbb-SA@mail.gmail.com"
type="cite">
<pre wrap="">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>
<br>
</body>
</html>