Re: [Scilab-users] Scan file backward from the end?

2013-03-21 Thread Antoine Monmayrant
 
On Wednesday, March 20, 2013 23.43 CET, Serge Steer serge.st...@inria.fr 
wrote: 
 
 If you know the approximate size of the footer in number of bytes (assume N 
 greater than it) you can try to set the pointer N bytes before  the end of 
 file using the 
 u=mopen(myfile);
 mseek(-N,u,'end')
 then read the rest with
 mgetl(-1,u)
 
 Serge

Thanks for the tip, I'll give it a try today.

Cheers,

Antoine
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Computing Performance and debugging in Scilab.

2013-03-21 Thread TViT
Strange, at me houses my computer gives out always 0..
Has tested on the working computer 0.047.
Question I think I shall be closed to understand what a problem of a house.



--
View this message in context: 
http://mailinglists.scilab.org/Computing-Performance-and-debugging-in-Scilab-tp4026287p4026315.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] problem loading enviroment

2013-03-21 Thread Ezequiel Soule
Hello, sometimes, when I try to load an eviroment, I got a message like 
this:


loading initial environment
 Warning : redefining function: %_sodload   . Use 
funcprot(0) to avoid this message

   inside function: createMacro .

= (pos,V,R,calc_D_superp_dobcel(N, N2))
!--error 41
Incompatible output argument.
at line  16 of function coord called by :
at line  13 of function createMacro called by :
at line   8 of function %__convertVariable__ called by :
at line 836 of function %_sodload called by :
 then load(%fileToLoad); disp(msprintf(gettext
while executing a callback


and it does´t load anything. I had no problem saving it, or runing it, 
or manipulating the variables, or any kind of problem before or after 
saving, but it does not load...


there seems to be some problem with some of the functions saved in the 
enviroment but, I repeat, I had no problem saving or running them. I can 
load the variables if I list them (as in 
load(filename,var_1,var_2,...var_n)), but it is really stupid I 
have to do this instead of just loading everything...

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] discrete Fourier transform

2013-03-21 Thread haasejos
hello,
for signalanalysis I would like to use discrete Fourier transform (dft). To
see, how it works, I use the simple example below. Why is *XfA =
abs(Xf)*2/n* respectively why is  XfA = abs(Xf) wrong?

clear; clc; xdel;

function y = f(x);
y = sin(x);
endfunction;
n = 200;
x=linspace(0,2*%pi,n);
y=f(x);

mat = [x',y'];
//disp(mat);
//plot2d(x , y);

//xtitle('DATA','n''','y''');  

Xf=dft(y,-1);
XfA = abs(Xf)*2/n;  
plot2d3([1:n/2]',XfA(1:n/2));




--
View this message in context: 
http://mailinglists.scilab.org/discrete-Fourier-transform-tp4026318.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Help to set parameters in an Xcos Diagram

2013-03-21 Thread cedricbdo
Hello everybody,

I'd like to set  parameters of my scs_m structure for an Xcos Diagram (see
attached file) using command lines.

To be specific I'd like to set the following imulation parameters :

- final integration time

- max integration time interval

I want them to be equal to a dt that I already define in my program. I am
using this code so far :

 

loadXcosLibs() importXcosDiagram('C:\STAMPE_3.5\STAMPE_SRC\essai.xcos');

typeof(scs_m)  // Diagram structure

scs_m.props.tf = dt;// Final integration time

 

xcos_simulate(scs_m,4);

 

But I don't know what command line to use to set the max step of integration
time for my simulation.

 

Also, I'd like to set to dt in the same way the parameters (period,
iniialization time) of the block CLOCK_c which is in my xcos diagram.

I think I must use something like scs_m.objs.something = dt. 

 

I would be very thankful for any help :) essai.xcos
http://mailinglists.scilab.org/file/n4026319/essai.xcos  



--
View this message in context: 
http://mailinglists.scilab.org/Help-to-set-parameters-in-an-Xcos-Diagram-tp4026319.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] discrete Fourier transform

2013-03-21 Thread Serge Steer

Le 21/03/2013 16:41, haasejos a écrit :

hello,
for signalanalysis I would like to use discrete Fourier transform (dft). To
see, how it works, I use the simple example below. Why is *XfA =
abs(Xf)*2/n* respectively why is  XfA = abs(Xf) wrong?

Why do you say that  XfA = abs(Xf) is wrong
Note however. It is much more efficient using fft instead of dft.

Serge Steer


clear; clc; xdel;

function y = f(x);
 y = sin(x);
endfunction;
n = 200;
x=linspace(0,2*%pi,n);
y=f(x);

mat = [x',y'];
//disp(mat);
//plot2d(x , y);

//xtitle('DATA','n''','y''');

Xf=dft(y,-1);
XfA = abs(Xf)*2/n;
plot2d3([1:n/2]',XfA(1:n/2));




--
View this message in context: 
http://mailinglists.scilab.org/discrete-Fourier-transform-tp4026318.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] problem loading enviroment

2013-03-21 Thread TViT
The people, I have checked up houses once again, a problem in that that if to
create test script in a file for example TicToc.sci and to start this file,
shows always 0.00, and if to copy the text to insert and to start in
a command window directly without start of a file. sci (or sce) that shows
0.0160. How it to understand? In what the difference when is
started script from SciNotes???



--
View this message in context: 
http://mailinglists.scilab.org/Computing-Performance-and-debugging-in-Scilab-tp4026287p4026321.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] discrete Fourier transform

2013-03-21 Thread Stefan Du Rietz

On 2013-03-21 17:13, Serge Steer wrote:


Le 21/03/2013 16:41, haasejos a écrit :

hello,
for signalanalysis I would like to use discrete Fourier transform
(dft). To
see, how it works, I use the simple example below. Why is *XfA =
abs(Xf)*2/n* respectively why is  XfA = abs(Xf) wrong?

Why do you say that  XfA = abs(Xf) is wrong
Note however. It is much more efficient using fft instead of dft.

Serge Steer


Maybe haasejos meant and should have used XfA == abs(Xf)

Stefan



clear; clc; xdel;

function y = f(x);
 y = sin(x);
endfunction;
n = 200;
x=linspace(0,2*%pi,n);
y=f(x);

mat = [x',y'];
//disp(mat);
//plot2d(x , y);

//xtitle('DATA','n''','y''');

Xf=dft(y,-1);
XfA = abs(Xf)*2/n;
plot2d3([1:n/2]',XfA(1:n/2));




--
View this message in context:
http://mailinglists.scilab.org/discrete-Fourier-transform-tp4026318.html

Sent from the Scilab users - Mailing Lists Archives mailing list
archive at Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] discrete Fourier transform

2013-03-21 Thread haasejos
good evening,
what I meant is, that XfA(2) should be 1. Because this value can be
understood as the amplitude of sin(x). But  XfA(2) beeing calculated with
XfA=abs(Xf) (see example) returns 100. This is wrong, isn't it?
Josef



--
View this message in context: 
http://mailinglists.scilab.org/discrete-Fourier-transform-tp4026318p4026324.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] discrete Fourier transform

2013-03-21 Thread Mike Page
Hi,

I think this is just a question of scaling.  There is no correct scaling
for the FFT - just some different conventions.  This is explained here
(http://www.mathworks.co.uk/matlabcentral/answers/15770-scaling-the-fft-and-
the-ifft).

The correct answer with Scilab would be exactly 100 (N/2) in your case,
but you have a small error because your waveform is not exactly periodic -
the first and last sample are the same, but you should have the last sample
being the one before the first sample for a complete cycle.

The following code does that:

--n=201;

--x=linspace(0,2*%pi,n);

--x=x(1:200);

--y=sin(x);

--Xf=dft(y,-1);

--XfA = abs(Xf);

--XfA(2)
 ans  =

100.

HTH,
Mike.


-Original Message-
From: users-boun...@lists.scilab.org
[mailto:users-boun...@lists.scilab.org]On Behalf Of haasejos
Sent: 21 March 2013 21:14
To: users@lists.scilab.org
Subject: Re: [Scilab-users] discrete Fourier transform


--n = 200;

--x=linspace(0,2*%pi,n);

--y=sin(x);

--Xf=dft(y,-1);

--XfA = abs(Xf); *please look at the difference! *
--XfA(2)
 ans  =

99.745189



--
View this message in context:
http://mailinglists.scilab.org/discrete-Fourier-transform-tp4026318p4026326.
html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3267 / Virus Database: 3160/6194 - Release Date: 03/21/13

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users