Re: [Scilab-users] Gridding irregular data to apply contour or Sgrayplot

2024-05-30 Thread Federico Miyara


Lester,

Just an idea: if the data lend themselves to it (I mean, they are sufficiently 
smooth), you could interpolate with a uniform grid using interp2().

Regards,

Federico Miyara

On 30/5/2024 11:33, Lester Anderson wrote:
Hello,

Given the attached plot example, is it possible to contour or use Sgrayplot on 
such data if it is not on a regular grid?

The plot is a Kaverina earthquake analysis, and I am looking to generate a 
density plot within the Kaverina plot region only.All arrays have the same 
size, X,Y,data1, data2 etc

Any pointers would be helpful.

Thanks
Lester

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users



[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


[Scilab-users] insert()

2024-01-10 Thread Federico Miyara


Dear All,

I wonder if there is a reason why the function insert() (which allows to
insert elements in a list by moving the entire content to the right of
the intended position to make room for the new element) has never been
documented. Someone told me of its existence a few years ago, and I've
checked that it still works in 2024.0.0. May be it is intended to be
deprecated or has a serious bug?

It would also be useful to have a similar function which worked with
vectors, matrices or even arrays, that allowed to insert an entire new
row, for instance. Something like this:

a = [1 2 3; 4 5 6; 7 8 9]
 a  =
   1.   2.   3.
   4.   5.   6.
   7.   8.   9.
a(2, :) = insert([1 2 3]
 a  =
   1.   2.   3.
   1.   2.   3.
   4.   5.   6.
   7.   8.   9.

Regards,

Federico Miyara


--
Este correo electrónico ha sido analizado en busca de virus por el software 
antivirus de Avast.
www.avast.com
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/



Re: [Scilab-users] Possible bug in mfile2sci

2024-01-03 Thread Federico Miyara


Lester,

I believe an endfunction clause is necessary to terminate the function 
definition. Try adding one at the end

Regards,

Federico Miyara

On 2/1/2024 13:28, Lester Anderson wrote:
Hello,

I have tried to convert the following Matlab code as a whole and even a very 
basic function, but it fails to generate anything!

function [x0,y0,iout,jout] = intersections(x1,y1,x2,y2,robust)
%INTERSECTIONS Intersections of curves.
%   Computes the (x,y) locations where two curves intersect.  The curves
%   can be broken with NaNs or have vertical segments.
%
% Example:
%   [X0,Y0] = intersections(X1,Y1,X2,Y2,ROBUST);
%
% where X1 and Y1 are equal-length vectors of at least two points and
% represent curve 1.  Similarly, X2 and Y2 represent curve 2.
% X0 and Y0 are column vectors containing the points at which the two
% curves intersect.
%
% ROBUST (optional) set to 1 or true means to use a slight variation of the
% algorithm that might return duplicates of some intersection points, and
% then remove those duplicates.  The default is true, but since the
% algorithm is slightly slower you can set it to false if you know that
% your curves don't intersect at any segment boundaries.  Also, the robust
% version properly handles parallel and overlapping segments.
%
% The algorithm can return two additional vectors that indicate which
% segment pairs contain intersections and where they are:
%
%   [X0,Y0,I,J] = intersections(X1,Y1,X2,Y2,ROBUST);
%
% For each element of the vector I, I(k) = (segment number of (X1,Y1)) +
% (how far along this segment the intersection is).  For example, if I(k) =
% 45.25 then the intersection lies a quarter of the way between the line
% segment connecting (X1(45),Y1(45)) and (X1(46),Y1(46)).  Similarly for
% the vector J and the segments in (X2,Y2).
%
% You can also get intersections of a curve with itself.  Simply pass in
% only one curve, i.e.,
%
%   [X0,Y0] = intersections(X1,Y1,ROBUST);
%
% where, as before, ROBUST is optional.
% Version: 2.0, 25 May 2017
% Author:  Douglas M. Schwarz
% Email:   dmschwarz=ieee*org, dmschwarz=urgrad*rochester*edu
% Real_email = regexprep(Email,{'=','*'},{'@','.'})
% Theory of operation:
%
% Given two line segments, L1 and L2,
%
%   L1 endpoints:  (x1(1),y1(1)) and (x1(2),y1(2))
%   L2 endpoints:  (x2(1),y2(1)) and (x2(2),y2(2))
%
% we can write four equations with four unknowns and then solve them.  The
% four unknowns are t1, t2, x0 and y0, where (x0,y0) is the intersection of
% L1 and L2, t1 is the distance from the starting point of L1 to the
% intersection relative to the length of L1 and t2 is the distance from the
% starting point of L2 to the intersection relative to the length of L2.
%
% So, the four equations are
%
%(x1(2) - x1(1))*t1 = x0 - x1(1)
%(x2(2) - x2(1))*t2 = x0 - x2(1)
%(y1(2) - y1(1))*t1 = y0 - y1(1)
%(y2(2) - y2(1))*t2 = y0 - y2(1)
%
% Rearranging and writing in matrix form,
%
%  [x1(2)-x1(1)   0   -1   0;  [t1;  [-x1(1);
%0   x2(2)-x2(1)  -1   0;   *   t2;   =   -x2(1);
%   y1(2)-y1(1)   00  -1;   x0;   -y1(1);
%0   y2(2)-y2(1)   0  -1]   y0]   -y2(1)]
%
% Let's call that A*T = B.  We can solve for T with T = A\B.
%
% Once we have our solution we just have to look at t1 and t2 to determine
% whether L1 and L2 intersect.  If 0 <= t1 < 1 and 0 <= t2 < 1 then the two
% line segments cross and we can include (x0,y0) in the output.
%
% In principle, we have to perform this computation on every pair of line
% segments in the input data.  This can be quite a large number of pairs so
% we will reduce it by doing a simple preliminary check to eliminate line
% segment pairs that could not possibly cross.  The check is to look at the
% smallest enclosing rectangles (with sides parallel to the axes) for each
% line segment pair and see if they overlap.  If they do then we have to
% compute t1 and t2 (via the A\B computation) to see if the line segments
% cross, but if they don't then the line segments cannot cross.  In a
% typical application, this technique will eliminate most of the potential
% line segment pairs.
% Input checks.
if verLessThan('matlab','7.13')
error(nargchk(2,5,nargin)) %#ok
else
narginchk(2,5)
end
% Adjustments based on number of arguments.
switch nargin
case 2
robust = true;
x2 = x1;
y2 = y1;
self_intersect = true;
case 3
robust = x2;
x2 = x1;
y2 = y1;
self_intersect = true;
case 4
robust = true;
self_intersect = false;
case 5
self_intersect = false;
end
% x1 and y1 must be vectors with same number of points (at least 2).
if sum(size(x1) > 1) ~= 1 || sum(size(y1) > 1) ~= 1 || ...
length(x1) ~= length(y1)
error('X1 and Y1 must be equal-length vectors of at least 2 points.')
end
% x2 and y2 must be vectors with same number of points (at least 2).
if sum(size(x2) > 1) ~= 1 || sum(size(y2) > 1) ~= 1 || ...
length(x2) ~= length(y2)
error('X2 and Y2 must be equal-length vectors of at least 2 points.')
end
% Force

Re: [Scilab-users] Using Scilab on Linux Mint

2023-12-27 Thread Federico Miyara


This is from an old post.

For a while I couldn't find the time to play around with my Linux, but
this night I successfully installed Scilab 2024.0.0 on Linux Mint and it
works as a charm, graphs are plotted quite fast and more intelligently
than on Windows 10 (on W10 part of the figures are hidden by the bottom
of the screen, or the task bar).

So this is the happy ending of the story.

Thank all of you both for the replies and for making this work properly

Regards,

Federico Miyara

On 19/10/2023 05:17, COUVERT Vincent wrote:

Hi Frederico,

CI failed this night and the link is broken.

Here is a temporary link to the Linux nightly-build version built two days ago: 
https://gitlab.com/scilab/scilab/-/jobs/5306192564/artifacts/file/scilab-branch-main-f2eea82a.bin.x86_64-linux-gnu.tar.xz

Vincent

Cordialement / Best Regards,
Vincent COUVERT
Numerical Computation / Scripting Application Senior Manager

–––
Office: +33 2 9927 1857
vincent.couv...@3ds.com
http://www.3ds.com
–––
Dassault Systèmes SE | 15 Rue Claude Chappe, Zac des Champs Blancs, Batiment B 
| 35510 Cesson Sevigne | France



-Original Message-
From: users  On Behalf Of Federico Miyara
Sent: Thursday, October 19, 2023 10:02 AM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] Using Scilab on Linux Mint


Vincent,

I don't seem to be able to download anything from that link.

Regards,

Federico Miyara

On 16/10/2023 03:54, COUVERT Vincent wrote:

Hi all,

Can you try to use a "main branch" nightly-build version (see 
https://gitlab.com/scilab/scilab/-/wikis/Developers/active-branches)?
We recently switched to Java 17 and JoGL 2.5.0 (what fixed some similar issues).

Best regards.

-Original Message-
From: users  On Behalf Of
hibr-l...@gmx.de
Sent: Sunday, October 15, 2023 10:40 PM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] Using Scilab on Linux Mint

Right, it is a problem since since 6.1.

If one does not want to start Scilab in the terminal, I have written a
how-to at
https://blog.hani-ibrahim.de/en/scilab-6-1-1-ubuntu-22-04-install.html
#h3 for an elegant solution including integration into the menu
system.

Regards, Hani

Am 14.10.23 um 13:50 schrieb Samuel Enibe:

This has been a recurring problem since SCILAB version 6.1

Following suggestions on this forum, I solved it on my UBUNTU
installation by typing the following commands on the console:

export _JAVA_OPTIONS="-Djogl.disable.openglcore"

scilab &

Samuel Ogbonna Enibe
BEng (Nig), MSc (Reading, England), PhD (Nig) Professor of Mechanical
Engineering Formerly Dean, Faculty of Engineering (01/08/2014 to
31/07/2016) University of Nigeria, Nsukka, Nigeria

On Fri, Oct 13, 2023 at 9:12 PM Federico Miyara
mailto:fmiy...@fceia.unr.edu.ar>> wrote:


  Dear All,

  I'm trying to use Scilab on Linux Mint 21.2 (which is similar to or
  derived from Ubuntu) and I can't plot anything. The figure window is
  created but it appears completely blank when plot() is used.

  Any help, please?

  Thanks in advance.

  Regards,

  Federico Miyara


  --
  Este correo electrónico ha sido analizado en busca de virus por el
  software antivirus de Avast.
  www.avast.com <http://www.avast.com>
  ___
  users mailing list - users@lists.scilab.org
  <mailto:users@lists.scilab.org>
  Click here to unsubscribe:
  <mailto:users-unsubscr...@lists.scilab.org
  <mailto:users-unsubscr...@lists.scilab.org>>
  https://lists.scilab.org/mailman/listinfo/users
  <https://lists.scilab.org/mailman/listinfo/users>
  This email and any attachments are intended solely for the use of
  the individual or entity to whom it is addressed and may be
  confidential and/or privileged.

  If you are not one of the named recipients or have received this
  email in error,

  (i) you should not read, disclose, or copy it,

  (ii) please notify sender of your receipt by reply email and delete
  this email and all attachments,

  (iii) Dassault Systèmes does not accept or assume any liability or
  responsibility for any use of or reliance on this email.


  Please be informed that your personal data are processed according
  to our data privacy policy as described on our website. Should you
  have any questions related to personal data protection, please
  contact 3DS Data Protection Officer
  https://www.3ds.com/privacy-policy/contact/
  <https://www.3ds.com/privacy-policy/contact/>

This email and any attachments are intended solely for the use of the
individual or entity to whom it is addressed and may be confidential
and/or privileged.

If you are not one of the named recipients or have received this
email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your recei

Re: [Scilab-users] Noise canceling with playsnd( )

2023-12-19 Thread Federico Miyara


Jens,

Interesting question, and not so trivial.

In order to get perfect cancellation by inverting one channel, both channel 
speakers should be located exactly at the same position (a physical 
impossibility), or else everything should be perfectly symmetrical, including 
the position of the receiver respect to both speakers, there should be no 
reflections at all (a perfect anechoic chamber), you should listen with a 
single ear and it should be perfectly symmetrical, which isn't the case for the 
human ear :). The frequency response (particularly important in this case the 
phase response) of both speakers should be identical, which is very difficult 
for normal speakers which have loose manufacturing tolerances.

I suggest the following experiment: Create a single stereo sound (the first two 
are irrelevant for the experiment) with inverted signals, as your third sound, 
but much longer, say one minute, to have time to make position adjustments) or 
save it to a wav file with wavwrite() and play it in loop mode using any player 
or sound editor (suggested: Audacity). Then close one of your ears with an ear 
plug or strongly pressing the tragus with your finger, locate your other ear 
parallel to the plane of the speaker diaphragms, as close as possible to the 
third vertex of an equilateral triangle whose other vertices are on the center 
of each speaker (you can't see the speakers from this orientation). Then rotate 
slowly your head, at some angle you'll note that the sound reaches a minimum. 
The more absorbent the room, the more chances to get minimal sound.

Explore also other frequencies, such as low frequencies.

This works better if the distance between the speakers is about 60 cm to 
minimize the influence of reflections.

Let mi know if it worked for you.

By the way, you used 20050 Hz, nothing ´particularly wrong with that, but if 
you look for a standard frequency, you might use 22050 Hz.

Regards,

Federico Miyara

PD: Active noise cancellation, a technology similar to what you try to test, 
uses another principle: an adaptive filter whose response is adjusted in real 
time monitoring the result at the desired position with a microphone, which 
adapts its response to minimize the sound level.



On 19/12/2023 15:52, Jens Simon Strom wrote:

fs=20050;
t=0:1/fs:1;
f=440;
a=sin(2*%pi*f*t); // harmonic
a_=asin(a); // distorted
silence=zeros(1,length(a));
y=[a,  silence, a;
silence, a_,   -a];
playsnd(y,fs);
// The 1st section (channel 2 silent) and
// the 2nd one (channel 1 silent) sound as expected.
// The 3rd section sounds like the 1st, no silence!
// Why?


[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] On computational speed

2023-12-01 Thread Federico Miyara


Christophe,

I'm not making a general comparison between multiplication and
exponentiation, I'm comparing exponentiation to the power 2 using the
hat operator ^ with a valid --and simpler-- procedure to get the same
result, i.e., multiplying the base times itself.

I believe that functions and operators should parse the input arguments
to exploit some special cases in which much more efficiency can be
attained. The square is one such case, very important for its prevalence
in many technical computations.

My timings show that it is even more efficient to compute the general case

c =  a^b

by

c = exp(b*log(a)).

So the algorithm being used for the general case is already more
inefficient than it could be even by scripting, which is always more
inefficient than a built-in. So it is not just a whim motivated by my
use case but, rather, exposing a case which is susceptible of improvement.

You say "It is a fact that amongst the several ways to compute one
result, some are more efficient than others." OK, then, why not use the
most efficient one?

Another example: gamma() vs factorial(). Factorial is a special case of
gamma function, yet it is slower. Try this:

// Generate random integers
--> tic, u = floor(20*rand(1, 1e6)); toc
 ans  =
   0.087116

// Compute factorial directly
--> tic, v = factorial(u); toc
 ans  =
   0.7588414

// Compute factorial using gamma
--> tic, v = gamma(u+1); toc
 ans  =
   0.2418619

Timing may vary across machines and operating systems, but the ratios
are similar.

Factorial is three times slower than using a special function. By the
way, for integers up to 20, which yield numbers compatible with the
precision of the arithmetic, the results are identical; above that the
relative error is vanishingly small (about 1e-14)

I have no idea which algorithm is being used for factorial (obviously,
not multiplying all the factors), but its performance still leaves much
to be desired.

Regards,

Federico Miyara


Except that the power is not a multiplication.
It is a fact that amongst the several ways to compute one result, some are more 
efficient than others.
Is the power function too slow regarding the algorithm it uses? Maybe, I don't 
know, but the comparison with the multiplication is not fair.

https://help.scilab.org/power

Regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
Technology & Open Innovation
Product Management & Development

Sidel Group
Sidel Blowing & Services
Avenue de la Patrouille de France
CS 60627, Octeville-sur-Mer
76059 Le Havre cedex, France


Tel: 33(0)2 32 85 89 32
Fax: 33(0)2 32 85 91 17

<http://www.sidel.com/>
<mailto:christophe.d...@sidel.com>

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/





--
Este correo electrónico ha sido analizado en busca de virus por el software 
antivirus de Avast.
www.avast.com
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy 

Re: [Scilab-users] On computational speed

2023-11-30 Thread Federico Miyara


Heinz,

Thank you for your timings, which confirm that, even if about an order
of magnitude faster (I use a rather old i7 laptop), the simple squaring
operation takes much longer than it should.

Regards,

Federico Miyara

On 30/11/2023 02:14, Heinz Nabielek wrote:

Thanks. In the 1960s FORTRAN, we would always write A2=A*A rather than A2=A**2.

Below the Federico examples on my M1 Apple silicon iMac:
Heinz

--> tic, u = rand(1,1e7); toc
  ans  =   0.111413

--> tic, v = sqrt(u); toc
  ans  =   0.0384130

-->  tic, v = u.*u; toc
  ans  =   0.023148

--> tic, v = u.*%pi; toc
  ans  =   0.017872

--> tic, v = u.^2; toc
  ans  =   0.156129

--> tic, v = u.^%pi; toc
  ans  =   0.1537830

--> tic, v = log(u); toc
  ans  =   0.093586

--> tic, v = exp(u); toc
  ans  =   0.0821170

--> tic, v = exp(2*log(u)); toc
  ans  =   0.139802






Am 30.11.2023 um 00:46 schrieb Federico Miyara :

Dear All,

I was trying to make some simple experiments regarding computational speed of 
several functions and operations and some results puzzled me. To perform the 
tests I used massive data to minimize the effect of idle time due to priority 
handling by the operating system or whatever.

--> tic, u = rand(1,1e7); toc
  ans  =
0.4948326

This creates ten million random numbers in half a second. Very decent 
performance. Then

--> tic, v = sqrt(u); toc
  ans  =
0.282802

The algorithm for square root seems quite fast. Multiplication

--> tic, v = u.*u; toc
  ans  =
0.1218028

--> tic, v = u.*%pi; toc
  ans  =
0.119245

is really fast. But when it comes to power or exponentiation:

--> tic, v = u.^2; toc
  ans  =
1.9633435

--> tic, v = u.^%pi; toc
  ans  =
1.958321

it is quite slow. Logarithm is much faster:

--> tic, v = log(u); toc
  ans  =
0.5166959

Even the exponential function with base e is much faster:

--> tic, v = exp(u); toc
  ans  =
0.5451482

I wonder why special cases such as small integer powers are not dealt with by 
simple multiplication. Particularly the square is very frequently used on large 
vectors representing discrete signals (for instance to get energy measures) and 
no warning is issued in the documentation.

I also notice that computing the square using this formula (a cannon to kill a 
mosquito!)

--> tic, v = exp(2*log(u)); toc
  ans  =
1.2789763

is faster than using the power operator ^.

This seems to be an inconsistent approach, since many special functions are 
painstakingly tailored to be very efficient, yet one of the simplest of all 
operations, raising to power 2, is sluggishly slow...

Regards,

Federico Miyara


Libre de virus.www.avast.com This email and any attachments are intended solely 
for the use of the individual or entity to whom it is addressed and may be 
confidential and/or privileged.
If you are not one of the named recipients or have received this email in error,
(i) you should not read, disclose, or copy it,
(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,
(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.

Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/





--
Este correo electrónico ha sido analizado en busca de virus por el software 
antivirus de Avast.
www.avast.com
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr

[Scilab-users] On computational speed

2023-11-29 Thread Federico Miyara

Dear All,

I was trying to make some simple experiments regarding computational speed of 
several functions and operations and some results puzzled me. To perform the 
tests I used massive data to minimize the effect of idle time due to priority 
handling by the operating system or whatever.

--> tic, u = rand(1,1e7); toc
ans  =
  0.4948326

This creates ten million random numbers in half a second. Very decent 
performance. Then

--> tic, v = sqrt(u); toc
ans  =
  0.282802

The algorithm for square root seems quite fast. Multiplication

--> tic, v = u.*u; toc
ans  =
  0.1218028

--> tic, v = u.*%pi; toc
ans  =
  0.119245

is really fast. But when it comes to power or exponentiation:

--> tic, v = u.^2; toc
ans  =
  1.9633435

--> tic, v = u.^%pi; toc
ans  =
  1.958321

it is quite slow. Logarithm is much faster:

--> tic, v = log(u); toc
ans  =
  0.5166959

Even the exponential function with base e is much faster:

--> tic, v = exp(u); toc
ans  =
  0.5451482

I wonder why special cases such as small integer powers are not dealt with by 
simple multiplication. Particularly the square is very frequently used on large 
vectors representing discrete signals (for instance to get energy measures) and 
no warning is issued in the documentation.

I also notice that computing the square using this formula (a cannon to kill a 
mosquito!)

--> tic, v = exp(2*log(u)); toc
ans  =
  1.2789763

is faster than using the power operator ^.

This seems to be an inconsistent approach, since many special functions are 
painstakingly tailored to be very efficient, yet one of the simplest of all 
operations, raising to power 2, is sluggishly slow...

Regards,

Federico Miyara


[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


[Scilab-users] insert()

2023-11-23 Thread Federico Miyara


Dear All,

I wonder if there is a reason why the function insert() (which allows to
insert elements in a list by moving the entire content to the right of
the intended position to make room for the new element) has never been
documented. Someone told me of its existence a few years ago, and I've
checked that it still works in 2024.0.0. May be it is intended to be
deprecated or has a serious bug?

It would also be useful to have a similar function which worked with
vectors, matrices or even arrays, that allowed to insert an entire new
row, for instance. Something like this:

a = [1 2 3; 4 5 6; 7 8 9]
 a  =
   1.   2.   3.
   4.   5.   6.
   7.   8.   9.
a(2, :) = insert([1 2 3]
 a  =
   1.   2.   3.
   1.   2.   3.
   4.   5.   6.
   7.   8.   9.

Regards,

Federico Miyara

--
Este correo electrónico ha sido analizado en busca de virus por el software 
antivirus de Avast.
www.avast.com
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/



Re: [Scilab-users] my history file from the previous Scilab version has lost much of its first part

2023-11-10 Thread Federico Miyara


Go down a little more on the side bar; after fonts, color, console, you should 
find Command history!

Regards,

Federico Miyara


On 10/11/2023 22:49, Heinz Nabielek wrote:
Great explanation, thank you. Would I have known
Heinz

What exactly should I do here? Sorry for being dumb
[cid:part1.HwXnPSG0.AfOUcF8s@fceia.unr.edu.ar]

On 11.11.2023, at 02:34, Federico Miyara 
mailto:fmiy...@fceia.unr.edu.ar>> wrote:


Heinz,

The history file has a maximum number of lines that can be set by the
user from the Scilab preferences, Command history. I've seen that you
can set it at a rather high value. I have it at 10. But eventually
it will reach that maximum and I guess it will be cleared following a
first-in first-out protocol so that the oldest information is
periodically cleared.

I'm afraid that if you reached the limit the information is definitely
and irreversibly lost. The only way it would be somehow retrievable
would be if you had noticed such situation right away when it started to
happen and that nothing more has been done so that the probability that
the information of the old version of the file, even if not accessible
from the file system, is still there and can be located by a specialized
recovery application such as Recuva (see
https://www.ccleaner.com/es-es/recuva/download, there is a free
version). But I guess one discovers that when it is too late.

Anyway, it isn't a good policy to trust important information to a
feature that is not intended for that purpose. What I do is to have a
file named drafts.sce where I paste ideas, fragments of scripts,
miscellaneous data and so on.

Regards,

Federico Miyara

On 10/11/2023 21:35, Heinz Nabielek wrote:
Scilab does a good job writing all commands into a history file specific for 
every Scilab version.
Now my history file from the previous Scilab version has lost much of its first 
part. Could that have been because of truncation because too big?
Is any of this retrievable? Contains important data!
Heinz
___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




--
Este correo electrónico ha sido analizado en busca de virus por el software 
antivirus de Avast.
www.avast.com<http://www.avast.com>
___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sende

Re: [Scilab-users] my history file from the previous Scilab version has lost much of its first part

2023-11-10 Thread Federico Miyara


Heinz,

The history file has a maximum number of lines that can be set by the
user from the Scilab preferences, Command history. I've seen that you
can set it at a rather high value. I have it at 10. But eventually
it will reach that maximum and I guess it will be cleared following a
first-in first-out protocol so that the oldest information is
periodically cleared.

I'm afraid that if you reached the limit the information is definitely
and irreversibly lost. The only way it would be somehow retrievable
would be if you had noticed such situation right away when it started to
happen and that nothing more has been done so that the probability that
the information of the old version of the file, even if not accessible
from the file system, is still there and can be located by a specialized
recovery application such as Recuva (see
https://www.ccleaner.com/es-es/recuva/download, there is a free
version). But I guess one discovers that when it is too late.

Anyway, it isn't a good policy to trust important information to a
feature that is not intended for that purpose. What I do is to have a
file named drafts.sce where I paste ideas, fragments of scripts,
miscellaneous data and so on.

Regards,

Federico Miyara

On 10/11/2023 21:35, Heinz Nabielek wrote:

Scilab does a good job writing all commands into a history file specific for 
every Scilab version.
Now my history file from the previous Scilab version has lost much of its first 
part. Could that have been because of truncation because too big?
Is any of this retrievable? Contains important data!
Heinz
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/





--
Este correo electrónico ha sido analizado en busca de virus por el software 
antivirus de Avast.
www.avast.com
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/



Re: [Scilab-users] Plot sequence: Problem only, one colour is white. What is the easiest way to change the colour sequence?

2023-10-30 Thread Federico Miyara


Heinz,

I think you asked this very question in the past. I don't experience your 
problem.

According to https://help.scilab.org/LineSpec if you don't specify the color it 
cycles through the table

R   G   B
0.  0.  1.
0.  0.5 0.
1.  0.  0.
0.  0.750.75
0.750.  0.75
0.750.750.
0.250.250.25

None of these colors is white (which would be RGB = [1 1 1]). This code

scf(1);
clf(1);
// Create sample x and y
x = 0:0.01:1;
n = 9;
y = sin(x'*(1:n));
plot(x',y)

generates this 9 curve plot
[cid:part1.htcnaDbu.psqREiJe@fceia.unr.edu.ar]
which cycles from blue, green, ... to dark gray and starts over, blue, green. 
Only 7 colors, two of them repeated.

So I guess you have somehow assigned a different color map. In my example, 
entering

gce().children.foreground

yields

ans  =
  33.
  2.
  37.
  36.
  35.
  34.
  5.
  33.
  2.

If now you execute

getcolor

you get the following interactive color chart,

[cid:part2.Eq3OdYBr.1PKiqsU6@fceia.unr.edu.ar]

which contains a sample of each color in the color map, which are indexed from 
top to bottom and left to right. Clicking on any one you get at the bottom the 
index and the RGB formula. Referring to the table above, the first curve 
(starting from the bottom) has the index 2, which correspondes to blue, the 
second has the index 33, which you can see it is the 3rd color of the 6th 
column, i.e., green; then comes 5, the 5th of the 1st column, i.e., red, so the 
indices are consistent with the colors of the curves and with the colors in the 
color map.

WARNING: Don't forget to close the interactive chart or else Scilab will seem 
to freeze!

Now you can force the cycling to another order, for instance instead of 2, 33, 
5, ..., 37 you could use 1, 2, 3, ..., 37. I guess you did this which by the 
way can be done this way:

gce().children.foreground = (1:n)';

This assigns the indices 1 to 9 to the foreground color or line color of each 
curve. The problem is that, indeed, index 8 corresponds to white. One easy way 
to get rid of the white is

gce().children.foreground = [1:7, 9:10]';

an you'll be done!

However, the problem of further customizing the color map is an interesting one 
if you want to have complete control of your colors. You can do so by setting a 
color map from scratch using  gcf().color_map. You just equate it to any mx3 
matrix, where m is the number of colors, one per row, where each row is the RGB 
formula of the color given by three numbers from 0 (darkest) to 1 (most 
intense).

However, if you don't have some criterion your colors may result caotic. One 
way to prevent that is to use one of the color maps offered by Scilab. For 
instance I like a lot this one:

gcf().color_map = jetcolormap(n);

They are called swatches, and you can find the available ones at 
https://help.scilab.org/colormap

Regards,

Federico Miyara



On 28/10/2023 22:45, Heinz Nabielek wrote:

I have a vector x with  --> size(x) = 13.   1.
and an array y with --> size(y) = 13.   9.

Scilab has that beautiful power that I can plot them all at once with 9 
different colours
--> plot(x,y,’o’);

Problem only, one colour is white.
What is the easiest way to change the colour sequence?
Greetings
Heinz



___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/





[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you shou

Re: [Scilab-users] Using Scilab on Linux Mint

2023-10-19 Thread Federico Miyara


Vincent,

I don't seem to be able to download anything from that link.

Regards,

Federico Miyara

On 16/10/2023 03:54, COUVERT Vincent wrote:

Hi all,

Can you try to use a "main branch" nightly-build version (see 
https://gitlab.com/scilab/scilab/-/wikis/Developers/active-branches)?
We recently switched to Java 17 and JoGL 2.5.0 (what fixed some similar issues).

Best regards.

-Original Message-
From: users  On Behalf Of hibr-l...@gmx.de
Sent: Sunday, October 15, 2023 10:40 PM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] Using Scilab on Linux Mint

Right, it is a problem since since 6.1.

If one does not want to start Scilab in the terminal, I have written a how-to at
https://blog.hani-ibrahim.de/en/scilab-6-1-1-ubuntu-22-04-install.html#h3
for an elegant solution including integration into the menu system.

Regards, Hani

Am 14.10.23 um 13:50 schrieb Samuel Enibe:

This has been a recurring problem since SCILAB version 6.1

Following suggestions on this forum, I solved it on my UBUNTU
installation by typing the following commands on the console:

export _JAVA_OPTIONS="-Djogl.disable.openglcore"

scilab &

Samuel Ogbonna Enibe
BEng (Nig), MSc (Reading, England), PhD (Nig) Professor of Mechanical
Engineering Formerly Dean, Faculty of Engineering (01/08/2014 to
31/07/2016) University of Nigeria, Nsukka, Nigeria

On Fri, Oct 13, 2023 at 9:12 PM Federico Miyara
mailto:fmiy...@fceia.unr.edu.ar>> wrote:


 Dear All,

 I'm trying to use Scilab on Linux Mint 21.2 (which is similar to or
 derived from Ubuntu) and I can't plot anything. The figure window is
 created but it appears completely blank when plot() is used.

 Any help, please?

 Thanks in advance.

 Regards,

 Federico Miyara


 --
 Este correo electrónico ha sido analizado en busca de virus por el
 software antivirus de Avast.
 www.avast.com <http://www.avast.com>
 ___
 users mailing list - users@lists.scilab.org
 <mailto:users@lists.scilab.org>
 Click here to unsubscribe:
 <mailto:users-unsubscr...@lists.scilab.org
 <mailto:users-unsubscr...@lists.scilab.org>>
 https://lists.scilab.org/mailman/listinfo/users
 <https://lists.scilab.org/mailman/listinfo/users>
 This email and any attachments are intended solely for the use of
 the individual or entity to whom it is addressed and may be
 confidential and/or privileged.

 If you are not one of the named recipients or have received this
 email in error,

 (i) you should not read, disclose, or copy it,

 (ii) please notify sender of your receipt by reply email and delete
 this email and all attachments,

 (iii) Dassault Systèmes does not accept or assume any liability or
 responsibility for any use of or reliance on this email.


 Please be informed that your personal data are processed according
 to our data privacy policy as described on our website. Should you
 have any questions related to personal data protection, please
 contact 3DS Data Protection Officer
 https://www.3ds.com/privacy-policy/contact/
 <https://www.3ds.com/privacy-policy/contact/>

This email and any attachments are intended solely for the use of the
individual or entity to whom it is addressed and may be confidential
and/or privileged.

If you are not one of the named recipients or have received this email
in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete
this email and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to
our data privacy policy as described on our website. Should you have
any questions related to personal data protection, please contact 3DS
Data Protection Officer https://www.3ds.com/privacy-policy/contact/
<https://www.3ds.com/privacy-policy/contact/>



___
users mailing list - users@lists.scilab.org Click here to unsubscribe:
<mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users

___
users mailing list - users@lists.scilab.org Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have 

[Scilab-users] Using Scilab on Linux Mint

2023-10-13 Thread Federico Miyara


Dear All,

I'm trying to use Scilab on Linux Mint 21.2 (which is similar to or
derived from Ubuntu) and I can't plot anything. The figure window is
created but it appears completely blank when plot() is used.

Any help, please?

Thanks in advance.

Regards,

Federico Miyara


--
Este correo electrónico ha sido analizado en busca de virus por el software 
antivirus de Avast.
www.avast.com
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/



Re: [Scilab-users] Periodic Timer

2023-10-11 Thread Federico Miyara


What about my proposal of just informing an estimate of the time at which the 
load of the excel is expected to de complete? This is fairly easy and complies 
with the requisite of telling the user that the load is in progress.

Regards,

Federico Miyara

On 11/10/2023 20:37, Greg James wrote:
Hi
That is what I have essentially done , just update the waitbar through sections 
of the code as read in multiple data sets.

To have the ability to have a user thread would be great or a periodic timer 
that has a call back mechanism.

I really don’t care about the exact progress of the waitbar , all I want is to 
give the user feedback that something is happening as the excel reads are slow 
because of the size of the data .

Cheers

Greg

From: users <mailto:users-boun...@lists.scilab.org> on 
behalf of Stéphane Mottelet <mailto:stephane.motte...@utc.fr>
Date: Wednesday, 11 October 2023 at 5:52 pm
To: users@lists.scilab.org<mailto:users@lists.scilab.org> 
<mailto:users@lists.scilab.org>
Subject: Re: [Scilab-users] Periodic Timer

Hello,

You have  the progession bar, i.e.

   progressionbar('Please wait while loading data');

which is incorrectly  named as it cannot show any progression (unlike 
waitbar()) but only a kind of bar which oscillates, showing that something is 
happening. This one will keep oscillating in an asynchronous way (in the 
background) until you delete it.

However, even if Scilab would be able to launch threads at the user level, 
updating a bar showing progression would need to be hardcoded in xls_read, 
because you have to know the current position you are reading w.r.t. the 
overall size ot the data stream.

The only case where something could be done is if your data is organized in 
many sheets within the xls file. In that case you could iterate on sheets and 
update a waitbar().

S,
On 10/10/2023 01:31, Greg James wrote:
Hi
Is there a periodic timer like the Matlab timer function ?  The parallel run 
function does not seem to exist in the 2023.1.0 release , as I thought I may be 
able to use that instead.

I am reading a large excel spreadsheet and it would be good to implement a 
progress bar .  So, a periodic timer that runs in the background could be used 
to check a flag finish flag . If the finish flag is false increment the 
progress and fire the timer off again.

Kind Regards

Greg





This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/





___

users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>

Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>

https://lists.scilab.org/mailman/listinfo/users

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/



This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to persona

Re: [Scilab-users] Periodic Timer

2023-10-10 Thread Federico Miyara


I´m not acquainted with xlread(). I've seen that there is a function xls_read() 
though. In any case, one (advanced!) possibility would be to get the source 
code of the function, try to insert waitbar() in an appropriate place and use 
genlib to compile it back into a library. I'm not quite certain whether this 
would work or not, but I can't imagine another approach since I think Scilab is 
not capable of multitasking except when triggering an external process such as 
in playsnd(), which can play a sound file as a background process and go on 
performing subsequent commands. If the waitbar could be launched as an external 
process you'd be done as far as you can kill it at the end.

Regards,

Federico Miyara

On 10/10/2023 20:13, Greg James wrote:
The problem is that waitbar is designed to be called with in the computation 
loop. My issue is that I am calling a library function xlread that is very slow 
as it needs to load a large data set and I need to inform the user that 
something is happening.

Cheers

Greg

From: users <mailto:users-boun...@lists.scilab.org> on 
behalf of Federico Miyara <mailto:fmiy...@fceia.unr.edu.ar>
Date: Wednesday, 11 October 2023 at 8:12 am
To: users@lists.scilab.org<mailto:users@lists.scilab.org> 
<mailto:users@lists.scilab.org>
Subject: Re: [Scilab-users] Periodic Timer

I've just come across the function waitbar(); I think it could help. See

https://help.scilab.org/docs/2023.1.0/fr_FR/waitbar.html

You also have a variation, progression(). See

https://help.scilab.org/docs/2023.1.0/fr_FR/progressionbar.html

Regards,

Federico Miyara

On 10/10/2023 13:07, Steer Serge wrote:
May be the realtime function may work as you expect. but I fear that the xlread 
function blocks the execution of realtime
Serge
Le 10/10/2023 à 01:31, Greg James a écrit :
Hi
Is there a periodic timer like the Matlab timer function ?  The parallel run 
function does not seem to exist in the 2023.1.0 release , as I thought I may be 
able to use that instead.

I am reading a large excel spreadsheet and it would be good to implement a 
progress bar .  So, a periodic timer that runs in the background could be used 
to check a flag finish flag . If the finish flag is false increment the 
progress and fire the timer off again.

Kind Regards

Greg





This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/





___

users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>

Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>

https://lists.scilab.org/mailman/listinfo/users


This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/





___

users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>

Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>

https://lists.scilab.org/mailman/listinfo/users


[Imageremoved by 
sender.]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>


This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential

Re: [Scilab-users] Periodic Timer

2023-10-10 Thread Federico Miyara


I've just come across the function waitbar(); I think it could help. See

https://help.scilab.org/docs/2023.1.0/fr_FR/waitbar.html

You also have a variation, progression(). See

https://help.scilab.org/docs/2023.1.0/fr_FR/progressionbar.html

Regards,

Federico Miyara


On 10/10/2023 13:07, Steer Serge wrote:
May be the realtime function may work as you expect. but I fear that the xlread 
function blocks the execution of realtime
Serge
Le 10/10/2023 à 01:31, Greg James a écrit :
Hi
Is there a periodic timer like the Matlab timer function ?  The parallel run 
function does not seem to exist in the 2023.1.0 release , as I thought I may be 
able to use that instead.

I am reading a large excel spreadsheet and it would be good to implement a 
progress bar .  So, a periodic timer that runs in the background could be used 
to check a flag finish flag . If the finish flag is false increment the 
progress and fire the timer off again.

Kind Regards

Greg





This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users



This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users



[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Fwd: Scilab doesn't seem to work on Linux Mint 22.1

2023-08-02 Thread Federico Miyara


Sorry, I meant Linux Mint 21.2, not 22.1


 Forwarded Message 
Subject:[Scilab-users] Scilab doesn't seem to work on Linux Mint 22.1
Date:   Wed, 2 Aug 2023 19:15:35 -0300
From:   Federico Miyara 
<mailto:fmiy...@fceia.unr.edu.ar>
Reply-To:   Users mailing list for Scilab 
<mailto:users@lists.scilab.org>
To: Users mailing list for Scilab 
<mailto:users@lists.scilab.org>



Dear All,

I've recently installed Linux Mint 22.1 and of course, all the programs I need 
for different purposes. However, I couldn't make Scilab (the latest version 
available, 2023.1.0) work properly. The first launch seemed to work, but it 
didn't generate graphics. I changed the working directory to a directory in an 
external USB HDD drive. Next time I launched the program the directory reverted 
again to the default and I couldn't change it back.

Any idea of what may be happening?

Linux Mint is seemingly a spin-off of Ubuntu so in principle.

Regards,

Federico Miyara

[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/


This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Scilab doesn't seem to work on Linux Mint 22.1

2023-08-02 Thread Federico Miyara


Dear All,

I've recently installed Linux Mint 22.1 and of course, all the programs I need 
for different purposes. However, I couldn't make Scilab (the latest version 
available, 2023.1.0) work properly. The first launch seemed to work, but it 
didn't generate graphics. I changed the working directory to a directory in an 
external USB HDD drive. Next time I launched the program the directory reverted 
again to the default and I couldn't change it back.

Any idea of what may be happening?

Linux Mint is seemingly a spin-off of Ubuntu so in principle.

Regards,

Federico Miyara

[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Libre de 
virus.www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] how do I plot 9 curves with automatic colour sequencing?

2023-06-04 Thread Federico Miyara


Heinz:

The solution by Samuel proves that Problem #1 isn't actually a problem, buy it 
doesn't prevent Problem #2, i.e., cycling over and over again through the first 
7 colors.

Unfortunately I couldn't find a direct way to do what you need, but it is still 
possible with a little trick.

However, you need some theory.

Each figure has a default color map with 32 colors which you can get using

--> getcolor

which opens this chart: (may be the chart doesn't show in this mailing list, 
but if you type the command you'll get it)

[cid:part1.93A21178.EEA5B56B@fceia.unr.edu.ar]

Clicking on a color you get the name and the index (the number between 
parentheses following RGB)

(Be sure to close the chart after inspecting it or you won't be able to do 
anything else)

Once a figure has been created you can see how the colors are obtained by

--> cmap = gcf().color_map

This yields a 32x3 matrix whose rows contain the RGB (red green blue) 
composition of a color. You'll see that cmap(8) = [1 1 1]. This is white since 
all three primary colors are at their highest values, i.e., 1.

The last thing to know is that you can set the color of the last polyline you 
created by means of

gce().children.foreground = 4;

gce() stands for "get current entity". The current entity after creating a polyline, 
i.e., a graph is a compound whose child is the graph you want to change the color of. In this 
example you set the color to 4, i,e. "cyan", but you could also set it to any color above 
8, instead of cycling the first 7 non-white colors.

So if you create

ind = [1:7 9:32]

you'll have 31 indexes to non-white colors available.

This code assigns different colors. The limit is 31 colors, and a problem is 
that some colors are very similar--yet they are dfferent:

scf(1);
x = 0:0.01:1;
y = sin(x'*(1:10));
plot(x',y)
ind = [1:7 9:32];
gce().children.foreground = ind(1:10)';

Finally, you could define your custom color map by means of

gcf().color_map = C

where C is any nx3 matrix where each row contains 3 numbers between 0 and 1 and 
n is the number of colors. If you prefer not to proceed by trial and error, you 
can just take one of several options provided bya scilab, for instance

C = jetcolormap(10)

The available options can be seen by typing

help colormap

Regards,

Federico Miyara




On 03/06/2023 13:17, Heinz Nabielek wrote:

Colleagues:

[sorry, has been asked before but forgot]: how do I plot 9 curves with 
automatic colour sequencing?

o   Problem #1: colour 8 is white and I cannot see my curve
o   Problem #2: colours >= 9 become rather non distinct

Is there an easy solution without complex SciLab acrobatics?
Heinz

Specifier   Color
#1  r   Red
#2  g   Green
#3  b   Blue
#4  c   Cyan
#5  m   Magenta
#6  y   Yellow
#7  k   Black
#8  w   White
___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/








[Avast logo] <https://www.avast.com/antivirus>

El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
www.avast.com<https://www.avast.com/antivirus>



This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Pro

Re: [Scilab-users] command longer than 4096

2023-04-27 Thread Federico Miyara


Jean-Yves.

Thank you for checking and confirming.

I think it is a limitation that could be relatively easily solved. If 
multi-line commands are accepted, it should be possible to automatically split 
the command using continuation marks before really requesting the execution.

Federico Miyara


On 27/04/2023 05:28, Jean-Yves Baudais wrote:
Hello,

Le 26/04/2023 à 17:20, Federico Miyara a écrit :
As I said yesterday, the single-line command doesn't work when selected
and evaluated from the contextual menu that opens when right-clicking on
the selection.

Ok, what I wrote was not in the same context, sorry. I succeeded to
obtain the same error message :-). So, it's a GUI problem. No? If yes,
maybe Java is responsible for that and fixes some prompt limitation?
(4096... is half of the input/output buffer size in C, by default, see
stdio.h)

Jean-Yves
___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/







[Avast logo] <https://www.avast.com/antivirus>

El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
www.avast.com<https://www.avast.com/antivirus>



This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] command longer than 4096

2023-04-26 Thread Federico Miyara


As I said yesterday, the single-line command doesn't work when selected and 
evaluated from the contextual menu that opens when right-clicking on the 
selection.

The error message,
Command is too long (more than 4096 characters long): could not send it to 
Scilab
is misleading, since the problem isn't the length of the command but the fact that it is 
in a single line of more than 4096 characters long. When the command is split into 
several lines by using the continuation mark "..", it works fine, of which I 
wasn't aware in my original post and I apologize for that.

When executing using either the "play" icon, F5 or exec(), both single-line and 
multiple-line versions of the command work as expected, of which I wasn't aware either.

Regards,

Federico Miyara


On 26/04/2023 05:17, Jean-Yves Baudais wrote:
Hello,

I wrote the vector "a" on the file "test.sce" and did

--> exec test.sce;
--> size(a)
ans  =

  1.   371.


Tested on Scilab 6.1.1. So it seems to work fine. I also tested a row
vector of 1 "1" and it works also! (I have many sce files like that,
because I use to add "a=[" at the beginning of ascii-matrix data files,
and "];" at the end. Maybe it's not the most efficient way to read and
store data, but it's the simplest for me :-)

Jean-Yves
___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/





[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Libre de virus. 
www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] command longer than 4096

2023-04-25 Thread Federico Miyara


Vincent,

A question to be sure we understood the underlying problem.
How did you get this error message?
-  Using SciNotes (F5 shorcut for example)?
-  Using exec function?
-  Using copy/paste?

When testing the code I usually select a portion of code from SciNotes and use the 
contextual menu "Evaluate selection with echo".

However, I notice now that with F5 I don't experience the same problem...!

But I also notice that in other cases of commands longer than 4096 the problem 
doesn't show. When I use .. to continue on the next line, there is no problem. 
When the same data is included in a single very long line the problem arises.

I'm including at the end two examples. In the first one the data are ordered 
with frequent ..'s, in the second one I removed all the continuation marks with 
the consequence that it will not be accepted.

The expected behavior would be that there were no difference between the 
different ways of executing a command.

As final note, among the answers I received when I posted my quest, one 
included the proposal of a function which allows to read massive data as in my 
usage case from a block comment at the end of the file. This would be 
interesting also in order to alleviate the code.

Regards,

Federico Miyara
From: users 
<mailto:users-boun...@lists.scilab.org> On 
Behalf Of Federico Miyara
Sent: Thursday, November 17, 2022 10:21 PM
To: users@lists.scilab.org<mailto:users@lists.scilab.org>
Subject: Re: [Scilab-users] command longer than 4096




EXTERNAL EMAIL :  The sender of this email is external to 3DS. Be wary of the content 
and do not open unexpected attachments or links. If you consider this email as spam, 
you can click 
here<https://spam-report.3ds.com/?link=%3ca%20href=%22https://www.mailcontrol.com/sr/QZYlT7N8RGDGX2PQPOmvUqKJsUvVq31ZRDFtiiGhHpJZ_bGk0noliIY1G-osMefMsui7cG11ww75pl0FDW8fzw==%22%3ehere%3c/a%3e>
 (no login or additional action will be requested).




Christopher,

Yes, you understand correctly my case.

There is a reason that justifies my request: I often use my scripts as examples 
within a didactic context. They are exhaustively commented, for instance. I 
consider it preferable to have all the needed data in the same script since I 
cannot be sure that potential future users who find my script will also find 
the associated file with the data (sometimes one downloads a file for future 
use without checking whether we are downloading all the associated files).

Then they should also change the script according to the particular directory 
tree where they choose to place the data, which is an unnecessary distraction 
from the very point of the example.

I agree that it wouldn't be convenient nor practical to work in this way with 
very large data sets, but some 1000 data is not unusual.

Regards,

Federico Miyara
On 17/11/2022 05:16, Dang Ngoc Chan, Christophe wrote:

Hello Federico,



De : users 
<mailto:users-boun...@lists.scilab.org> De la 
part de Federico

Miyara Envoyé : jeudi 17 novembre 2022 03:36



I have to create a vector from a plain text containing about 700 decimal 
numbers, each one with several digits.

[...]

Is there a simple way to do this other than [...] saving the data as a

text file



To be sure I understand well :

in your Scilab script, you have something like



foo = [3.14, 1.414 ; 1.732 ...



with the 700 numbers written inside your script?



Of course your request is legitimate but IMHO, this is really not the best 
practice.

I warmly recommend to have the 700 numbers in a separate file.



Regards



--

Christophe Dang Ngoc Chan

Mechanical calculation engineer





a = [0.2146008   0.3126420   0.3616361   0.2922267   0.5664249   0.4826472   
0.3321719   0.5935095 ..
0.5015342   0.4368588   0.2693125   0.6325745   0.4051954   0.9184708   
0.0437334   0.4818509 ..
0.2639556   0.4148104   0.2806498   0.1280058   0.7783129   0.2119030   
0.1121355   0.6856896 ..
0.1531217   0.6970851   0.8415518   0.4062025   0.4094825   0.8784126   
0.1138360   0.1998338 ..
0.5618661   0.5896177   0.6853980   0.8906225   0.5042213   0.3493615   
0.3873779   0.9222899 ..
0.9488184   0.3435337   0.3760119   0.7340941   0.2615761   0.4993494   
0.2638578   0.5253563 ..
0.5376230   0.1199926   0.2256303   0.6274093   0.7608433   0.0485566   
0.6723950   0.2017173 ..
0.3911574   0.8300317   0.5878720   0.4829179   0.2232865   0.8400886   
0.1205996   0.2855364 ..
0.8607515   0.8494102   0.5257061   0.9931210   0.6488563   0.9923191   
0.0500420   0.7485507 ..
0.4104059   0.6084526   0.8544211   0.0642647   0.8279083   0.9262344   
0.5667211   0.5711639 ..
0.8160110   0.0568928   0.5595937   0.1249340   0.7279222   0.2677766   
0.5465335   0.9885408 ..
0.7395657   0.0037173   0.5900573   0.3096467   0.2552206   0.6251879   
0.1157417   0.6117004 ..
0.6783956   0.3320095   0.0258710   0.5174468   0.3916873   0.2413538   
0.5064435   0.4236102 ..
0.2893728   0.0887932  

Re: [Scilab-users] Scatter plot with fixed marker dimension and overlap analysis

2023-03-17 Thread Federico Miyara


Stéphane,

I'm sorry if my message seemed to you an attack to your code, it was not my 
intention and I apologize.

Charles has never answered till now, but the concept of heat map is known 
(wikipedia has an entry on it).

You are right that wavread() and imread() are not comparable (even if wavread 
is a much more general container than generally known, allowing any kind of 
compressed and uncompressed formats, which, certainly, the function does not 
honor). However, there could be a bmpread() function. In fact, I've created my 
own bmpread(), a simple one that doesn't cover all formats but at least deals 
with the basic ones I needed for my usage case (automatic parametrization of 
printed and scanned graphs). It is available if anyone needs it (just ask).

As to your observation on the lack of a code implementing my idea, Charles had 
asked if there is a way to calculate the heat map, which not necessarily means 
a working code. Often just an enunciation of the idea of an algorithm is 
sufficient for a person to translate it into code. Personally I prefer to 
understand the idea behind an algorithm rather than being provided with a code, 
since it is difficult for me to read other people's code, particularly when I 
will need to change many things such as variable names, comments and so on. But 
you are right again that a code would be better, so I took a time to write it. 
Find it below. Assuming the data are given (here, as you did, I simulate the 
data), the core of the algorithm is the for loop with the initialization of the 
matrix representing the image.

Regards and sorry again.

Federico Miyara



// Image size
n = 500;
m = 800;
// Impact area radius
R = 20;
// Number of impacts
N = 200;
// Generate test random impact points
IPx = 1 + floor(m*rand(1,N));
IPy = 1 + floor(n*rand(1,N));

// Plot impacts
scf(1);
clf(1);
plot(IPx, IPy,"o")

// Initialize matrix to contain image
A = zeros(n,m);
// Navigate impacts
for k=1:N
  // Horizontal range for kth impact
  x1 = max(IPx(k) - R, 1);
  x2 = min(IPx(k) + R, m);
  for i=x1:x2
 // Vertical range for kth impact and ith horizontal pixel
 y1 = IPy(k) - sqrt(R^2 - (i - IPx(k))^2);
 y2 = IPy(k) + sqrt(R^2 - (i - IPx(k))^2);
 y1 = max(y1, 1);
 y2 = min(y2, n);
 // Overlap
 A(y1:y2, i) = A(y1:y2, i) + 1;
  end
end

scf(2);
clf(2);
gcf().color_map = jetcolormap(64);
Sgrayplot([1:m],[1:n],A')
isoview on




On 17/03/2023 18:39, Stephane Mottelet wrote:

Hello,

I think we should let Charles explain what he wants. Particularly he should 
explain what is the heat map he is talking about. Concerning your claim about 
imread, you cannot compare it with wavread. There are far more different image 
formats than audio formats ! This explain why imread and imwrite are part of 
image processing packages. Concerning your claims about missing features, I 
found them legitimate, but they should be directed to the communit :  don't 
expect the core team to do everything ! For example, you have described a 
method to solve Charles problem. So before critisizing proposed method below 
(with a working code) you should propose a code implementing your solution, 
don't you think so ?

S.

---
Stephane Mottelet


Le 2023-03-17 22:23, Federico Miyara a écrit :

Stéphane,

There are two problems with this approach. The first one is that there is no way to know how many 
disks cover a given point so the "heat map" would have only two levels: a given point 
belongs or not to the impact area. Charles hasn't carified, but the term "heat map" he 
used suggests a graded plot. The second problem is that you need to resource to a function not 
directly available in Scilab so you need to install a toolbox. Moreover, you need to create an 
intermediate file.

By the way, I always wondered why imread() isn't part of Scilab's core, as is 
wavread(). Maybe image processing is a very specialized subject demanding a 
complete toolkit to deal with it, but some basic functions like imread() or 
imwrite() would be very handy to ensure easy interoperabilty with other 
software packages.

It is also a pity that xs2bmp() cannot provide an array output with the pixel 
data corresponding to the figure image (2x2x3 for color graphs).

Regards,

Federico Miyara


On 17/03/2023 12:17, Stéphane Mottelet wrote:

Hello,

I would propose this solution, inspired by my remark abour using xfarcs and the bitmap idea from 
Frederico. The idea is to plot the disks then export the graph under a bitmap format, the read the 
image back (needs "imread" e.g.from IPCV) then count the black pixels ("true" 
value in x below). The ratio between black pixels and total number of pixels gives you the 
proportion of covered area:

clf

n = 17;
xc = grand(1,n,"unf",0,5);
yc = grand(1,n,"unf",0,5);
radius = grand(1,n,"unf",0,1);

drawlater
arcs=[xc-radius
yc-radius
2*radius
2*radius
zeros

Re: [Scilab-users] Scatter plot with fixed marker dimension and overlap analysis

2023-03-17 Thread Federico Miyara


Stéphane,

There are two problems with this approach. The first one is that there is no way to know how many 
disks cover a given point so the "heat map" would have only two levels: a given point 
belongs or not to the impact area. Charles hasn't carified, but the term "heat map" he 
used suggests a graded plot. The second problem is that you need to resource to a function not 
directly available in Scilab so you need to install a toolbox. Moreover, you need to create an 
intermediate file.

By the way, I always wondered why imread() isn't part of Scilab's core, as is 
wavread(). Maybe image processing is a very specialized subject demanding a 
complete toolkit to deal with it, but some basic functions like imread() or 
imwrite() would be very handy to ensure easy interoperabilty with other 
software packages.

It is also a pity that xs2bmp() cannot provide an array output with the pixel 
data corresponding to the figure image (2x2x3 for color graphs).

Regards,

Federico Miyara


On 17/03/2023 12:17, Stéphane Mottelet wrote:

Hello,

I would propose this solution, inspired by my remark abour using xfarcs and the bitmap idea from 
Frederico. The idea is to plot the disks then export the graph under a bitmap format, the read the 
image back (needs "imread" e.g.from IPCV) then count the black pixels ("true" 
value in x below). The ratio between black pixels and total number of pixels gives you the 
proportion of covered area:

clf

n = 17;
xc = grand(1,n,"unf",0,5);
yc = grand(1,n,"unf",0,5);
radius = grand(1,n,"unf",0,1);

drawlater
arcs=[xc-radius
yc-radius
2*radius
2*radius
zeros(1,n)
   zeros(1,n)+360*64];
st=ones(1,n);
a1 = newaxes();
a1.margins=[0 0 0 0];
xfarcs(arcs,st);
a1.data_bounds = [0,5,0,5];
isoview on
s=gcf().axes_size;
gcf().axes_size=[400 400]
drawnow

xs2bmp(0,"im.bmp");
x=imread("im.bmp");

disp(sum(x)/size(x,"*"))

S.

Le 16/03/2023 à 18:43, Federico Miyara a écrit :

Charles,

I assume the area of each impact point is circular (but it could be abapted for 
other forms). Then you could start with a n*m matrix filled with zeros. Then, 
according to a convenient scale, each impact point is approximated by a 
component of the matrix. The horizontal and vertical positions (column and row) 
will represent quantized coordinates.

Then, if the coordinates of an impact point ar p (column) and q (row) and the 
radius of its impact area is R, expressed using the same scale, for column k = 
(p - R):(p + R) you add 1 to the rows from q - sqrt(R^2-k^2) to q + 
sqrt(R^2-k^2).

You repeat that for all impact points (with a for loop) and at the end you have 
that each component of the matrix (which represent pixels) will be exactly the 
number of overlapping areas at the location represented by the component. For 
instance, if at component u, v you have 7, that means 7 impact areas contain 
that component.

This could be adapted even to a graded impact area, replacing 1 by the result 
of a function with a maximum at the center fading down to 0 at the perimeter of 
the impact area

You must be careful near the boundary so that components don't exceed the 
limits (for instance, not smaller than 1 or greater than n or m)

This is not probably the most efficient way, but assuming the impact area is 
small it should work fine and reasonably fast for a few thousand impact points.

Regards.

Federico Miyara


On 16/03/2023 00:45, charles marcotte wrote:
Hello,

I have 2d scatter plot where each marker represents an impact point. The impact 
point has a defined area.
1.  I am trying to assign each point the impact area to visualize how much of 
the surface is impacted.
Defining the marker size does not work because I change the scale between 
simulations and I can't find a definition of the marker size vs diameter or 
perimeter.

2. is there a way to calculate the overlap on the area through the chart with a 
heat map for example?

Thank you
Charles

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click h

Re: [Scilab-users] Scatter plot with fixed marker dimension and overlap analysis

2023-03-16 Thread Federico Miyara


Charles,

I assume the area of each impact point is circular (but it could be abapted for 
other forms). Then you could start with a n*m matrix filled with zeros. Then, 
according to a convenient scale, each impact point is approximated by a 
component of the matrix. The horizontal and vertical positions (column and row) 
will represent quantized coordinates.

Then, if the coordinates of an impact point ar p (column) and q (row) and the 
radius of its impact area is R, expressed using the same scale, for column k = 
(p - R):(p + R) you add 1 to the rows from q - sqrt(R^2-k^2) to q + 
sqrt(R^2-k^2).

You repeat that for all impact points (with a for loop) and at the end you have 
that each component of the matrix (which represent pixels) will be exactly the 
number of overlapping areas at the location represented by the component. For 
instance, if at component u, v you have 7, that means 7 impact areas contain 
that component.

This could be adapted even to a graded impact area, replacing 1 by the result 
of a function with a maximum at the center fading down to 0 at the perimeter of 
the impact area

You must be careful near the boundary so that components don't exceed the 
limits (for instance, not smaller than 1 or greater than n or m)

This is not probably the most efficient way, but assuming the impact area is 
small it should work fine and reasonably fast for a few thousand impact points.

Regards.

Federico Miyara


On 16/03/2023 00:45, charles marcotte wrote:
Hello,

I have 2d scatter plot where each marker represents an impact point. The impact 
point has a defined area.
1.  I am trying to assign each point the impact area to visualize how much of 
the surface is impacted.
Defining the marker size does not work because I change the scale between 
simulations and I can't find a definition of the marker size vs diameter or 
perimeter.

2. is there a way to calculate the overlap on the area through the chart with a 
heat map for example?

Thank you
Charles

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users





[Avast logo] <https://www.avast.com/antivirus>

El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
www.avast.com<https://www.avast.com/antivirus>



This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] diagrams that should have identical x-y real picture plotting frames

2023-03-14 Thread Federico Miyara


You could use after each plot the following instruction:

gca().data_bounds = [xmin ymin; xmax, ymax]

where gca() gets the current axis handle and .data_bounds invokes the data 
bounds field of the handle. xmin ymin are the coordinates of the left bottom 
corner of the diagram and xmax ymax ar the corresponding ones to the right top 
corner.

Regards,

Federico Miyara


On 14/03/2023 19:04, Heinz Nabielek wrote:

Collegues,

I am generating dozens of diagrams that should have identical x-y real picture 
plotting frames. How to make certain that they all have exactly same dimension 
in real space?
Heinz


___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/








[Avast logo] <https://www.avast.com/antivirus>

El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
www.avast.com<https://www.avast.com/antivirus>



This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] [Scilab-Dev] Scilab releases schedule / End of Windows 32-bit support

2023-02-22 Thread Federico Miyara


Also, as has been already mentioned, the year version may or may not imply an 
actual major version (i.e., changes that imply an important or significant API 
change, which not necessarily means backward incompatibility) so to find out it 
will be necessary to dive into the change log. The only new information the 
proposed version numbering system would give is the year of release which is 
only relevant for historical reasons (and anyway can be easily found). 
Moreover, for most users (those who use the current version at a given time), 
it would be a redundant information since users know the year they live in.

Regards,

Federico Miyara

On 22/02/2023 07:07, Lamy Alain wrote:

Dear Scilab users / team,

Just one opinion among others:

That's nice to have new Scilab releases regularly, provided of course that 
backward compatibility is guaranteed us much as possible, except maybe for 
major versions.

But I don't see the need for changing the versioning convention.

For instance knowing that Scilab version is 5.x.x or 6.x.x is major information 
that is easy to notice at a glance.
That's not the case if the version major number becomes a year number. And it 
let people think that the version from some given year could potentially be 
incompatible with the version from the previous year, which is not good news.

Alain Lamy


___
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/








[Avast logo] <https://www.avast.com/antivirus>

El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
www.avast.com<https://www.avast.com/antivirus>



This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] [Scilab-Dev] Scilab releases schedule / End of Windows 32-bit support

2023-02-18 Thread Federico Miyara


Stephane,

I have two concerns regarding the announcements. First, it may be confusing 
since users are accustomed to the legacy way of numbering versions, which is 
also the system most software packages use. The chaotic way Windows has 
numbered its versions (W 3.1, W 95/98, W 2000, Vista, W 7...) is an example of 
what shouldn't be done. I would prefer originality in the concept 
(functionality, UI, API), rather than version numbering.

Second, why limit the API changes to an annual periodicity? What if in the 
future many more developers work on the development of Scilab and it is 
possible to improve the API more than once a year?

Regards,

Federico Miyara


On 18/02/2023 12:30, Stephane Mottelet wrote:

Hello,

Please allow me to react to these answers as I feel also very concerned with 
this potential evolution. The year-base major number won't ease a better 
visibility about API changes. It will force us to systematically add a a notice 
saying  something like :

"Don't worry about the major version increase because this time there will not be 
any API change"

or its contrary :

"Unlike previous year, there will be major API changes in this new major version so 
you will have to upgrade your toolboxes".

Moreover, the rationale about the "compatibility with other tools (Matlab, Office, 
Excel, ...)" has no sense because these tools are commercial and closed source 
software. However, I admit that having the year information can be valuable for all users 
as it will allow to know immediately when a given version of Scilab was released.

The ideal scenario would be to use both systems: keep the usual not year-based 
major.minor.patch version numbering (SCI_VERSION_MAJOR, 
SCILAB_VERSION_MINOR,SCILAB_VERSION_MAINTENANCE in our headers) together with a 
release name (SCILAB_VERSION_STRING in our headers).

Presently Scilab is already ready for that since we have the following 
different outputs, for example here with a CI (continuous integration) build:

--> getversion
ans  =

 "scilab-mr3-0237210d"

--> getversion("scilab")
ans  =

  6.   1.   2.   1.677D+09

Here SCILAB_VERSION_STRING="scilab-mr3-0237210d" has been given during the CI 
and is completely arbitrary and not related to the second output which gives the true 
information about changes at the code level.

Having a new release schedule half-year based is completely independent of this need of version numbering. I 
am fine with the fact that you may need a kind of "branding" since almost all of the developers of 
Scilab are employed by a private entity who "owns" at least the "Scilab" name (but a big 
part of Scilab code owns to individual authors) to me that's the main rationale. However you should be aware 
that open-source software never completely belongs to its authors but also to its numerous users.

Since it beginnings Scilab had a complicated story and its governance has 
always been a mystery for most people using it. But in the last 5 years the 
huge work of promoting Scilab and keeping it alive and kicking was made by the 
users themselves. So, this proposed unilateral change from your (3DS employees, 
at least you Vincent) side and my counter-proposition is the occasion to 
exhibit a bit of democracy.

I propose the aforementioned solution using the year-based numbering for the 
release name (SCILAB_VERSION_STRING) and keeping the usual numbering 
SCI_VERSION_MAJOR.SCILAB_VERSION_MINOR.SCILAB_VERSION_MAINTENANCE with its 
actual signification. Please note that yo refer to Matlab and that this 
software uses this dual numbering system !

Users and developers who feel concerned with this subject can express 
themselves in this thread.

S.

---
Stephane Mottelet


Le 2023-02-17 18:12, COUVERT Vincent a écrit :

Hi Sylvain,

The semantic meaning of major/minor/patch version is kept:

-  Major releases may have API changes:

o   There may be API changes between Scilab 2023.m.p and 2024.m'.p' but it is 
not mandatory

-  Minor releases are API compatible:

o   Changes between Scilab 2023.m.p and Scilab 2023.m'.p' cannot be related API 
changes

-  Patches are binary compatible:

o   Changes between Scilab 2023.m.p and Scilab 2023.m.p' will not involve binary change. 
Changes on p (patch) mostly concern "hot fixes".



Compatibility with other tools (Matlab, Office, Excel, ...) and even OS 
following the same calendar will be easier to follow and understand.



This new release schedule also allows us to give a better visibility to 
developers/contributors in order to anticipate:

-  API changes,

-  Function deprecation,

-  Maintenance periods,

-  Scilab evolutions.


From a user perspective,  it will be easier to identify how up-to-date or 
deprecated their Scilab could be.


Vincent



From: dev <mailto:dev-boun...@lists.scilab.org> 
On Behalf Of S

Re: [Scilab-users] Scilab web sites migration

2023-01-20 Thread Federico Miyara


Thanks Clément, this is just to check whether everything works fine for 
a random user.


Regards,

Federico Miyara


On 20/01/2023 04:22, DAVID Clément wrote:

Hello all,

The mailing list server lists.scilab.org has been migrated yesterday evening. 
This mail was sent with the new server!

Note: server archives for mailing lists are also available for history on this 
https://lists.scilab.org/pipermail/users .

Regards,

Clément


-Original Message-
From: DAVID Clément 
Sent: Wednesday, January 18, 2023 11:28 AM
To: Users mailing list for Scilab 
Cc: DAVID Clément 
Subject: RE: Scilab web sites migration

Hello all,

As a follow-up, we are entering the final migration phase. I will migrate the
mailing list server lists.scilab.org starting 2023-01-19 9:00 CEST. It might not
respond during this migration.

I hope to limit downtime to a minimum and will keep you informed when the
migration ended.

Regards,

Clément

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users






--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] (no subject)

2023-01-10 Thread Federico Miyara


My knowledge of Matlab is freezed as of 2017, when I abandoned Matlab 
and embraced Scilab, so might be some of my comments are outdated


It is free, open source software

No licenses that eventually expire

Strings are better handled. In Matlab you can check for equality only if 
their lengths are the same since they are just vectors of codes. In 
Scilab a string is a true type for supporting many operations in a more 
intuitive way.


Variable names support extended characters

You can extract components from the result of any function: y = fft(x)(1:5)

The same applies to any field of structure

It is mostly compatible with Matlab and you can automatically convert 
Matlab scripts to Scilab scripts, which allows to reuse Matlab code (it 
is not perfect and manual correction is needed)


Insanely powerful control of graphics.

Impressive community to help with any doubts.

Regards,

Federico Miyara


On 10/01/2023 11:43, chukwuemeka anyaoha wrote:

what is the advantage of scilab over matlab

--
*Engr Chukwuemeka Anyaoha.*
/Department of Mechanical Engineering/
/University of Nigeria, Nsukka./
/Teaching and Research Assistant (TRA) , World Bank //African Centre 
of Excellence For Sustainable Power & Energy Development (ACE-SPED), /

/*COREN* (*R46092*)/
*+234 08065276477*

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] command longer than 4096

2022-11-17 Thread Federico Miyara


Christopher,

Yes, you understand correctly my case.

There is a reason that justifies my request: I often use my scripts as 
examples within a didactic context. They are exhaustively commented, for 
instance. I consider it preferable to have all the needed data in the 
same script since I cannot be sure that potential future users who find 
my script will also find the associated file with the data (sometimes 
one downloads a file for future use without checking whether we are 
downloading all the associated files).


Then they should also change the script according to the particular 
directory tree where they choose to place the data, which is an 
unnecessary distraction from the very point of the example.


I agree that it wouldn't be convenient nor practical to work in this way 
with very large data sets, but some 1000 data is not unusual.


Regards,

Federico Miyara

On 17/11/2022 05:16, Dang Ngoc Chan, Christophe wrote:

Hello Federico,


De : users  De la part de Federico
Miyara Envoyé : jeudi 17 novembre 2022 03:36

I have to create a vector from a plain text containing about 700 decimal 
numbers, each one with several digits.
[...]
Is there a simple way to do this other than [...] saving the data as a
text file

To be sure I understand well :
in your Scilab script, you have something like

foo = [3.14, 1.414 ; 1.732 ...

with the 700 numbers written inside your script?

Of course your request is legitimate but IMHO, this is really not the best 
practice.
I warmly recommend to have the 700 numbers in a separate file.

Regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

General
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users






--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problem with plotting on Ubuntu 22.04 LTS

2022-11-17 Thread Federico Miyara


In principle it doesn´t sound reasonable to have to change the hardware 
when it worked fine in another version of the operatig system. Probably 
it is a driver problem. Perhaps the issue should be posted to the Ubuntu 
community besides this list.


Regards,

Federico Miyara

On 17/11/2022 05:56, Jean-Yves Baudais wrote:

Le 17/11/2022 à 05:46, Samuel Enibe a écrit :
If anyone has an idea how to solve this problem,  it will be 
appreciated. It was SCILAB graphics was working very well under 
Ubuntu 20.04 LTS. I didn't change anything in the hardware.


I did and got exactly the the same and to solve the problem I tested 
different graphic cards and pilotes. So if you can change de graphics 
card or the pilote... The graphic aspects are really annoying...


--Jean-Yves
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users






--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] command longer than 4096

2022-11-16 Thread Federico Miyara


Dear All,

I have to create a vector from a plain text containing about 700 decimal
numbers, each one with several digits. The total character count
incuding spaces is about 5700, so when I run this command I get the
following error:

"Command is too long (more than 4096 characters long): could not send it
to Scilab"

Is there a simple way to do this other than splitting the text into two
parts, each one with less than 4096 digits and then concatenating the
vectors, or saving the data as a text file and reading the file into a
string variable and converting to numbers?

Thanks,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Uniform distribution of non equidistant integers

2022-08-29 Thread Federico Miyara


Samuel,


or, faster,

[1 5 9](grand(1,1,"uin",1,3))



This one is absolutely brilliant!

Regards,

Federico Miyara

--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus

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


Re: [Scilab-users] Unexpected result using horner

2022-07-24 Thread Federico Miyara


Samuel,


Sorry, but nothing is clear to me about your statements:

1) what shows you that iir() is correct while the analpf + horner way
is not?


There are several reasons:

a) The result of using iir() is consistent with the expected frequency
response, since it is equal to the analog filter response except at high
frequency, an expected artifact for IIR filters. The other solution is
completely different.

b) The degree of the denominator should be 6 but when using horner it
reduces to 3.

My own informal and not very deep analysis suggests that as all the
poles are very close to unity, may be horner() performs some
simplification and simplifies things incorrectly, which might
dramatically change the frequency response.


2) With the analpf + horner method, assuming that it is not correct,
what shows you that horner is not correct, while analpf is correct,
instead of the opposite or both incorrect?


analpf() is a very simple algorithm, at least for Butterworth, since
explicit formulas for the poles exist and in all the cases I have tested
the result is the expected one, particularly in this case.


3) do you have a reference about the equivalence?


The substitution of the bilinear transformation is the usual method to
get an IIR digital filter from an analog prototype. They aren't
completely equivalent, but very similar up to about half Nyquist
frequency. Any book on digital signal processing includes that
transformation. Also https://en.wikipedia.org/wiki/Bilinear_transform


4) have you tried after simp_mode(%f)?


No, but this might be the answer considering my reply to 2). I'll try it
later.

Thanks.

Regerds,

Federico Miyara


Samuel


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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Unexpected result using horner

2022-07-20 Thread Federico Miyara


Dear All,

I have problems with this script:

Fs  =  44100;
fo  =  500;
B  =  2^(1/6)-2^(-1/6);
// Low-pass Butterworth
hLPs  =  analpf(3,"butt",[],1);
// Band-pass Butterworth centered at fo
hBPs  =  horner(hLPs,  (2*%pi*fo/%s  +  %s/(2*%pi*fo))/B)

// Apply bilinear transform
hBPz  =  horner(hBPs,  2*Fs*(%z  -  1)/(%z  +  1))
// Attempt to get the same using iir
hBPz1  =  iir(3,  "bp",  "butt",  fo/Fs*[2^(1/6),2^(-1/6)],  [0  0])

I attempt to design a discrete Butterworth band-pass filter using two 
equivalent methods:


1) Manually applying a bilinear transform to the analog filter designed 
with analpf()

2) Applying the function iir()

For some resaon I couldn't figure out, the first method yields an 
unexpected result:


--> hBPz
 hBPz  =
   0.005 +0.016z +0.016z² +0.005z³
   ---
   -0.9671578 +2.9195957z -2.9518237z² +z³

--> hBPz1
 hBPz1  =
 0.006 -0.017z² +0.017z⁴ -0.006z⁶
- 

   1.0335428 -6.1515162z +15.271063z² -20.239437z³ +15.104038z⁴ 
-6.0176897z⁵ +z⁶


The official function iir() is correct. The manual procedure 
unexpectedly reduces the order of the denominator.


Maybe someone can find out what's going on...

Thanks,

Federico Miyara



--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Sundials module, Windows preview

2022-05-13 Thread Federico Miyara


Stéphane,

I don't regularly use ODE solvers for the time being, but I think any 
improvement is valuable and is worth the effort. The lack or paucity of 
feedback in this list is not an evidence of lack of interest for the 
Scilab users community. It may also encourage other potential users to 
move to Scilab. I'm grateful for your effort and feel reassured that in 
the event I need the feature, I'll have better solvers.


Regards,

Federico Miyara

On 13/05/2022 11:45, Stéphane Mottelet wrote:


Hello,

Did anybody give a try to the Windows build ?

Frankly speaking, if nobody cares about improved numerical methods in 
Scilab, things can be left as is, and time could be spent on other 
features (but not by me...).


I can also prepare a Linux build, if users of this os want to test...

Regards,

S.

Le 27/04/2022 à 17:32, Stéphane Mottelet a écrit :


Hi all,

The next version of scilab will include a new module "Sundials". This 
module provides new full featured  ODE solvers: arkode(), cvode() and 
DAE solver ida(), all handling complex numbers and 
dense/sparse/banded Jacobians. Each solver has specific features, 
e.g. ida() handles DAE, arkode() handles mixed implicit/explicit 
Runge-Kutta methods and cvode() can do forward sensitivity computation.


The module also includes a general-purpose nonlinear system solver: 
kinsol(), who takes advantage of the module architecture (parsing, 
computation engine and SUNDIALS abstraction of various linear solvers).


Current help pages can be found @ 
https://www.utc.fr/~mottelet/scilab/sundials/ and a *Windows* build 
of Scilab (in addition to the already available macOS build) 
including the new module is available at


https://www.utc.fr/~mottelet/scilab_for_macOS.html

The help pages propose a lot of examples and two demos (this section 
is to be enriched) are available.


Comments are welcome !

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/v3?i=SHV0Y1JZQjNyckJFa3dUQiblhF5YcUqtiWCaK_ri0kk=T0hnMlUyVEgwNmlmdHc1NTiGTQVgIg9a1MYkHb_GeosOO-jCQ_NnAucfYCLceioT=V3p0eFlQOUZ4czh2enpJS67gBdM2WVME2HqVPefA4FpGU6HeKhrEzrhzAHs-d_Wu=http%3A//lists.scilab.org/mailman/listinfo/users=ZVd0

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Strange behavior of explicit vs implicit iteration

2022-04-25 Thread Federico Miyara


Dear All,

Here I have the following script, where I compute the same thing using
two iteration methods:

alfa  =  rand(1,10);
Rpr  =  rand();
R  =  rand();
Z  =  rand(10,200);

G  =  zeros(1,200);
for  i=1:200
   A  =  0;
   B  =  0;
   for  k  =  1:10
  A  =  A  +  Rpr*alfa(k)  /  (Z(k,i)  +  alfa(k)*(1  -  alfa(k))*R);
  B  =  B  +  Rpr*(1  -  alfa(k))  /  (Z(k,i)  +  alfa(k)*(1  -  
alfa(k))*R);
   end
   G(i)  =  (1  +  A)  /  (1  +  B);
end

A  =  1;
B  =  1;
for  k  =  1:10
   A  =  A  +  Rpr*alfa(k)  ./  (Z(k,:)  +  alfa(k)*(1  -  alfa(k))*R); 
   B  =  B  +  Rpr*(1  -  alfa(k))  ./  (Z(k,:)  +  alfa(k)*(1  -  alfa(k))*R);

end
G1  =  A  ./  B;

[M,  ind]  =  max(abs(G- G1))

However, the last line shows that there are differences between both
methods. They are tiny (near %eps), but I can't find nor imagine which
is the reason.

NOTE: I kept the original formulas as in the script where the problem
arised but changed the data. When I tried to use a simpler formula there
was no difference.

Any idea?

Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Is this behavior of ifft / isreal correct?

2022-04-06 Thread Federico Miyara


Dear all,

Consider

M = 16
w = [ones(1,M/4),zeros(1,M/4)]
w = [w(1:M/2), 0, conj(w($:-1:2))]
v = ifft(w)
isreal(v)

The first 3 lines defines a real spectrum of a real signal, then the
real signal is recovered and finally it is checked whether it is real or
not.

What puzzles me is that the result is T (true). However, the definition
of the ifft() involves complex operations, so at some point the numbers
must be converted to a complex representation such as

1. + 0.i

so I would expect that the result included 0i so the result of the test
should be F. Where is this null imaginary component removed?

I don't say this is wrong, but it is perplexing if compared to much more
simple operations such as

sqrt(%i^4)

which yields 1. + 0.i, a complex representation of real scalar 1.

Maybe the fftw package is so refined to detect whether the result is
actually real and removes the useless 0.i components?

Regards,

Federico Miyara




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] please help, I have just a mental blockade

2022-02-07 Thread Federico Miyara


Heinz,

It isn't clear what you need, I don't underastand the relationship 
between EE and E.


Except for the first 0 in E, it seems that each consecutive number n is 
repeated n+1 times up to the number indicated by the first component of 
EE. Is this what you are looking for?


This is a simple (though not very efficient) way of attaining that:

m = EE(1);
E = []; //or E = 0 if the first 0 is really needed
for k=0:m
   E = [E, k*ones(1, k+1)];
end

Regards.

Federico Miyara

On 07/02/2022 14:35, Heinz Nabielek wrote:

Sorry, colleagues  -   please help, I have just a mental blockade.

Given vector EE= [3 5 8]

I want to create a stepwise increasing vector E= [0 0 1 1 2 2 2 3 3 3 3]

And would need a system that works for much larger numbers

Probably dead easy?
Heinz

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





--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] partial fractions

2021-12-29 Thread Federico Miyara


Samuel,

Thanks for the tip!

Any possibility that partfrac() ever become part of Scilab? I think it 
should actually replace pfss(), since it seems to be exactly what a user 
expects from a partial fraction function.


Regards,

Federico Miyara


On 29/12/2021 17:32, Samuel Gougeon wrote:

Hello Federico,

Le 16/07/2021 à 21:11, Federico Miyara a écrit :


Dear All,

I'm wonderig whether there is a standard method to obtain the partial 
fraction expansion of a rational function.


Searching, I've found the function pfss(), which purportedly is meant 
for that, but I find it doesn't give a complete solution. For instance:


// Poles and zeros
p = [-8:-1];
z = [0 0 0 0];

// Numerator and denominator
N = prod(%s - z)
D = prod(%s - p)

// Rational function
H = N/D

// Partial fractions
HH = pfss(H)

The result is

HH  =
   HH(1)

   -8 -5.7428571s -3.9515873s² +0.2960317s³ -0.0946429s⁴ -0.006746s⁵ 
-0.0001984s⁶
-- 


  40320 +69264s +48860s² +18424s³ +4025s⁴ +511s⁵ +35s⁶ +s⁷

   HH(2)

   0.0001984
   -
 1 +s

The second component in the list is indeed one of the partial 
fractions, but the first one is not an irreductible version. 



The pfss() rmax option must be used, and set to a big value, for 
instance 1/%eps.

https://help.scilab.org/docs/6.1.0/en_US/pfss.html
Then:

--> D = list2vec(pfss(H,1/%eps))'
 D  =

   -0.8126984  3.3347222  -5.4  4.3402778  -1.778  0.3375 
-0.022  0.0001984
   --  -    -  --  -- 
--  -
  8 +s   7 +s 6 +s    5 +s    4 +s  3 +s  2 
+s   1 +s


--> clean(sum(D)-H)
 ans  =

   0
   -
   1


Computing HH(1) + HH(2) yields H with good approximation.

I guess I could proceed iteratively with HH(1), but it would be nice 
to have a function performing this automatically. I couldn't find 
such a function



In addition, partfrac() is available on FileExchange since 2015 @ 
https://fileexchange.scilab.org/toolboxes/451000
It manages poles multiplicity. With it, your example (with only simple 
poles) gives the following:


--> H = N/D
 H  =
s⁴
---
   40320 +109584s +118124s² +67284s³ +22449s⁴ +4536s⁵ +546s⁶ +36s⁷ +s⁸

--> [I, R, F, T] = partfrac(H);

--> I  // integer part of the fraction
 I  =
   0.

--> R   // Undecomposed remainder of the fraction
 R  =
s⁴
---
   40320 +109584s +118124s² +67284s³ +22449s⁴ +4536s⁵ +546s⁶ +36s⁷ +s⁸

--> F   // Decomposition: row #1 = numerators ; row #2 = poles value ; 
row #3 = poles multiplicity

 F  =

  -0.8126984   3.3347222  -5.4   4.3402778  -1.778 0.3375  
-0.022   0.0001984

  -8. -7. -6.   -5. -4. -3.  -2. -1.
   1.  1.  1.    1.  1. 1.   1.  1.

--> T  // Decomposition output as text
 T  =
  "    -0.8126984   3.3347222   -5.4   4.3402778 -1.778   0.3375   
-0.022   0.0001984"
  "0 + -- + - +  + - + -- + -- 
+ -- + -"
  "   8+%s    7+%s  6+%s 5+%s 4+%s   3+%s   
2+%s    1+%s   "



--> D = F(1,:)./((%s-F(2,:)).^F(3,:))
 D  =

   -0.8126984  3.3347222  -5.4 4.3402778  -1.778  0.3375  
-0.022  0.0001984
   --  -    -  --  -- 
--  -
  8 +s   7 +s 6 +s    5 +s    4 +s  3 +s  2 
+s   1 +s


-->  clean(R-sum(D))
 ans  =

   0
   -
   1

Regards
Samuel


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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Getting the variable name used for a function input argument

2021-11-23 Thread Federico Miyara


I'm not completely sure, but I think this is not possible since what is 
passed to the function isn't a variable but the value contained in the 
variable. The name is lost in the process.


An alternative way (but I don't know if this would be acceptable for 
you) is that the function had as its argument a variable name (hence, a 
string), so your x would be "xNum", instead of 123. Then you could use 
evstr() to get the value of the variable to proceed with the processing.


Regards,

Federico Miyara


On 23/11/2021 17:18, Jens Simon Strom wrote:


Hi Scilab friends,
Given a numeric variable like xNum as an input argument of a function 
call, how can I produce the variable name string "xNum" within the 
function?


Example:

function [name,y]=foo(x)
   name=???
   y=x^2
endfunction

xNum=123.
[name,y]=foo(xNum)
The result for name should be the string "xNum"

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






--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Problem using datafit()

2021-09-07 Thread Federico Miyara


Dear all,

I have a problem using datafit() to adjust the parameters of a model. 
The script below has four parts. The first one actually is a synthesis 
of the data I'm working with. It just creates the data (logf0, Te) to model.


The second part introduces the function g(x, p) to model the data.

Part three creates the "gap" function required for datafit(). It does so 
in two alternative ways selected with the variable option. If option = 
1, the definition of the gap function is given inside the body of that 
function. If option = 2, it uses the model function previously created.


Finally, part 4 addresses the fitting procedure.

My problem is that with option = 1, it works fine, but when option = 2 
it halts with the following error:


   --> [P, err] = datafit(G, Z, po)
   at line 8 of function G
   at line    16 of function costf
   at line   -12 of function optim
   at line   243 of function datafit ( C:\Program
   Files\scilab-6.1.1\modules\optimization\macros\datafit.sci line 255 )

   Invalid index.
   --> toc
 ans  =
   0.6467990

The normal time to do the full fitting is about 40 s. The time of the 
aborted process is 0.64 s, long enough to have done some iterations, 
which is baffling. I tried to see inside the datafit() source but 
frankly I don't understand what may be happening.


May be somebody with more experience in the use of this function can 
give a hint on what's going on...


Regards,

Federico Miyara

// 1 Data to approximate (Te = F(logf0))
logf  =  linspace(2.3025851,  9.9010847,  7)
Telogf  =  [  0.0446706   0.0225414   0.0147556   0.0055733   0.010994  ...
   0.0189552   0.0277157]
d   =  [-0.0338451  -0.0073327  -0.0076891  -0.0021065   0.0072043  ...
   0.0049894   0.0124498]
logf0  =  log(10*10.^(0:0.005:3.3))
Te  =  interp(logf0,  logf,  Telogf,  d);
   
// 2 Analytic model

function  y=g(x, p)
   y  =  p(1)  +  p(2)*abs(x).^p(3)  -  p(4)*exp(-p(5)*x.^2);
endfunction

// 3 Function to minimize
// (Gap or difference between data and model)
function  e=G(p, z)
   option  =  1
   select  option
   case  1
  gg  =  p(1)  +  p(2)*abs(z(1)).^p(3)  -  p(4)*exp(-p(5)*z(1).^2);
  e  =  z(2)  -  gg;
   case  2
  e  =  z(2)  -  g(z(1),  p)
   end
endfunction

// 4 Parameter algorithm adjustment
Z  =  [logf0  -  6.2515185;  Te];  
po  =  [0.005   -0.00013   4   0.01   1.7]

tic
[P,  err]  =  datafit(G,  Z,  po)
toc



--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Redrawing a maximized figure changes its original size and other problem

2021-09-05 Thread Federico Miyara


Samuel,

The expected behavior would be that the window were completely 
visible from the beginning.


I don't think so. This would require to set a priority between the 
default figure size and default figure position, in a way that anyone 
could clame as debattable. As a user you are already able to tune and 
set the default values of figures properties in your startup file, 
according to your own user's screen and wishes, noticeably .axes_size 
and .figure_position




The current behavior is unfriendly. Being the graphic output a central 
feature in any mathematical software, one would expect that the default 
behavior would be that any figure be completely visible right after its 
creation without any further action by the user. Probably there are many 
things that can be controlled from the startup file or even through the 
figure's properties, but it adds unnecessary complications when what one 
needs is just to view the figure that has been created. By the way, one 
problem with manipulating the startup file is that when updating the 
program or when installing it in a new computer one would need to edit 
it, remembering what to edit just to get the program doing what it 
should have been doing out of the box.


What I'm asking for requires only that the figure rendering engine 
automatically detect the screen size and the presence and height of the  
task bar, and then compute the position of the figure to avoid conflict 
between the figure and the task bar. Indeed, this is the default 
behavior of most of the pop-up windows in virtually every application. 
For instance, opening the preferences window, does exactly this. I have 
even tested what happens if one manually increases the height of the 
task bar (what could be useful if there are many open applications). The 
position of the preferences window adapts up to the situation where 
there is no more room and only then it exceeds the screen limits.


The function createWindow() works a bit better than figure(), since it 
creates a window that does not conflict with a single-line task bar, but 
if the task bar is enlarged, it eventually overlaps the new graphic 
window hiding part of it.


Regards,

Federico





--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Redrawing a maximized figure changes its original size and other problem

2021-09-03 Thread Federico Miyara


Philipp,

No, I don't want to have the figure maximized always; rather, to be able 
to toggle between normal size and maximized (when I need to focus on 
small details such as the difference between experimental and fitted 
graphs). That's actually why the current behavior is bothersome, since 
once redrawn, there is practically no difference between normal and 
maximized, so I cannot, for instance, see at the same time two figures. 
I need then to resize it manually. I shouldn't need to tweak the figure 
properties for that...


As to question 2, I refer to the normal location immediately after 
rendering the figure. The botton of the figure is hidden by the task bar 
so I find myself having to manually relocate each and all figures I 
create just to see its complete content, and that doesn't seem to be a 
normal or expected behavior.


I don't know if that happens only to me or everyone is experiencing this 
when the task bar is always visible.


Regards,

Federico Miyara





On 03/09/2021 07:39, P M wrote:

Hi Federico,

Assuming that you ALWAYS want to have the figure at max screen size:

Question 1:

You can work with the screen width/height values to maximize the figure.

To get the screen values you can use:
- screenWidth =  getsystemmetrics('SM_CXSCREEN')
- screenHeight = getsystemmetrics('SM_CYSCREEN')

Your figureHeight may be some pixels less than the sceen Height, so 
that the taskbar won't be covered.


With these values you can set the figure size using the figure properties.

Question 2:
Maximising a figure at my PC results in a full screen figure, with the 
taskbar at the screen bottom beeing visible.


Having the correct figure size (see Question 1), you can set the 
figure position by:

gcf().figure_position = .



Other approach:

Instead of clearing the complete figure, you maybe only need to clear 
the graph (entitiy).
If you have multiple graphs in one figure, the approach is similar, 
but you need to pick the correct entity.


Assumption:  Only one graph within a single figure.
x  =  linspace(1,100,100);
y  =  sin(x);

f  =  figure(101);
f.background  =  -2;
plot(x,y);
a = gca(); e = gce(); p = e.children();
--> Now maximize the figure manually or have it already a max screen size
p.data  =  [];   // clearing the data of the graph ... same as a.children.children.data 
= []

y  =  cos(x);  // simulating new data
p.data  =  [x;  y]';// replotting the graph with new data

Note:  The approach does not change the axis min/max valuesso you 
maybe need to tweak these parameters, depending on your data.



Good luck,
Philipp






Am Do., 2. Sept. 2021 um 02:24 Uhr schrieb Federico Miyara 
mailto:fmiy...@fceia.unr.edu.ar>>:



Dear All,

I've noticed that when clearing the contents of a maximized figure
using clf() and redrawingthe figurefrom scratch,the maximized
statuschanges status to normal with a size slightly larger than
the available height of the screen. When maximizing it, it really
shrinks to the available screen space. For instance

figure(101);
scf(101);
clf(101);
gcf().background = -2;
plot(x, y)

(I use this structure when I have several figures and need to
refresh one of them).

The presence of the first instruction is necessary for this to
happen. The original (default) size is not recovered unless the
figure is completely cleared.

The second problem is that upon creation, any figure is located
flush with the bottom of the screen, even if I have enabled that
the task bar is always visible. This causes the bottom of the
figure to be hidden behind the task bar. To make it vissible I
need to manually move the figure upwards.

The expected behavior would be that the window were completely
visible from the beginning.

I'm on Windows 7.

Regards,

    Federico Miyara




<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
Libre de virus. www.avast.com

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>


<#m_1245799826228827734_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
users mailing list
users@lists.scilab.org <mailto: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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Adding library in Win10

2021-09-03 Thread Federico Miyara


Izabela,

Haven´t you tried just typing SCIHOME (in capitals) in the console?

The doc¿umentation (help SCIHOME) also says it can somehow be 
customized. Windows 10 isn't explicitly mentioned buy I think it should 
be similar.


Regards,

Federico Miyara


On 03/09/2021 10:38, Izabela Wójcik-Grząba wrote:


Hello,

Till now I have been using Scilab on Win7 and had my library added 
with the use of this procedure:


1. genlib ("Moja_biblioteka","C:/Program Files/mojabiblioteka_scilab")

2. created a scilab.ini file in SCIHOME with a line: Moja_biblioteka = 
lib("C:/Program Files/mojabiblioteka_scilab")


Now I have Win10 and don't know how to do the same on this OS. 
Especially I can't find SCIHOME.


I would be grateful for any help.

Regards,

Iza

--
Izabela Wójcik-Grząba
Zespół Konstrukcji Metalowych
ZKBiM IIB WIL Politechnika Warszawska


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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Redrawing a maximized figure changes its original size and other problem

2021-09-01 Thread Federico Miyara


Dear All,

I've noticed that when clearing the contents of a maximized figure using
clf() and redrawingthe figurefrom scratch,the maximized statuschanges
status to normal with a size slightly larger than the available height
of the screen. When maximizing it, it really shrinks to the available
screen space. For instance

figure(101);
scf(101);
clf(101);
gcf().background = -2;
plot(x, y)

(I use this structure when I have several figures and need to refresh
one of them).

The presence of the first instruction is necessary for this to happen.
The original (default) size is not recovered unless the figure is
completely cleared.

The second problem is that upon creation, any figure is located flush
with the bottom of the screen, even if I have enabled that the task bar
is always visible. This causes the bottom of the figure to be hidden
behind the task bar. To make it vissible I need to manually move the
figure upwards.

The expected behavior would be that the window were completely visible
from the beginning.

I'm on Windows 7.

Regards,

Federico Miyara




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] disable grid in 3d plot

2021-08-28 Thread Federico Miyara


Dear All,

Is there any way to disable the grid on a surface generated using
plot3d() or similar?

Sometimes it is useful, but when the grid where the data to plot are
defined is too tight the black lines on the surface are way too invasive
and the general appearance is almost black. I would expect a smooth
surface, something like Sgrayplot() but in 3d.

Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] problem with convol()

2021-08-26 Thread Federico Miyara

Dear All,

The function convol() used to compute the discrete convolution between 
two signals yields always a row vector, regardless of the orientation of 
the input vectors:


--> a = [1 2 3]'
 a  =
   1.
   2.
   3.

--> b = [4 5]'
 b  =
   4.
   5.
--> c = convol(a, b)
 c  =
  4.   13.   22.   15.

If both input arguments have the same orientation, I think it should 
yield the same orientation. Indeed, this is how conv() behaves:


--> d = conv(a, b)
 d  =
   4.
   13.
   22.
   15.

If both arguments have different orientation, conv() keeps the 
orientation of the first argument.


Is there a reason why both functions behave differently?

Regards,

Federico Miyara



--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] [Posible FRAUDE] How to get path of an open file

2021-08-01 Thread Federico Miyara


Sorry, I've already found that file() is the answer to my requirement.

Federico Miyara


On 01/08/2021 23:36, Federico Miyara wrote:


Dear all,

I need to get the full path of a file opened in Scilab from the fid
number provided by mopen().

The closest shot is dispfiles(fid), but I couldn't find a way to save
the path to a variable (that's what I actually need), since
dispfiles() has zero output arguments.

Thanks,

Federico Miyara

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
Libre de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>


<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] How to get path of an open file

2021-08-01 Thread Federico Miyara


Dear all,

I need to get the full path of a file opened in Scilab from the fid
number provided by mopen().

The closest shot is dispfiles(fid), but I couldn't find a way to save
the path to a variable (that's what I actually need), since dispfiles()
has zero output arguments.

Thanks,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] [Posible FRAUDE] Re: Odd behaviour with dos() function

2021-07-30 Thread Federico Miyara


I think I've finally arrived at a solution for multiple commands when 
using dos(). That is to use the "&&" command separator, which is 
mentioned in the cmnd.exe help.


I think even those of us who have made our first steps in the personal 
computing world in the DOS age aren't generally familiar with this 
separator because when we used DOS we just wrote our commands one after 
the other just pressing Enter between them. The && allows a sort of 
in-line batch.


This should be mentioned in the dos() documentation and a few more 
examples provided.


Regards,

Federico Miyara


On 28/07/2021 19:54, Federico Miyara wrote:


I do the following:

comands = "start | dir H:\ "
dos(comands, "-echo")

Then a command line DOS window opens at the workihg directory of 
Scilab, and doesn't close.


Any further action I attempt with Scilab causes a program crash. The 
same happens without the pipe symbol |.


Regards,

Federico Miyara



On 28/07/2021 10:57, Lester Anderson wrote:

Hello all,

This has been queried previously without an obvious solution.

For example: [output, bOK]=dos('grdinfo Test_10-FAA.grd')
Fails with bOK = F

Adding 'start grdinfo Test_10-FAA.grd gives bOK=T but now dos window 
console with the result


The only way to get the out put shown below is to put the commands 
into a bathch  file:

grd-info.bat (containing the command stream grdinfo Test_10-FAA.grd

Such that the dos function becomes: [out,TF]=dos('start 
grd-info.bat'); out, TF


\D_Drive\Geoscience\Scilab>grdinfo Test_10-FAA.grd
Test_10-FAA.grd: Title:
Test_10-FAA.grd: Command: grdsample -R-10/10/-10/10 -I1m 
@GMTAPI@-01 -Gc:\Temp\Test_10-FAA.grd -fg --GMT_HISTORY=false

Test_10-FAA.grd: Remark:
Test_10-FAA.grd: Pixel node registration used [Geographic grid]
Test_10-FAA.grd: Grid file format: nf = GMT netCDF format (32-bit 
float), CF-1.7
Test_10-FAA.grd: x_min: -10 x_max: 10 x_inc: 0.01667 (1 min) 
name: longitude n_columns: 1200
Test_10-FAA.grd: y_min: -10 y_max: 10 y_inc: 0.01667 (1 min) 
name: latitude n_rows: 1200

Test_10-FAA.grd: v_min: -104.96169281 v_max: 456.651062012 name: z
Test_10-FAA.grd: scale_factor: 1 add_offset: 0
Test_10-FAA.grd: format: netCDF-4 chunk_size: 134,134 shuffle: on 
deflation_level: 3


However, even with this workaround, nothing is written to the 
variable 'out'. The program 'grdinfo' is in the Windows path, so 
should be run without using start. In the past, the function did 
work. Basic Windows commands like {out, TF]=dos('dir') works.


I have verified that nothing is written to the consolebox. In 
addition, this is a new computer and new install of Scilab 6.1.1
Also, the same function under Octave runs correctly as dos('grdinfo 
Test_10-FAA.grd'), and I am assuming the Scilab version should behave 
the same.


Since the mailinglists section is no longer functional, I cannot 
check for possible solutions or pointers. Apologies if this is 
repeating my previous query on the issue.


Thanks

Lester

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



<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 
	Libre de virus. www.avast.com 
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Odd behaviour with dos() function

2021-07-28 Thread Federico Miyara


I do the following:

comands = "start | dir H:\ "
dos(comands, "-echo")

Then a command line DOS window opens at the workihg directory of Scilab, 
and doesn't close.


Any further action I attempt with Scilab causes a program crash. The 
same happens without the pipe symbol |.


Regards,

Federico Miyara



On 28/07/2021 10:57, Lester Anderson wrote:

Hello all,

This has been queried previously without an obvious solution.

For example: [output, bOK]=dos('grdinfo Test_10-FAA.grd')
Fails with bOK = F

Adding 'start grdinfo Test_10-FAA.grd gives bOK=T but now dos window 
console with the result


The only way to get the out put shown below is to put the commands 
into a bathch  file:

grd-info.bat (containing the command stream grdinfo Test_10-FAA.grd

Such that the dos function becomes: [out,TF]=dos('start 
grd-info.bat'); out, TF


\D_Drive\Geoscience\Scilab>grdinfo Test_10-FAA.grd
Test_10-FAA.grd: Title:
Test_10-FAA.grd: Command: grdsample -R-10/10/-10/10 -I1m 
@GMTAPI@-01 -Gc:\Temp\Test_10-FAA.grd -fg --GMT_HISTORY=false

Test_10-FAA.grd: Remark:
Test_10-FAA.grd: Pixel node registration used [Geographic grid]
Test_10-FAA.grd: Grid file format: nf = GMT netCDF format (32-bit 
float), CF-1.7
Test_10-FAA.grd: x_min: -10 x_max: 10 x_inc: 0.01667 (1 min) 
name: longitude n_columns: 1200
Test_10-FAA.grd: y_min: -10 y_max: 10 y_inc: 0.01667 (1 min) 
name: latitude n_rows: 1200

Test_10-FAA.grd: v_min: -104.96169281 v_max: 456.651062012 name: z
Test_10-FAA.grd: scale_factor: 1 add_offset: 0
Test_10-FAA.grd: format: netCDF-4 chunk_size: 134,134 shuffle: on 
deflation_level: 3


However, even with this workaround, nothing is written to the variable 
'out'. The program 'grdinfo' is in the Windows path, so should be run 
without using start. In the past, the function did work. Basic Windows 
commands like {out, TF]=dos('dir') works.


I have verified that nothing is written to the consolebox. In 
addition, this is a new computer and new install of Scilab 6.1.1
Also, the same function under Octave runs correctly as dos('grdinfo 
Test_10-FAA.grd'), and I am assuming the Scilab version should behave 
the same.


Since the mailinglists section is no longer functional, I cannot check 
for possible solutions or pointers. Apologies if this is repeating my 
previous query on the issue.


Thanks

Lester

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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Odd behaviour with dos() function

2021-07-28 Thread Federico Miyara


Lester,

I don't know whether your post is related to my earlier message or it is 
just that we both have had the same problem.


Unfortunately the documentation isn't clear enough, for instance it says:

  commands
  Single text containing instructions sent to the MS Windows cmd.exe 
command interpreter.


but it doesn't say how the instructions should be connected. They could 
be separated by commas, by spaces, by semicolons... Seemingly it is by 
spaces (at least this way the bOK argumet is True), but there could be 
some ambiguity, for instance if one wants to change directory and the 
directory contains two words and the second is also a command or a program.


On the other hand the expression "single text" is not clear. What is a 
"text" in Scilab? Text is meaningless, in Scilab we have strings, and 
"single" is somewhat vague. Does it mean a one-component string?


Your workaround of using a batch may work, but it requires the extra job 
of creating and saving it and at the end deleting it, which should be 
automatic.


Regards,

Federico Miyara


On 28/07/2021 10:57, Lester Anderson wrote:

Hello all,

This has been queried previously without an obvious solution.

For example: [output, bOK]=dos('grdinfo Test_10-FAA.grd')
Fails with bOK = F

Adding 'start grdinfo Test_10-FAA.grd gives bOK=T but now dos window 
console with the result


The only way to get the out put shown below is to put the commands 
into a bathch  file:

grd-info.bat (containing the command stream grdinfo Test_10-FAA.grd

Such that the dos function becomes: [out,TF]=dos('start 
grd-info.bat'); out, TF


\D_Drive\Geoscience\Scilab>grdinfo Test_10-FAA.grd
Test_10-FAA.grd: Title:
Test_10-FAA.grd: Command: grdsample -R-10/10/-10/10 -I1m 
@GMTAPI@-01 -Gc:\Temp\Test_10-FAA.grd -fg --GMT_HISTORY=false

Test_10-FAA.grd: Remark:
Test_10-FAA.grd: Pixel node registration used [Geographic grid]
Test_10-FAA.grd: Grid file format: nf = GMT netCDF format (32-bit 
float), CF-1.7
Test_10-FAA.grd: x_min: -10 x_max: 10 x_inc: 0.01667 (1 min) 
name: longitude n_columns: 1200
Test_10-FAA.grd: y_min: -10 y_max: 10 y_inc: 0.01667 (1 min) 
name: latitude n_rows: 1200

Test_10-FAA.grd: v_min: -104.96169281 v_max: 456.651062012 name: z
Test_10-FAA.grd: scale_factor: 1 add_offset: 0
Test_10-FAA.grd: format: netCDF-4 chunk_size: 134,134 shuffle: on 
deflation_level: 3


However, even with this workaround, nothing is written to the variable 
'out'. The program 'grdinfo' is in the Windows path, so should be run 
without using start. In the past, the function did work. Basic Windows 
commands like {out, TF]=dos('dir') works.


I have verified that nothing is written to the consolebox. In 
addition, this is a new computer and new install of Scilab 6.1.1
Also, the same function under Octave runs correctly as dos('grdinfo 
Test_10-FAA.grd'), and I am assuming the Scilab version should behave 
the same.


Since the mailinglists section is no longer functional, I cannot check 
for possible solutions or pointers. Apologies if this is repeating my 
previous query on the issue.


Thanks

Lester

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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Question on the use of dos

2021-07-28 Thread Federico Miyara


Dear all,

I need to use dos() to run an external command line application and have
been experimanting a bit.

I run the following:

commands = "H: cd SOFTWARE\FLAC\ dir"
[output, bOK, exitcode] = dos(commands, "-echo")

or

commands = "H: cd SOFTWARE cd FLAC dir"
[output, bOK, exitcode] = dos(commands, "-echo")

The bOK argument returns T so it seems it worked properly, however I
don't get any echo in the console. I should see the comntent of the
directory FLAC.

What am I doing wrong?

Regards,

Federico Miyara



--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] [Posible FRAUDE] Re: Two issues in 6.1.1

2021-07-22 Thread Federico Miyara


Dear Clément,

Thanks for the encouragement, I've submitted them as bugs #16718 and #16719.

Regards,

Federico Miyara


On 22/07/2021 11:58, Clément David wrote:


Dear Federico,

Thanks for the reports, could you post bugs to 
https://bugzilla.scilab.org this will let us track the issue and write 
them into the CHANGES.md document.


Regards,

Clément

*From:*users  *On Behalf Of *Federico 
Miyara

*Sent:* Thursday, July 22, 2021 4:43 PM
*To:* Users mailing list for Scilab 
*Subject:* [Scilab-users] Two issues in 6.1.1


Dear all,

I've found two issues in Scilab 6.1.1. The first is that sometimes (I 
can't replicate this all the times) the DOS window that opens when 
running scilex doesn't close properly after launching so we have two 
items on the task bar the bottom of the screen. The only way to close 
it is to close the program and hope that next time it will close.


The second happens when in a comment the string "todo" appears 
followed by a space or a colon: the color turns from green to orange:


/// el mé//todo manual/
/// la metodología manual/
/// //todo:///
/// //TODO:///
/// //Todo:/
/// ToDo: /
/// TO do:/

According to the color settings this is an expected result when at the 
beginning of a line (I guess it means "things left to do"), but it is 
not adequate when "todo" is part of another word (like in the Spanish 
word "método" in the first line). I can confirm this happens only in 
Scilab 6.1.1. In 6.1.0 it didn't happen, actually in no case the 
orange highlighting were honoured.


Regards.

Federico Miyara

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>



Libre de virus. www.avast.com 
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 




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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] indexing array of rationals

2021-07-22 Thread Federico Miyara


Stéphane,

You may try, if k is the index,

pi(2)(k)/pi(3)(k)

This is because a rational is a list and the first element is a vector 
of strings describing the structure, not a component of the matrix of 
rationals.


Indeed I think there is not such a thing as a matrix of rationals, but a 
rational (so, itself a list) whose components 2 and 3 are matrices of 
polynomials; respectively, numerator and denominator polynomials.


When one tries to create a matrix of lists (general lists, not 
rationals) it yields an error:


a = list( 1, "a", %s);
b = list( 2, "b", %z);
c = [a,b]

The error message is

Undefined operation for the given operands.
check or define function %l_c_l for overloading.

When the lists are specifically rtationals, the command works fine, for 
instance


d = [(1+%s)/(1+2*%s), (1-%s)/(1+%s+2*%s^2)]

but it is not a matrix of rationals but a rational whose numerator and 
denominator fields are matrices of polynomials


Regards,

Federico Miyara


On 22/07/2021 17:08, Stéphane Mottelet wrote:

Hi all,

I thought indexing an array of rationals was possible. Likely this is 
no possible and this is a pity


--> pi
 pi  =

  θ +2θ²
    --
    1 +4θ +3θ²

    0.333θ
   
   0.333 +θ

    0.333θ
   
   0.333 +θ

  θ +2θ²
    --
    1 +4θ +3θ²

--> pi(1)
 ans  =

  "r"  "num"  "den"  "dt"

Any clue, somebody ?




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Two issues in 6.1.1

2021-07-22 Thread Federico Miyara


Dear all,

I've found two issues in Scilab 6.1.1. The first is that sometimes (I 
can't replicate this all the times) the DOS window that opens when 
running scilex doesn't close properly after launching so we have two 
items on the task bar the bottom of the screen. The only way to close it 
is to close the program and hope that next time it will close.


The second happens when in a comment the string "todo" appears followed 
by a space or a colon: the color turns from green to orange:


// el método manual
// la metodología manual
// todo:
// TODO:
// Todo:
// ToDo:
// TO do:

According to the color settings this is an expected result when at the 
beginning of a line (I guess it means "things left to do"), but it is 
not adequate when "todo" is part of another word (like in the Spanish 
word "método" in the first line). I can confirm this happens only in 
Scilab 6.1.1. In 6.1.0 it didn't happen, actually in no case the orange 
highlighting were honoured.


Regards.

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab 6.1.1 release

2021-07-20 Thread Federico Miyara


Thanks to all the developers for such a massive update!

Regards,

Federico Miyara


On 20/07/2021 10:18, Clément David wrote:

Dear Scilab users,

We are pleased to announce the release of Scilab 6.1.1 as a joint effort 
between Scilab contributors and the Scilab team at ESI Group.

Scilab 6.1.1 is the first revision of the 6.1 development branch and is 
compatible with the 6.1.0 release. It fixes 156 bugs and implements missing 
features from the 6.1.0 version especially:

* Improve readability on plot's title and displayed values
* Fix crashes and slow behaviors on functions
* Add missing arguments and behaviors to existing functions
* Reword and add examples on many help pages

For the complete list of changes and bugs fixed, please take a look at the 
CHANGES file https://help.scilab.org/CHANGES

Download this brand new version at https://www.scilab.org/download/6.1.1

--
Clément DAVID on behalf of the Scilab team.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users






--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] partial fractions

2021-07-16 Thread Federico Miyara


Dear All,

I'm wonderig whether there is a standard method to obtain the partial 
fraction expansion of a rational function.


Searching, I've found the function pfss(), which purportedly is meant 
for that, but I find it doesn't give a complete solution. For instance:


// Poles and zeros
p = [-8:-1];
z = [0 0 0 0];

// Numerator and denominator
N = prod(%s - z)
D = prod(%s - p)

// Rational function
H = N/D

// Partial fractions
HH = pfss(H)

The result is

HH  =
   HH(1)

   -8 -5.7428571s -3.9515873s² +0.2960317s³ -0.0946429s⁴ -0.006746s⁵ 
-0.0001984s⁶
-- 


  40320 +69264s +48860s² +18424s³ +4025s⁴ +511s⁵ +35s⁶ +s⁷

   HH(2)

   0.0001984
   -
 1 +s

The second component in the list is indeed one of the partial fractions, 
but the first one is not an irreductible version. Computing HH(1) + 
HH(2) yields H with good approximation.


I guess I could proceed iteratively with HH(1), but it would be nice to 
have a function performing this automatically. I couldn't find such a 
function


Regards,

Federico Miyara



--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] [Posible FRAUDE] Re: Fwd: problem with subplot

2021-07-15 Thread Federico Miyara


One more detail: if the ylabel of one of the plots is not required, the 
graph doesn't extend towards the left but has the same width as the 
others. This is what one would expect from the use of xlabel: its 
presence or absence shouldn't affect the height of the plot relative to 
the other plots.


Federico


On 15/07/2021 21:47, Federico Miyara wrote:


Philipp,

Thanks! That's the reason indeed!

The workarounds do work but with pitfalls. With xstring() the label 
moves around when zooming in or out, and xlabel takes too much space, 
in fact saving space was the reason to place it only on the last plot.


Probably it would be possible to adapt the coordinates x, y for 
xetring to the bounds of the axes, but I'm not sure the positions 
would be updated when interactively zooming.


The desired behavior would be that by default all plots would be the 
same size or that it would be possible to place a label relative to a 
figure


Regards,

Federico


On 15/07/2021 04:02, P M wrote:


Hi Federico,

my best guess:   In your example only subplot(4,1,4) gets the x_label
Since this needs space, the diagram is smaller.

Workaround:    create label for x-axis via xstring

Or:

Assign a x_label for each subplot, but hide it.
This will assign "space" for the label, but it won't be 
displayed...hence all diagrams should look the same...


x  =  linspace(0,2*%pi,1000)
y  =  sin(x)
f  =  figure();
f.background  =  8;

for  i  =  1:4
 subplot(4,1,i)
 plot(x,y);
 a  =  gca();
 a.x_label.text  =  't';
 a.x_label.visible  =  'off';
end
a.x_label.visible  =  'on';
Best Regards,
Philipp




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



<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 
	Libre de virus. www.avast.com 
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Fwd: problem with subplot

2021-07-15 Thread Federico Miyara


Philipp,

Thanks! That's the reason indeed!

The workarounds do work but with pitfalls. With xstring() the label 
moves around when zooming in or out, and xlabel takes too much space, in 
fact saving space was the reason to place it only on the last plot.


Probably it would be possible to adapt the coordinates x, y for xetring 
to the bounds of the axes, but I'm not sure the positions would be 
updated when interactively zooming.


The desired behavior would be that by default all plots would be the 
same size or that it would be possible to place a label relative to a figure


Regards,

Federico


On 15/07/2021 04:02, P M wrote:


Hi Federico,

my best guess:   In your example only subplot(4,1,4) gets the x_label
Since this needs space, the diagram is smaller.

Workaround:    create label for x-axis via xstring

Or:

Assign a x_label for each subplot, but hide it.
This will assign "space" for the label, but it won't be 
displayed...hence all diagrams should look the same...


x  =  linspace(0,2*%pi,1000)
y  =  sin(x)
f  =  figure();
f.background  =  8;

for  i  =  1:4
 subplot(4,1,i)
 plot(x,y);
 a  =  gca();
 a.x_label.text  =  't';
 a.x_label.visible  =  'off';
end
a.x_label.visible  =  'on';
Best Regards,
Philipp




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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] problem with subplot

2021-07-14 Thread Federico Miyara


Dear All,

I'm using subplot to plot several signals. particularly, the three last
ones are almost identioal, but the space allocated for all of them is
different. The first is taller, the middle ones are visually similar,
and the last one is clearly smaller. I think this is not the expected
behavior. I know I could tweak some properties of the figure or its
children, but I should this should yield the correct layout
automatically. Any idea what's going on?

Regards,

Federico Miyara



--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] spectrogram

2021-07-12 Thread Federico Miyara


The time-frequency representation implicit in the spectrogram has many 
uses apart from sound analysis, for instance ECG, EMG and EEG signals, 
mechanical vibration, light signals, seismic signals, sun spots, 
circadian rhythms, meteorology, etc.


Here I'm attaching a new version of the function spectrogram() that 
includes the possibility of choosing the color map, as in the updated 
version of mapsound() proposed by Samuel.


This function allows to choose directly the size of the FFT, the 
overlapping (in samples rather than in seconds), the sample rate, the 
type of windowing function, the type of graphic presentation, with 
linear or log distribution of the levels over the color map, either 
showing or not the reference color map, and the color map, either one of 
the standard ones introduced as a string or a custom one introduced as a 
three-column matrix. The output includes the numerical version of the 
spectrogram and, optionally, the time axis and frequency axis, allowing 
plotting it in a 3D version with plot3d() as well as postprocessing it 
(such as pitch or formant extraction).


I have made no attempt to include other spectrum algorithms apart from 
the FFT, or reassignment strategies, which could be a future improvement.


Regards,

Federico Miyara


On 12/07/2021 06:58, Claus Futtrup wrote:

Hi all

An Amplitude(time,frequency) plot should be named Spectrogram. That's 
the official name for it.


>mapsound(), which plots a spectrogram without numerical information

I didn't check, but if this is true, then an improvement as proposed 
by Federico would be good.


Best regards,
Claus

On 12-07-2021 11:38, Samuel Gougeon wrote:

Hello Federico,

As reported at http://bugzilla.scilab.org/16530 , mapsound() could 
not really be used.

It has been rewritten in Scilab 6.1.1.
It's help page in PDF is available at 
http://bugzilla.scilab.org/attachment.cgi?id=5178
To be compared to the last 6.1.0 former version 
https://help.scilab.org/docs/6.1.0/fr_FR/mapsound.html


It could be still improved later with additional suggested features.

Regards

Samuel

PS : A redirection mechanism to be set in user's preferences has been 
implemented in Scilab 6.1.1
to automatically redirect help queries in the help browser toward the 
most relevant page, as uman() does.
It has been designed first to help scilab newbies coming from other 
languages, but can also be used

for other common terms.
Even if it is not "standard", mapsound is explicit enough, in the 
right help section, and OK to me.

So we could redirect spectrogram to mapsound.

Le 12/07/2021 à 01:21, Federico Miyara a écrit :


Dear All,

I noticed there is no spectrogram function in Scilab that provides 
both graphic and numerical output. There is a function mapsound(), 
which plots a spectrogram without numerical information and without 
control over important aspects such has FFT length or windowing 
function. By the way, in the field of digital sound processing the 
usual name for this is spectrogram, not mapsound, which is a bit 
confusing.


I created a spectrogram() function. Even if it doesn't yet comply 
with the recommended style for Scilab functions (particularly 
regarding error handling or manual page), I think it might be useful 
for some users. I attach the function and a test script.


Regards,

Federico Miyara



___
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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
function [z, t, f] = spectrogram(x, N, M, Fs, w, grph, cmap)
// Spectrogram of a signal
//
// Usage
//   [z, t, f] = spectrogram(x, N, Fs, M, w, grph)
// where
//   x:signal vector
//   N:FFT window length. Default: 1024
//   M:offset between FFT windows in samples
// Default: 512 
//   Fs:   sample rate in Hz. Default: 44100
//   w:windowing function; accepted values are
// "boxcar", "hann", "hamming", "blackman", 
// "bharris", "flattop" and a custom vector
// containing N components of the window.
// Default: "hann"
//   grph: graphic output; accepted values are
// "lin", "lincmap", "log", "logcmap",
// lin/log refers to linear or logarithmic
// distribution of magnitude along the
// colormap and cmap to the inclusion or 
// not of a colormap. The default is no
// graph.
//   cmap: a string indicating any of the

[Scilab-users] spectrogram

2021-07-11 Thread Federico Miyara


Dear All,

I noticed there is no spectrogram function in Scilab that provides both
graphic and numerical output. There is a function mapsound(), which
plots a spectrogram without numerical information and without control
over important aspects such has FFT length or windowing function. By the
way, in the field of digital sound processing the usual name for this is
spectrogram, not mapsound, which is a bit confusing.

I created a spectrogram() function. Even if it doesn't yet comply with
the recommended style for Scilab functions (particularly regarding error
handling or manual page), I think it might be useful for some users. I
attach the function and a test script.

Regards,

Federico Miyara




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
function [z, t, f] = spectrogram(x, N, Fs, M, w, grph)
// Spectrogram of a signal
//
// Usage
//   [z, t, f] = spectrogram(x, N, Fs, M, w, grph)
// where
//   x:signal vector
//   Fs:   sample rate in Hz
//   N:FFT window length
//   Fs:   sample rate in Hz
//   M:offset between FFT windows in samples
//   w:windowing function; accepted values are
// "boxcar", "hann", "hamming", "blackman", 
// "bharris", "flattop" and a custom vector
// containing N components of the window
//   grph: graphic output; accepted values are
// "lin", "lincmap", "log", "logcmap",
// lin/log refers to linear or logarithmic
// distribution of magnitude along the
// colormap and cmap to the inclusion or 
// not of a colormap. The default is no
// graph.   
//   z:matrix with N/2 rows and
// floor((length(x) - N)/M + 1) columns, 
// where each column contains the absolute
// value of the spectrum beginning at each 
// multiple of M
//   t:vector containing starting times in s of
// each FFT window
//   f:vector containing the values of the
// FFT frequency bins in Hz
// 
// ---
// Author: Federico Miyara
// Date:   2021-07-10

// Argument handling
rhs = argn(2);
if rhs<6
grph = [];
end
if rhs<5
w = "hann";
end
if rhs<4
M = 512;
end
if rhs<3
Fs = 44100;
end
if rhs<2
N = 1024;
end

// Data for testing purpooses --DELETE--
if 1==2
Fs = 44100
N = 1024
M = 256
w = "hann"
grph = "logcmap"
tt = 0:1/Fs:2;
fo = 8000
fm = 0.5
df = 4000
ff = fo + df*sin(2*%pi*fm*tt);
phi = 2*%pi*cumsum(f)/Fs;
caso = 2
select caso
case 1
x = 0.4*sin(phi) + 0.3*sin(2*phi);
case 2
x = sin(phi) + sin(2*phi);  
x = min(x, ones(x));  
end
wavwrite(x,"d:\hola\fmod.wav")
end

// Ensure the signal is a column vector
x = x(:);

// Number of FFT windows 
Q = floor((length(x) - N)/M + 1);

// Initialize z
z = zeros(N/2, Q);

// Generate a matrix whose columns are
// segments with length N of the signal
// starting at sample indices multiple 
// of M
y = zeros(N, Q);
for k=1:Q
y(:,k) = x((k-1)*M+1:(k-1)*M+N);
end

// Compute window function
if type(w)==1
w = w(:);
else
select w
case "boxcar"
w = 1;
case "hann"
w = 0.5 - 0.5*cos(2*%pi*[0:N-1]/N)';
case "hamming"
w = 0.54 - 0.46*cos(2*%pi*[0:N-1]/N)';
case "blackman"
w = 0.42 - 0.5*cos(2*%pi*[0:N-1]/N)' + ...
0.08*cos(4*%pi*[0:N-1]/N)'; 
case "bharris"
w = 0.35875 - 0.48829*cos(2*%pi*[0:N-1]/N)' + ... 
0.14128*cos(4*%pi*[0:N-1]/N)' - ...
0.01168*cos(6*%pi*[0:N-1]/N)';
case "flattop"
wft = 1 - 1.90796*cos(2*%pi*[0:N-1]/N)' + ...
1.07349*cos(4*%pi*[0:N-1]/N)' - ...
0.18199*cos(6*%pi*[0:N-1]/N)';
end
end
// Replicate window
ww = repmat(w, 1, Q);

// FFT of the windowed signal along columns
// and conversion to unilateral spectrum
z = abs(fft(y.*ww, -1, 1))(1:N/2,:)*2/N;
z(1,:) = z(1,:)/2;

// Starting times of the FFT windows 
t = (0:Q-1)*M/Fs;

// Frequencies of the FFT bins
f = (0:N/2-1)*Fs/N;

// Graphic output
cmap = jetco

[Scilab-users] Question on saving with wavwrite()

2021-06-15 Thread Federico Miyara

Dear all,

I try to save a signal as a wave file, using wavwrite(), to the root
directory of the drive where I have declared the default directory.
Unexpectedly, the wave file is saved to the default directory. For instance:

My default directory:

D:\work_scilab

My command:

wavwrite(x, Fs, "D:\test.wav")

The resulting path to my file:

D:\work_scilab\test.wav

instead of

D:\test.wav

I wonder if I making some mistake.

Thank you.

Regards,

Federico Miyara



--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problem with ascii()

2021-05-07 Thread Federico Miyara


Samuel,

I've found that the crash is not consistent. Sometimes it crashes, 
sometimes not. I actually discovered the problem in a much longer text 
read from a text file using mgetl() and inserting manually the line feed 
and cariage return characters (13 and 10).


The problem appears indeed when displaying, not creating, so it seems 
thar the problem is not with ascii() but, as you say, with the display 
feature (filename is any plain text file):



fid = mopen(filename, 'rt');
text1 = mgetl(fid, -1);
mclose(fid);

text = [];
for k=1:size(text1,1)
    text = [text, ascii(text1(k)), 13, 10];
end

text = ascii(text);


My first example ctrashes sometimes Scilab. Displaying this one either 
just entering the variable text or using disp(text) ctrashes it always 
(with a file with 3200 characters and 3 paragraphs)


Regards,

Federico




On 07/05/2021 05:44, Samuel Gougeon wrote:

Hello,

Le 07/05/2021 à 08:57, Federico Miyara a écrit :


Dear all,

If I run this simple code

ascii([ascii("hello"), 13,10, ascii("world")])

Scilab crashes.


Do you get a crash if you prevent displaying the result with a final 
semi-colon?


Le 07/05/2021 à 09:26, Jean-Yves Baudais a écrit :
On Scilab 6.1.0.1582621796 


IMHO, that's the question. Some things were fixed for the last year 
about /the display/ of ascii(13), that actually sometimes crashed.

In the nightly built version, i get the expected display:

--> ascii([ascii("hello"), 13, 10, ascii("world")])
 ans  =
  "hello
world"

Regards
Samuel


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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problem with ascii()

2021-05-07 Thread Federico Miyara


Jean-Yves,

Typing ver yields

--> ver
 ans  =
 column 1
  "Scilab Version: "
  "Operating System: "
  "Java version: "
  "Java runtime information: "
  "Java Virtual Machine information: "
  "Vendor specification: "
 column 2
  "6.1.0.1582621796"
  "Windows 7 6.1"
  "1.8.0_151"
  "Java(TM) SE Runtime Environment (build 1.8.0_151-b12)"
  "Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)"
  "Oracle Corporation"

Regards,

Federico


On 07/05/2021 04:26, Jean-Yves Baudais wrote:

Hello,


ascii ( [ ascii ( " hello " ) , 13 , 10 , ascii ( " world " ) ] )


On Scilab 6.1.0.1582621796 I get


--> ascii([ascii("hello"), 13, 10, ascii("world")])
  ans  =


world"


What is your Scilab version?


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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus

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


[Scilab-users] Problem with ascii()

2021-05-07 Thread Federico Miyara


Dear all,

If I run this simple code

ascii([ascii("hello"), 13,10, ascii("world")])

Scilab crashes. I should get something like this:

"hello
world"

Is it a bug?

Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plot2d3()

2021-05-02 Thread Federico Miyara


Christophe:

Thank you for making me aware of xpolys(), a new addition to my bag of
tools.

A good alternative workaround.

Regards,

Federico Miyara



On 26/04/2021 04:42, Dang Ngoc Chan, Christophe wrote:

Hello,


De : fmiyara
I'm trying to get a plot like this:

[...]

Maybe you should try with xpolys(), e.g.

--

[n, ybase] = (10, -12);

y = ybase + 9*grand(1,n,"def");

x=1:n;

Y=[y ; ybase*ones(y)];

X=[x ; x]

scf(0);

clf();

xpolys(X, Y, ones(y));

plot(x, y, "o");

gcf().children.data_bounds(1, 2) = ybase;

--

But it mays have some drawbacks.

HTH


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer


General
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plot2d3()

2021-04-28 Thread Federico Miyara


Samuel,





Nice plot (a Power Spectrum Density after applying an open window()..?
:-))



Actually, it is the FFT of a short tone burst (completely open, boxcar
window :) ) with thrice its length zero-padding



I see two issues with this trial:

  * setting y_ticks labels by hand cancels the auto_ticking mode for
ordinates, if we resize the graphic window
  * The y value on datatips becomes wrong



This is true, I just needed it to export once to SVG so I ensured the
desired size before actually running the workaround (which, by the way I
mproved to avoid having to enter the values by hand)


In the meantime, here is another possible workaround, that is both
auto_ticking and with correct datatiped values:
// Raw data [n,  ybase]  =  (10,  -12);
y  =  ybase  +  9*grand(1,n,"def");
// Actual data y  =  [ybase*ones(y);  y  ;  ybase*ones(y)];
x  =  (1:n)  .*.  [1  1  1];
// Plotting clf,  plot(x(:),  y(:),  "-o")
set(gce().children,  "mark_stride",3,  "mark_offset",1);



This seems a very good workaround! Probably it would be better if
drawing first the lines and then the circles only for the original data.

Thanks!

Federico


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Why window() provides only symmetric weighting?

2021-04-12 Thread Federico Miyara


Claus,

For me the plurality is not so important - but let's say it's the 
wording used in all our educational books (in English) ... just dig 
into any Signal Analysis book, etc., and what we're trying to name 
here is exactly that, then it would be bad for Scilab to give it a 
different name. Renaming something that is universally defined 
otherwise is an uphill battle we cannot win.


As I implied earlier, nomenclature could hardly be right or wrong since 
it is mostly arbitrary. But there could be more logical or less logical 
choices.


When it is well established, it is also a battle that is not worth 
fighting, especially if there is some sort of rationale behind it.


Asymmetric window functions is new to me.I googled about window 
functions and found (stumbled upon):

https://journals.sagepub.com/doi/pdf/10.1260/1748-3018.9.4.389


This is another kind of asymmetry. "Periodic" window functions are only 
slightly asymmetric. I don't think they qualify for the kind of windows 
treated in that paper.


Asymmetric windows seem to be a good choice to smooth out the spectrum 
if phase response is not important. Scilab doesn't have any asymmetric 
function, but if a plan to add new windows were approved, they could be 
included along with several more traditional window functions currently 
not covered (such as Blackman, Blackman-Harris or a number of flat-tops).


Symmetric windows are used for FIR filter design. Periodic windows are 
used for spectrum analysis.


Regards,

Federico Miyara

Conclusion: Asymmetric window functions have a purpose. When there's 
asymmetric windows, then there must also be symmetric windows.
Here's a short list of symmetric window functions: 
https://mathworld.wolfram.com/ApodizationFunction.html


Best regards,
Claus

On 12-04-2021 17:19, Federico Miyara wrote:


Samuel:

As a general concept, you are right ... but with nuances. The problem 
is deciding when something is really wrong and when it is just a 
question of opinion or personal preference. It is wrong to say the 
Earth is flat, no matter how many people say it. But is it right or 
wrong to call something just a conventional name?


For instance: Is it right to call the derivative of a function 
"derivative"? Probably not, because "derivative" is a general concept 
which seems to have no relationship with its meaning in math. 
Probably in its origins it was more related to grammar than to math. 
But once established for centuries, it wouldn't be convenient to 
change it on the basis that it is "wrong".


By the same token, calling "periodic" a window function obtained from 
periodic functions (cosines) whose period is equal to its length 
doesn't seem intrinsically wrong to me. Calling it "closed" would be 
worse since one immediately thinks either of a closed set, which is 
not, or a closed curve, which isn't either.


But even if we found a better word, changing it would very likely 
create an unnecessary cognitive dissonance to thousands or millions 
of practitioners.


Anyway, if a much better and cristal-clear word (i.e., whose meaning 
would be immediately obvious in its context) were found and gained 
consensus, no problem to use it instead of "periodic". The important 
thing in my proposal was to include in the window() function the 
feature, not how we call it.


Regards,

Federico Miyara



On 12/04/2021 04:22, Dang Ngoc Chan, Christophe wrote:

Hello,


De : Federico Miyara
Envoyé : dimanche 11 avril 2021 02:08

Like it or not, I guess these keywords come from Matlab, and as Matlab
still seems to dominate the market, many people, including those
willing to quit Matlab (as I did several years ago), are quite used to
those keywords

I don't agree with this argument.
If a way of doing is wrong, then just keep on going because "everybody does so" 
is just an argumentum ad populum

https://en.wikipedia.org/wiki/Argumentum_ad_populum

which is a fallacious argument.

Regards.


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer


General
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 
	Libre de virus. www.avast.com 
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

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

Re: [Scilab-users] Why window() provides only symmetric weighting?

2021-04-12 Thread Federico Miyara


There are several software packages, not only Matlab, that call this 
concept "periodic", for instance Octave, Scipy (from Python), DADiSP. 
Regarding the last one, I've found an interesting reference:


https://www.dadisp.com/webhelp/mergedProjects/refman2/FncrefFK/FLATTOP.htm

Here, along with a description of the function, it mentions that 
"periodic" can also be called "iso" since there is ISO Standard 18431-1 
dealing with vibrations (Mechanical vibration and shock — Signal 
processing Part 1: General introduction), which seemingly makes some 
related normative prescriptions. Unfortunately the standard is too 
expensive for me to even attempt to buy it, but perhaps some member of 
this list has university access to these Standards.


I'm pretty sure that the ISO doesn't suggest that the name of this type 
of window is "iso", but I'm in doubt whether they call it "periodic" or 
they just introduce the recommended formula or algorithm.


Anyway, "iso" would be even more obscure than "periodic", if only 
because there are literally thousands of ISO standards and most users 
probably don't even suspect there is one covering this.


Regards,

Federico Miyara


On 12/04/2021 11:23, Claus Futtrup wrote:

Dear friends

I believe the initial question is related to giving more options to 
the window functions, such that it can continue how it is today (aka 
'symmetric') but also offer alternatives. If these additional options 
makes sense, and can default such that they are not required (existing 
code continues to work unaffected), and the additional options are 
useful and meaningful in a mathematical sense, then I'm all for adding 
these options.


When it comes to naming schemes, then Scilab is not required to 
strictly follow the Matlab regime. We can choose what we find most 
correct and concise. In some cases Scilab is 'better' than our 
competition, which is a pleasure. It is true that some users come from 
Matlab and sometimes we read Matlab code to convert its functionality 
into Scilab - in these cases it works perfectly good for me to make a 
Matlab-to-Scilab translation somewhere in the documentation.


Therefore, I hope we can have a good discussion about which name is 
the most meaningful.


With kind regards,
Claus

On 12-04-2021 09:22, Dang Ngoc Chan, Christophe wrote:

Hello,


De : Federico Miyara
Envoyé : dimanche 11 avril 2021 02:08

Like it or not, I guess these keywords come from Matlab, and as Matlab
still seems to dominate the market, many people, including those
willing to quit Matlab (as I did several years ago), are quite used to
those keywords

I don't agree with this argument.
If a way of doing is wrong, then just keep on going because 
"everybody does so" is just an argumentum ad populum


https://en.wikipedia.org/wiki/Argumentum_ad_populum

which is a fallacious argument.

Regards.


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer


General
This e-mail may contain confidential and/or privileged information. 
If you are not the intended recipient (or have received this e-mail 
in error), please notify the sender immediately and destroy this 
e-mail. Any unauthorized copying, disclosure or distribution of the 
material in this e-mail is strictly forbidden.

___
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





--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus

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


[Scilab-users] Fwd: Re: Why window() provides only symmetric weighting?

2021-04-12 Thread Federico Miyara


Samuel (and Christophe),

I apologize for mixing up your names. My reply was intended for 
Christophe, not Samuel.


Regards,

Federico Miyara


 Forwarded Message 
Subject: 	Re: [Scilab-users] Why window() provides only symmetric 
weighting?

Date:   Mon, 12 Apr 2021 12:19:08 -0300
From:   Federico Miyara 
Reply-To:   Users mailing list for Scilab 
To: users@lists.scilab.org




Samuel:

As a general concept, you are right ... but with nuances. The problem is 
deciding when something is really wrong and when it is just a question 
of opinion or personal preference. It is wrong to say the Earth is flat, 
no matter how many people say it. But is it right or wrong to call 
something just a conventional name?


For instance: Is it right to call the derivative of a function 
"derivative"? Probably not, because "derivative" is a general concept 
which seems to have no relationship with its meaning in math. Probably 
in its origins it was more related to grammar than to math. But once 
established for centuries, it wouldn't be convenient to change it on the 
basis that it is "wrong".


By the same token, calling "periodic" a window function obtained from 
periodic functions (cosines) whose period is equal to its length doesn't 
seem intrinsically wrong to me. Calling it "closed" would be worse since 
one immediately thinks either of a closed set, which is not, or a closed 
curve, which isn't either.


But even if we found a better word, changing it would very likely create 
an unnecessary cognitive dissonance to thousands or millions of 
practitioners.


Anyway, if a much better and cristal-clear word (i.e., whose meaning 
would be immediately obvious in its context) were found and gained 
consensus, no problem to use it instead of "periodic". The important 
thing in my proposal was to include in the window() function the 
feature, not how we call it.


Regards,

Federico Miyara



On 12/04/2021 04:22, Dang Ngoc Chan, Christophe wrote:

Hello,


De : Federico Miyara
Envoyé : dimanche 11 avril 2021 02:08

Like it or not, I guess these keywords come from Matlab, and as Matlab
still seems to dominate the market, many people, including those
willing to quit Matlab (as I did several years ago), are quite used to
those keywords

I don't agree with this argument.
If a way of doing is wrong, then just keep on going because "everybody does so" 
is just an argumentum ad populum

https://en.wikipedia.org/wiki/Argumentum_ad_populum

which is a fallacious argument.

Regards.


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer


General
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 
	Libre de virus. www.avast.com 
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Why window() provides only symmetric weighting?

2021-04-12 Thread Federico Miyara


Samuel:

As a general concept, you are right ... but with nuances. The problem is 
deciding when something is really wrong and when it is just a question 
of opinion or personal preference. It is wrong to say the Earth is flat, 
no matter how many people say it. But is it right or wrong to call 
something just a conventional name?


For instance: Is it right to call the derivative of a function 
"derivative"? Probably not, because "derivative" is a general concept 
which seems to have no relationship with its meaning in math. Probably 
in its origins it was more related to grammar than to math. But once 
established for centuries, it wouldn't be convenient to change it on the 
basis that it is "wrong".


By the same token, calling "periodic" a window function obtained from 
periodic functions (cosines) whose period is equal to its length doesn't 
seem intrinsically wrong to me. Calling it "closed" would be worse since 
one immediately thinks either of a closed set, which is not, or a closed 
curve, which isn't either.


But even if we found a better word, changing it would very likely create 
an unnecessary cognitive dissonance to thousands or millions of 
practitioners.


Anyway, if a much better and cristal-clear word (i.e., whose meaning 
would be immediately obvious in its context) were found and gained 
consensus, no problem to use it instead of "periodic". The important 
thing in my proposal was to include in the window() function the 
feature, not how we call it.


Regards,

Federico Miyara



On 12/04/2021 04:22, Dang Ngoc Chan, Christophe wrote:

Hello,


De : Federico Miyara
Envoyé : dimanche 11 avril 2021 02:08

Like it or not, I guess these keywords come from Matlab, and as Matlab
still seems to dominate the market, many people, including those
willing to quit Matlab (as I did several years ago), are quite used to
those keywords

I don't agree with this argument.
If a way of doing is wrong, then just keep on going because "everybody does so" 
is just an argumentum ad populum

https://en.wikipedia.org/wiki/Argumentum_ad_populum

which is a fallacious argument.

Regards.


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer


General
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users






--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] plot2d3()

2021-04-11 Thread Federico Miyara


Dear All,

I'm trying to get a plot like this:

where I intend to get a line plot where the lines come from the bottom
of the plot instead of coming from 0 as is the normal way using plot2d3().

To get this with plot2d3() I had to plot the y axis data + 50 in order
to make the botom of the plot coincident with 0, and then fake the
labels using


gca()..y_ticks.labels =
["-50","-45","-40","-35","-30","-25","-20","-15","-10","-5","0","5","10"]';


To get the circles I had to use plot() with "o" as third argument since
plot2d3() doesn't accept it.

Is there a more direct way to get such result

Is a there some way of achieving this in a more tative way?

Thanks!

Regards,

Federico Miyara



--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Why window() provides only symmetric weighting?

2021-04-10 Thread Federico Miyara


Samuel,

Like it or not, I guess these keywords come from Matlab, and as Matlab 
still seems to dominate the market, many people, including those willing 
to quit Matlab (as I did several years ago), are quite used to those 
keywords. Other software such as Octave and scipy.signal (Python) adhere 
to this style, so it is already sort of a standard. "Open" and "closed" 
might have been an option when there was still no name for the concept, 
but now it doesn't seem advisable.


That some name be intuitive or not may depend on the circumstances one 
was exposed to that name. I myself find it intuitive enough, or at least 
not counterintuitive.


I'm not sure whether it is correct to say that the generated window is 
both symmetric and periodic. Probably it is either symmetric or 
asymmetric, but never periodic per se, since it doesn't repeat itself. 
It tacitly becomes periodic when used along with an FFT, but just 
because the FFT assumes a periodic model of the signal, so what 
"periodic" means is just that its "natural" period is equal to its 
length. But even this can be challenged: What is the "natural" period of 
a function? I guess this makes sense mainly in the case of windows that 
are derived from cosines, such as many of the most successful windows 
(e.g. Hann, Blackman, Blackman-Harris and several flat-tops)


Regards,

Federico



On 09/04/2021 15:29, Samuel Gougeon wrote:

Dear Federico,

Thank you for the proposal.
I am afraid that the "symmetric" and "periodic" flag names are not 
intuitive to me.
Indeed, the generated window is /always/ both periodic and symmetric. 
It is anyway "algorithmically seen" as periodic (from a spectral point 
of view), since it is regularly sampled, while regular-sampling and 
periodicity are FT-dual.


The point is that it is either *open*, or *closed* (what is rather 
expected, for a window. Sorry for the (serious) joke :-), with a 
closing point at the same level as the opening one.


I know from where these "symmetric" and "periodic" keyworks come from.
But, sorry, i can't resolve myself blindly copy others without 
discussion. Badly naming things usually become counterproductive, 
noticeably when teaching (here signal processing).


For contribution,

Best regards
Samuel


Le 11/02/2021 à 08:12, Federico Miyara a écrit :


Dear All,

I wonder why windowing functions such as Hann, Hamming, etc., 
provided by window(), are only symmetric.


When used for spectral analysis by subsequent use of fft(), the 
periodic weighting is better than the symmetric one. The symmetric 
window is mainly used in the design of FIR filters, which I guess is 
a less frequent application than spectral analysis.


While it is true that an easy workaround to get a periodic window of 
length n is, for instance


w = window("hn", n+1)(1:$-1);

a syntax such as this

w = window("hn", n, "per");

would be easier.Setting "sym" as the default option, no backward 
compatibility issues would possibly arise.


Regards,

Federico Miyara

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 
	Libre de virus. www.avast.com 
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] find and locate local maxima

2021-03-16 Thread Federico Miyara


David:

Just in case it is useful for your purpose, I'm attaching a flexible 
localmax function.


To filter out noisy signals you could use a low-pass filter or 
lsq_splin() which can also remove multivalued data from replicated 
experiments.


Regards,

Federico Miyara

On 16/03/2021 10:52, CHEZE David 227480 wrote:


Hi all,

I’m looking for function that could find and locate every local maxima 
of any discrete time signal (timeseries), similar to Matlab or Octave 
function findpeaks(), scipy find_peaks(). Is anyone aware if something 
similar is already available in Scilab ? (I already browsed a little 
bit and it don’t seem so…)


If not in Scilab macros, any hint to use the Octave or scipy function 
directly from Scilab?


More globally it seems that Octave Forge could be linked with Python 
(from oct2py import octave


# Load the Octage-Forge signal package.

octave.eval("pkg load signal")), does someone ever tried to bridge 
similarly in Scilab ? oct2sci


Kind regards,

David


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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
function [i, y] = localmax(x, s)
// This function finds local maxima within vector x
//
// Usage:
//[i, y] = localmax(x, s) 
// 
// where  x: input vector
//s: strict (2), semistrict (1) or loose (0) local maxima
//i: vector of indexes where x reaches local maxima
//y: vector of values of x at such indexes   
//
// Local maxima are defined as values greater than or equal to the
// immediately preceding and immediately following ones. Argument 
// s is optional. If it is equal to 2, strict maxima are found 
// (i.e., the values are strictly greater than the neighbouring 
// ones); if it is equal to 1, semistrict maxima are found (i.e.,
// the values are strictly greater than at least one neighbouring
// value); if it is equal to 0, loose maxima are found (i.e., the
// values are greater than or equal to the neighbouring ones). x 
// may be either a row vector or a column vector. If x is complex,
// abs(x) is used instead of x and given as the second output 
// argument.
// 
// NOTE: In order to assess the first and last elements the vector
//   x is extended with -inf values 
//
// --
// Author: Federico Miyara
// Dete:   2007-06-28
// 2008-08-09
// 2010-06-28
// 2010-08-24
// 2020-01-24 
// 2020-04-22  

// Default value for s (loose maxima)
if argn(2)<2
s = 0;
end

// Ensure x is a column vector
if size(x,1)==1
x = x(:);
wasrow = 1;
else 
wasrow = 0;
end

// For complex signals, the maximum will be obtained for
// the absolute value 
if isreal(x)==0
x = abs(x);
end

// Compute a vector xdec that is positive on indexes where x
// is decreasing. To that end, the next value is subtracted
// from each value of x
xdec = x - [x(2:$); -%inf];

// Compute a vector xinc that is positive on indexes where x
// is increasing. To that end, the preceding value is subtracted
// from each value of x
xinc = x - [-%inf; x(1:$-1)];

// Obtain a vector whose components are 1 if both xdec and xinc
// are positive or non-negative according to s.
switch s
case 2
maxi = (xdec>0).*(xinc>0);
case 1
maxi =  (xdec>=0).*(xinc>0) + (xdec>0).*(xinc>=0);
case 0
maxi = (xdec>=0).*(xinc>=0);
end

// Find the indexes corresponding to nonzeros
i = find(maxi); 

// If x was a row vector, so must be i
if wasrow== 1
i = i(:).';
else
i = i(:);
end

// Provide the second output argument if requested 
if argn(1)>1
y = x(i);
// If x was a row vector, so must be y
if wasrow==1
y = y(:).';
else
y = y(:);
end
end

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


Re: [Scilab-users] interp and memory

2021-03-08 Thread Federico Miyara


Jean-Ives,

It seems that the variables are not so huge, xp has 100 components 
as well as z, while x and y have 1 components.


But I guess splin() gets the derivatives through solving a linear 
equation system of, in this case, 1 x 1, and even if the 
system's matrix is quasi diagonal (it has only the diagonal, 
sub-diagonal and supra-diagonal components different from 0) and this 
surely reduces the computational load, it seems quite a large system and 
probably it gets stuck here.


Probably a lighter (and better) way to do what you seem to be looking 
for is to try to resample your x-y data by a factor of 100 using 
intdec(). However, doing that 1000 times may take quite a long time (I 
haven't tested it). If you really need that, it would probably be better 
to do the oversampling algorithm from scratch in such a way to design 
only once the smoothing filter instead of letting intdec() design the 
same filter over and over again.


Regards,

Federico Miyara


On 08/03/2021 04:33, Jean-Yves Baudais wrote:

Hello,

  Is my code wrong or is there a real memory problem with the function 
interp in the following code? (Scilab fulfills the memory and of 
course stops.)


for i=1:1000
  mprintf("%d\n",i);
  n=1e6;
  xp=1:n;
  x=1:100:n;
  y=rand(x);
  d=splin(x,y);
  z=interp(xp,x,y,d);
end

Thanks,

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





--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Why window() provides only symmetric weighting?

2021-03-07 Thread Federico Miyara


Dear all,

Just in case somebody finds this useful, I'm attaching a proposal of a
modified version of the function window() which includes three new
window functions: Blackman, Blackman-Harris and one out of many
different flat-top windows. It also allows a new argument, opt, which
can be either "per" for periodic option or "sym" or any other value (or
no value) for triggering the default symmetric option.

If there were interest, several other windows could be easily added.

Regards,

Federico Miyara


On 11/02/2021 04:12, Federico Miyara wrote:


Dear All,

I wonder why windowing functions such as Hann, Hamming, etc., provided
by window(), are only symmetric.

When used for spectral analysis by subsequent use of fft(), the
periodic weighting is better than the symmetric one. The symmetric
window is mainly used in the design of FIR filters, which I guess is a
less frequent application than spectral analysis.

While it is true that an easy workaround to get a periodic window of
length n is, for instance

w = window("hn", n+1)(1:$-1);

a syntax such as this

w = window("hn", n, "per");

would be easier.Setting "sym" as the default option, no backward
compatibility issues would possibly arise.

Regards,

Federico Miyara

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
Libre de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>


<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) INRIA - 1988 - C. Bunks
//
// Copyright (C) 2012 - 2021 - Scilab Enterprises
//
// This file is hereby licensed under the terms of the GNU GPL v2.0,
// pursuant to article 5.3.4 of the CeCILL v.2.1.
// This file was originally licensed under the terms of the CeCILL v2.1,
// and continues to be available under such terms.
// For more information, see the COPYING file which you should have received
// along with this program.

function [win_l,cwp] = window(wtype,n,par,opt)
//[win_l,cwp] = window(wtype,n,par)
//macro that calculates symmetric window
// wtype :window type (re,tr,hn,hm,kr,ch)
// n :window length
// par   :parameter 2-vector (kaiser window: par(1)=beta>0)
//   :   (chebyshev window:par=[dp,df])
//   :   dp=main lobe width (00)
// opt   :window option: "sym" (symmetric)
//   "per" (periodic) 
// win   :window
// cwp   :unspecified Chebyshev window parameter
//!
WT = ["re","tr","hm","hn","kr","ch","bl","bh","ft"]

if isdef("opt") then
if opt=="per" then
n = n+1;
end
end

if and(wtype<>WT) then
error(msprintf(_("%s: Wrong value for input argument #%d: Must be in 
the set {%s}.\n"),"window",1,strcat(WT,",")))
end

if type(n)<>1|size(n,"*")<>1|~isreal(n)|size(n,"*")<>1|int(n)<>n|n<1 then
error(msprintf(_("%s: Wrong type for input argument #%d: A positive 
integer expected.\n"),"window",2))
end

if or(wtype==["kr","ch"]) then
if type(par)<>1|~isreal(par) then
error(msprintf(_("%s: Wrong type for input argument #%d: A %d-by-%d 
real vector expected.\n"),"window",3,1,2))
end
if wtype=="kr" then
if size(par,"*")==0| size(par,"*")>2 then
error(msprintf(_("%s: Wrong size for input argument #%d: A 
%d-by-%d real vector expected.\n"),"window",3,1,2))
end
Beta = par(1)
if Beta<0 then
error(msprintf(_("%s: Input argument #%d must be strictly 
positive.\n"),"window",3))
end
else //chebychev
if size(par,"*")<>2 then
error(msprintf(_("%s: Wrong size for input argument #%d: A 
%d-by-%d real vector expected.\n"),"window",3,1,2))
end
dp = par(1);df = par(2)
if dp>0 then
if df>0 then
error(msprintf(_("%s: Wrong value for input argument #%d: 
incorrect element #%d\n"),"window",3,2))
end
if dp>=0.5 then
er

Re: [Scilab-users] Variable scope in Scilab

2021-02-26 Thread Federico Miyara


Stéphane,

I agree it shouldn't happen, but the same moment access to outer 
variables is granted you can't prevent such thing to happen since inside 
the function all variables have a name which is more than just a symbol 
or a mute variable, and this includes undefined arguments.


This scoping feature is dangerous and I don't think it would be 
advisable to create a macro for general use exploiting it.


May be someone can provide an example where it has been used with profit 
or explain why it was originally introduced


Regards,

Federico Miyara

On 26/02/2021 10:38, Stéphane Mottelet wrote:

Hi all,

In Scilab the scope of variables is quite permissive but even in Julia 
(really strict rules) we can have the following behavior:


function y=f(x)
 y=x+a;
end

a=1;
f(2)
a=2;
f(3)

-> a=1;

--> f(2)
 ans  =

   3.

--> a=2;

--> f(3)
 ans  =

   5.

Yesterday afternoon I was my students for a Scilab beginners tutorial, 
and by accident one of them had "x" defined before in the main 
workspace and tried to call f without arguments. I reproduce the 
experiment here by explicitely defining x before the call:


x=1;
f

--> x=1;

--> f
 ans  =

   3.

Allowing the function inner scope to see variables of the outer scope 
is one thing, you may or may not agree this is not the point here, but 
allowing to call f without arguments just because the formal input 
parameter has the same symbol as an outer scope symbol is another 
thing. I knew this was possible even if i never used such a feature, 
but my students were so puzzled by this, particularly those who 
already learned other low-level languages, that I decided to propose 
the suppression of this, that I consider as a serious potential source 
of many bugs. Don't tell me that this would break some user code 
because I frankly have no consideration for this kind of crappy 
shortcut and, sorry if it may sound rude, for programmers who use it...


S.





--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Some details on the documentation of log(), log10(), etc.

2021-02-19 Thread Federico Miyara


Dear all,

In an old script where I needed to apply log10 to an hyperarray I had
implemented it as log(A)/log(10) with a comment indicating that in that
version log10() didn't work for hyperarrays (unfortunately I don't
recall what version it was).

In Version 6.1.0 it does work for hyperarrays, but the documentation
still says that it applies to vectors or matrices:

https://help.scilab.org/docs/6.1.0/en_US/log10.html

In some contexts "matrix" may be interpreted as an hyperarray or
hypermatrix (for instance when speaking of N-D matrices), but for Scilab
a matrix is formally a two-dimensional array:

https://help.scilab.org/docs/6.1.0/en_US/matrices.html

I think the documentation should indicate that it applies to vectors,
matrices and hypermatrices

Another problem is regarding log(). It says that the input argument is a
"constant vector or constant matrix":

https://help.scilab.org/docs/6.1.0/en_US/log.html

However, it seems that "constant" has a specific meaning in Scilab as a
predefined variable:

https://help.scilab.org/docs/6.1.0/en_US/section_421ab29126e21a1e1e403ee27a18fda4.html

As it is worded, it seems that log() is applied to predefined variables.
I think it should refer more clearly to the type double (it doesn't
work, for instance, for integer types such as int16(2)).

In the case of log2() the description of arguments is even stranger:

https://help.scilab.org/docs/6.1.0/en_US/log2.html

It confuses the argument section with the description, and it specifies
decimal numbers which isn't a recognized type.

The function exp(), on the other hand, doesn't indicate an output argument.

I think these functions are very similar and their documentation pages
should be consistent with one another

Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] convert vector to list

2021-02-18 Thread Federico Miyara


Dear All,

Is there a Scilab function to convert a vector to a list?

If x is a vector, this code

L = list();
for n=1:length(x)
    L(n) = x(n);
end

seems to work, but it would be nice to have a primitive doing this more 
efficiently. I don't seem to be able to find it.


Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Why window() provides only symmetric weighting?

2021-02-10 Thread Federico Miyara


Dear All,

I wonder why windowing functions such as Hann, Hamming, etc., provided
by window(), are only symmetric.

When used for spectral analysis by subsequent use of fft(), the periodic
weighting is better than the symmetric one. The symmetric window is
mainly used in the design of FIR filters, which I guess is a less
frequent application than spectral analysis.

While it is true that an easy workaround to get a periodic window of
length n is, for instance

w = window("hn", n+1)(1:$-1);

a syntax such as this

w = window("hn", n, "per");

would be easier.Setting "sym" as the default option, no backward
compatibility issues would possibly arise.

Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] exists yields double

2021-02-09 Thread Federico Miyara


Samuel,

You are right, sorry I wasn't aware of isdef().

Regards,

Federico

On 09/02/2021 08:27, Samuel Gougeon wrote:

Hello Federico,

Le 10/10/2019 à 06:33, Federico Miyara a écrit :


Dear all,

I wonder why the function "exists" yields 1 or 0 as doubles, instead 
of boolean. I know there is little distinction between booleans and 
{0, 1} and can be easily converted back and forth. I also know that 
Scilab is not meant to be a strongly typed language. But wouldn't it 
make more sense that this kind of funtion yielded a boolean result?


It challenges reason the fact that "isreal", for instance, yields a 
boolean and "exists" yields a double.



Please use isdef() instead.

exists() is a pure duplicate of isdef(), except for the output type.
Converting its output into a boolean was asked 9 years ago as bug 
10892 <http://bugzilla.scilab.org/show_bug.cgi?id=10892>.


We should hate introducing such duplicates, that just multiply issues 
and confusion with strictly no added value.
This is why its removal was proposed sortly after, as bug 11000 
<http://bugzilla.scilab.org/show_bug.cgi?id=11000>.


To me, there is no added value either to convert exist()'s output into 
boolean, except if this function is actually removed, or at least 
masked, i.e. kept only for backcompatibility reason but undocumented.


Best regards

Samuel


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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] slight bug in exists()

2021-02-09 Thread Federico Miyara


Antoine,

Well, to be sure, there are some functions that do not work on booleans.
For instance, mean(), max() and mean() will cause error; but not sum()
and prod().

However, I think exists() is used mostly in conditionals, where both
types work fine. And if getting errors, they can be easily solved by
using double() to convert to double. This workaround could be included
in the documentation.

If not fixed in this release, a warning could be issued in the
documentation that the current output argument type will be changed to
boolean in the next release.

Federico Miyara


On 09/02/2021 00:27, Antoine Monmayrant wrote:


Hello Federico,

I agree with you that this would make more sense.
Could such a change be implemented for a point release?
I assume it would introduce some bugs in existing code relying on the
(unusual) double output...

Antoine

On 09/02/2021 03:24, Federico Miyara wrote:


Dear all,

I had already mentioned this a while ago
(http://mailinglists.scilab.org/Scilab-users-exists-yields-double-tt4039853.html),
but as I guess we are in the update season, it would be good
opportunity to fix this (if there isn't strong opposition, or a good
reason for this behavior, of course).

I'm referring to the fact that the function exists() should by nature
yield a Boolean result such as T or F. However, it yields 1 or 0.
While this is not a big deal, similar functions performing a binary
decision on their arguments, such as isreal(), isvector(), isfile()
and many others, yield Boolean results.

Regards,

Federico Miyara

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
Libre de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>


<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] slight bug in exists()

2021-02-08 Thread Federico Miyara


Dear all,

I had already mentioned this a while ago
(http://mailinglists.scilab.org/Scilab-users-exists-yields-double-tt4039853.html),
but as I guess we are in the update season, it would be good opportunity
to fix this (if there isn't strong opposition, or a good reason for this
behavior, of course).

I'm referring to the fact that the function exists() should by nature
yield a Boolean result such as T or F. However, it yields 1 or 0. While
this is not a big deal, similar functions performing a binary decision
on their arguments, such as isreal(), isvector(), isfile() and many
others, yield Boolean results.

Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] users@ interruptions?

2021-01-23 Thread Federico Miyara


Samuel,

I haven't received it either, but I did receive yours, seemingly from
the users list.

Regards,

Federico

On 22/01/2021 17:04, Samuel Gougeon wrote:

Hello,
Has anyone received the recent message archived @
http://mailinglists.scilab.org/Scilab-users-Update-library-and-help-tt4041262.html
?
I have not.
BR
Samuel

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





--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Insufficient documentation of interp1

2021-01-10 Thread Federico Miyara


Samuel,

Thanks for your comments, which encouraged me to submit bug #16629.

Regards,

Federico Miyara


On 10/01/2021 11:18, Samuel Gougeon wrote:

Le 10/01/2021 à 08:18, Federico Miyara a écrit :


Dear All,

I find that the extrapolation option for interp1 is not thoroughly 
documented. In the Arguments section it states, for extrapolation,


(optional) string, or real value defining the yp(j) components
for xp(j) values outside [x1,xn] interval.


In the Description section the only string listed is "extrap" which says:

the extrapolation is performed by the defined method


But which is the defined method? 


, used for interpolation.


If one selects the method "spline" it is suggested to refer to 
interp(), which has a specific argument (called out_mode) with 
several possibilities for extrapolation. These possibilities aren't 
accessible from the interp1() function, so it should be completely 
clear in its documantation which one is used.



Right. This is true also for interp(), for which the default 
extrapolation behavior is not documented.





Besides, the argument extrapolation is optional but it is not clear 
what happens if it is not used. I suppose it is what appears under 
"by default",



Sure



but again it says

the extrapolation is performed by the defined method (for spline
method)


But, as already mentioned, tha spline method has more than one 
extrapolation strategy, which can be selected from interp but not 
from interp1.



It is the same remark as above.

Finally, at least for spline it seems to be no difference between 
setting the extrapolation argument to "extrap" or not using it.


According to the current documentation,

interp1(x, y, xp, "spline", "extrap")  // is equivalent to
interp1(x, y, xp, "spline", "spline")

// while

interp1(x, y, xp, "spline")  // is as well equivalent to
interp1(x, y, xp, "spline", "spline")

So yes, same results are expected.

But i find as well the "by default" explanation uselessly complicated: 
From

/  by default ://
//   the extrapolation is performed by the defined method (for 
spline method), and by nan for//

//   linear and nearest methods. yp=interp1(x,y,xp,method)//
/it could rather be something like
/  by default ://
//   the extrapolation is performed by spline when the 
interpolation is done by spline, and by nan for//

//   linear and nearest interpolation methods.//

/Samuel Gougeon

/
/


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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Insufficient documentation of interp1

2021-01-09 Thread Federico Miyara


Dear All,

I find that the extrapolation option for interp1 is not thoroughly
documented. In the Arguments section it states, for extrapolation,

   (optional) string, or real value defining the yp(j) components for
   xp(j) values outside [x1,xn] interval.


In the Description section the only string listed is "extrap" which says:

   the extrapolation is performed by the defined method


But which is the defined method? If one selects the method "spline" it
is suggested to refer to interp(), which has a specific argument (called
out_mode) with several possibilities for extrapolation. These
possibilities aren't accessible from the interp1() function, so it
should be completely clear in its documantation which one is used.

Besides, the argument extrapolation is optional but it is not clear what
happens if it is not used. I suppose it is what appears under "by
default", but again it says

   the extrapolation is performed by the defined method (for spline
   method)


But, as already mentioned, tha spline method has more than one
extrapolation strategy, which can be selected from interp but not from
interp1.

Finally, at least for spline it seems to be no difference between
setting the extrapolation argument to "extrap" or not using it.

Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problems arising from truncation of %pi

2021-01-08 Thread Federico Miyara


Stéphane,

Thanks for your comments, I didn't know bitstring().

Regards,

Federico Miyara


On 08/01/2021 10:48, Stéphane Mottelet wrote:



Le 08/01/2021 à 13:28, Jean-Yves Baudais a écrit :

- Original Message -

From: "Stéphane Mottelet"
--> bitstring(%pi)
ans =

"0 100 1001001110110101010001000110110100011000"
[...]
https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/www.exploringbinary.com/binary-converter/

Thank you for the recall on floating point representation and for the link (the French wiki page on 
IEEE 754 gives also a full and clear example). Of course we can convert float64 from finite binary 
representation to decimal one with more than 16 digits, but in that case the binary to float 
tranform is not a "relation binaire univoque" and the finite number representation 
problem is "put under the carpet". As I prefer one-to-one convertion and I hate carpet, I 
use 16 digits at most to write float64.


There is no hiding of anything in my demonstration. I was just showing 
that the figures displayed by Scilab after the 16th are computed on a 
clear basis. This is a legacy choice of Scilab to allow the display of 
more than 16 decimals and this can be discussed. For example, "long" 
format of Matlab displays the shortest decimal number matching the 
internal IEEE754 representation.


S.


-- Jean-Yves

___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problems arising from truncation of %pi

2021-01-08 Thread Federico Miyara


Jean-Yves,


sin(x - n*pi)

So now the problem can be how these large numbers are obtained
--> a=1e16+1
--> a-1e16
of course equals zero.


Yes, I've thought about it and you are right, above 1e16 x is so sparse, 
cycle-wise speaking, that my original intention doesn't make much sense.


Besides, at a sample rate of 44100, and a maximum frequency of 22050 Hz, 
a phase of 1e16 is reached only  after 2288 years, so it's not a 
practical problem!


I must confess, by the way, that because of a stupid interpretation of 
some results on my part, I thought an error I was having was due to the 
slow departure from strict discrete signal periodicity but it wasn't. Sorry!


Regards,

Federico Miyara

--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus

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


Re: [Scilab-users] Problems arising from truncation of %pi

2021-01-07 Thread Federico Miyara


Stéphane,

This would be great if it worked for any x. When x is close to 1e16 
there are few valid numbers per cycle. For instance


x(1) = 1e16
for k=1:5
    x(k+1) = nearfloat("succ",x(k));
end
x

yields (with format(25))

   1.
   10002.
   10004.
   10006.
   10008.
   10010.

Those few numbers have each a definite exact value and sin(x) has also a 
definite exact value which seemingly is already well approximated, 
unlike what I had previously supposed. For instance


[x sin(x)]

yields

1.   0.779688006606978_7_8957
   10002.  -0.893837828765730_5_909519
   10004.  -0.035752436952928_5_263036
   10006.   0.923594355839355_2_299535
   10008.  -0.732949301917758_3_112977
   10010.  -0.313565289154332_2_384749

I have underlined the last correct digit compared with Alpha, so it is 
the expected result with 16 digits.


Regards,

Federico Miyara


On 06/01/2021 05:49, Stéphane Mottelet wrote:

x = (10^[1:16])*%pi
sx = sin(x-floor(x/2/%pi)*%pi*2)
plot("ln",x,sin(x),'-o',x,sx,'-o')
legend("$\Large\sin x$","$\Large\sin 
\left(x-2\pi\left\lfloor\frac{x}{2\pi}\right\rfloor\right)$",3)




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problems arising from truncation of %pi

2021-01-07 Thread Federico Miyara


Antoine,

Thanks for the link, very interesting.

Regards,

Federico Miyara

On 06/01/2021 05:22, Antoine Monmayrant wrote:


Hello Frederico,

Like Christophe, I am not sure this has anything to do with the 
implementation of sin().
It seems to be a known limitation of numerical calculations using 
floating numbers.
In particular, even with en hypothetical ideal value of %pi, because 
of the conversion to a double, %pi*1e15 is converted to the nearest 
available double and this "shift" or error as compared to the ideal 
infinitely-precise value is increasing with the size of your number.
Thus you make a x1e15 bigger error when using "%pi*1e15" than when 
using "%pi".
As Christophe as said, there is not much you can do, apart from 
resorting to symbolic calculation (what Alpha does).


You can see that by using nearfloat to get the distance between two 
doubles:


nearfloat("succ", %pi)-%pi
 ans  =   4.441D-16
nearfloat("succ", %pi*1e15)-%pi*1e15
 ans  =   0.5

As I said, the error on the sin() argument is getting x1e15 bigger!

I'm sorry if my explanation of floating point numbers is not really good.
This one was a revelation for me: 
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html .
It helped me understand why it's usually a good idea to use "reduced 
units" for your calculations (ie keep everything close to 1 when 
possible).


I hope it helps,

Cheers,

Antoine
On 05/01/2021 09:19, Federico Miyara wrote:


Dear all,

In order to test the FFT on a periodic signal whose period is an 
exact submultiple of the FFT length I found a frequency fo satisfying 
this for the chosen sample rate and window length, and generated the 
following signal:


x = sin(2*%pi*fo*t);

where t is a time vector. This should be a perfectly periodic 
discrete signal but it isn't because the sin() function has a 
(virtually) exact period of pi, while %pi is exact to 16 digits only.


For instance, we have (23 digits shown)

--> sin(%pi)
 ans  =
   0.0001224647

--> sin(1e10*%pi)
 ans  =
  -0.022393627619559233

--> sin(1e15*%pi)
 ans  =
  -0.2362090532517409080526

The Wolfram Alpha site yields the correct value 0 in all cases (using 
their own pi).


Questions:

1) How is the sin() function extended to very large values of the 
argument? My first guess would be to compute a quarter cycle using 
Taylor and then extend it by symmetry and periodicity, but with which 
period? The best approximation available is 2*%pi. Or it is possible 
to use extended precision internally?


2) Is there a way to get a periodic discrete sine other than 
extending it periodically with the desired period?

Wouldn't this create a slight glitch at the frontier between cycles?

Regards,

Federico Miyara

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 
	Libre de virus. www.avast.com 
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problems arising from truncation of %pi

2021-01-07 Thread Federico Miyara


Jean-Yves,

Thanks for your answer.

You face the limited precision of all numerical calculus. See --> help 
%eps


Yes, I'm aware of this limitation, but I think an improved version of 
the sine function could be provided for its use in certain cases, in a 
similar fashion as the log1p() function, which takes advantage of 
foating point capabilitties when the input argument is close to 1.


The function could be sinpi() or similar, with two arguments: the main 
argument x and an integer argument n, being its result equivalent to


sin(x - n*pi)

where pi is the exact value of pi

It has no sense to use 23 digits with a precision of 2.22E-16, the 7th 
last digits are noise.


I've just reported the digits provided when using format(25)

Probably it is not proper to refer to it as noise, since the difference 
is deterministic as can be demonstrated by using the function nearfloat()


Regards,

Federico Miyara






--> sin(1e10*%pi)
  ans  =
   -0.022393627619559233

--> sin(1e15*%pi)
  ans  =
   -0.2362090532517409080526



All is consistent with the definition of the precision. A toy example:
--> a=2;
--> b=sqrt(2);
--> a-b^2

You expect zero because you do symbolic calculus, not Scilab.


The Wolfram Alpha site yields the correct value 0 in all cases (using 
their own pi).



Because it uses symbolic calculus. So, if you want more precision with 
Scilab you should change the standard used, but maybe some tricks in 
your code can solve the problem... Or maybe you need symbolic calculus 
tool.


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





--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus

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


[Scilab-users] Problems arising from truncation of %pi

2021-01-05 Thread Federico Miyara


Dear all,

In order to test the FFT on a periodic signal whose period is an exact 
submultiple of the FFT length I found a frequency fo satisfying this for 
the chosen sample rate and window length, and generated the following 
signal:


x = sin(2*%pi*fo*t);

where t is a time vector. This should be a perfectly periodic discrete 
signal but it isn't because the sin() function has a (virtually) exact 
period of pi, while %pi is exact to 16 digits only.


For instance, we have (23 digits shown)

--> sin(%pi)
 ans  =
   0.0001224647

--> sin(1e10*%pi)
 ans  =
  -0.022393627619559233

--> sin(1e15*%pi)
 ans  =
  -0.2362090532517409080526

The Wolfram Alpha site yields the correct value 0 in all cases (using 
their own pi).


Questions:

1) How is the sin() function extended to very large values of the 
argument? My first guess would be to compute a quarter cycle using 
Taylor and then extend it by symmetry and periodicity, but with which 
period? The best approximation available is 2*%pi. Or it is possible to 
use extended precision internally?


2) Is there a way to get a periodic discrete sine other than extending 
it periodically with the desired period?

Wouldn't this create a slight glitch at the frontier between cycles?

Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Atoms Modules

2020-12-18 Thread Federico Miyara


Dear All,

I haven't used IPCVso far, but I was planning to start trying it when 
finishing with a project that will take me still most of 2021. And 
probably earlier than that, since something as basic as reading or 
saving an image file is not in the core of Scilab (I think it should be, 
in line with the availability of wavread / wavwrite or csvRead functions).


If terminating maintenance could eventually lead to an incompatibility 
with future versions of Scilab, I think it would be a bad thing.


But the addition of new features is a different question, and as usually 
happens with any FOSS project, is driven by the users's wish-lists and 
requests and by developers which are sufficiently motivated to work on 
those features. If there is no demand then there is no need to go further.


Regards,

Federico


On 18/12/2020 15:22, Samuel Gougeon wrote:

Dear Chin Luh,

Thank you so much for addressing the critical topic of external 
modules maintenance.

While IPCV is the most downloaded module, your fair question
>So should IPCV continue to be maintained ...?
sounds desperate to me. I rather share the same feeling: Almost 5 days 
after your message, not a single answer from users...!


So, apparently, the answer is likely: No, it's not worth maintaining 
the most downloaded module, and therefore No, it's not worth 
maintaining any other external module.
Let's stop maintaining ATOMS for 2021. The ghosts of silent users are 
certainly rich enough to pay commercial equivalent tools.


Since there are 12 days left before 2021, i will answer for particular 
cases in separate (sub-)threads.


Best regards
Samuel

Le 14/12/2020 à 05:44, Chin Luh Tan a écrit :
Sometimes it is hard to decide whether to continue maintaining an 
atoms module or not So I did "snapshots" of downloads on 
9/11/2020 21:44 and 14/12/2020 12:20 respectively to see which 
modules are in the actual top downloads.


Still, this is not a fair result, such as IPCV having some "patches" 
which will increase the download number, and some other factors as well.


So should IPCV continue to be maintained ...?

Here's the results.

Image Processing and Computer Vision Toolbox4620
CPGE3176
MinGw toolbox   2946
Arduino 2936
CelestLab   2841
iodelay toolbox 2429
Coselica1812
SIMM1800
Image Processing Design Toolbox 1394
Fuzzy Logic Toolbox 1186
Scilab Computer Vision Module   1129
GUI Builder 972
Scilab Image and Video Processing toolbox   860
Distfun 855
Apifun  804
Serial Communication Toolbox781
Time Frequency Toolbox  776
Free Access Chemometric Toolbox 770
Autoelem Toolbox768
Specfun 738




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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] linear prediction model

2020-12-02 Thread Federico Miyara


Dear All,

Is there a script or function somewhere which calculates the Linear
prediction model (LPC) of a signal frame?

I tried to implement a function (below) without using the algorithm of
Levinson & Durbin but it doesn't seem to work properly. seemingly the
problem is due to inaccuracy of the matrix equation solution.

Regards,

Federico Miyara





function  a=lpc(x, p)
// Calculation of the LPC coeficients
// Usage:
// a = lpc(x, p)
// where
// x: Signal vector
// p: Order of the linear prediction model
// a: Coefficients of the linear prediction model
//
// The coefficients are computed so to get minimize the
// prediction error by the least-square method
//
// --
// Author: Federico Miyara
// Date: 20202-09-27

if  1==2
// Test data --delete--
// LPC order
p  =  10
// Signal length
N  =  512
// Create whiter noise
exec  whitenoise.sci;
y  =  whitenoise(2*N-1,1);
// Create a filter
// Create some poles within the unit circle for stability
pol  =  0.7  +  %i*linspace(-0.3,0.3,10)
// Denominator polynomial in z
AAA  =  real(prod(%z  -  pol))
// Theoretical LPC coefficients
aa  =  -coeff(AAA)($-1:-1:1)
// Autorregressive (AR) transfer function
HH  =  1/(1  -  sum(aa.*%z^(-(1:p
// Numerator and denominator
BB  =  HH.num
AA  =  HH.den
// Filter white noise
x  =  filter(BB,  AA,  y);
x  =  x(N+1:2*N);
plot(x)
end


for  h  =  1:p
// Row h
for  i  =  1:p
// Column i
A(h,i)  =  sum(x(p+1-i:$-i).*x(p+1-h:$-h));
end
B(h)  =  sum(x(p+1:$).*x(p+1-h:$-h));
end

a  =  ((inv(A)*B))';


if  1==2
H  =  1/(1  -  sum(a.*%z^(-(1:p
// Numerator and denominator
B1  =  H.num
A1  =  H.den
// Filter white noise
x1  =  filter(B1,  A1,  y);
x1  =  x1(N+1:2*N);
plot(x1)
end

endfunction



--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] fft

2020-11-26 Thread Federico Miyara


Claus,

I recall that I had had a similar problem in certain occasion. The
reason was that when installing Scilab I had selected an option to use a
version of the FFT which, since it was much larger, I thought would be
more complete, or faster... but it didn't work. Try to re-install Scilab
and choose the default version of the FFT engine. It is good enough...
and works!

Regards,

Federico Miyara

On 26/11/2020 15:24, Claus Futtrup wrote:

Hi there

The 2D example from the help pages also crashes Scilab.

Maybe my Scilab installation is broken - the FFT part? I can't
remember, but I think I installed the Intel Math Kernel with
everything. My computer is a Lenovo T480 with Intel Core i7 processor.
I have the following installed:

C:\Program Files\scilab-6.1.0>dir /S /B fft*.*
C:\Program Files\scilab-6.1.0\bin\fftw
C:\Program Files\scilab-6.1.0\bin\fftw.dll
C:\Program Files\scilab-6.1.0\bin\fftw\fftw-readme.txt
C:\Program Files\scilab-6.1.0\modules\fftw
C:\Program Files\scilab-6.1.0\modules\fftw\etc\fftw.quit
C:\Program Files\scilab-6.1.0\modules\fftw\etc\fftw.start

Cheers,
Claus

On 26-11-2020 19:19, Claus Futtrup wrote:


Hi Scilabers

I'm trying to understand how to use the FFT function in Scilab. I'm
using v. 6.1.0 on a Windows 10 machine.

This crashes Scilab:
y =  linspace(1,256,256) x = fft(y)

BTW, the example in the online help 
(https://help.scilab.org/docs/6.1.0/en_US/fft.html) also crashes Scilab:

sample_rate=1000; t = 0:1/sample_rate:0.6; N=size
<https://help.scilab.org/docs/6.1.0/en_US/size.html>(t,'*'); //number
of samples s=sin
<https://help.scilab.org/docs/6.1.0/en_US/sin.html>(2*%pi*50*t)+sin
<https://help.scilab.org/docs/6.1.0/en_US/sin.html>(2*%pi*70*t+%pi/4)+grand
<https://help.scilab.org/docs/6.1.0/en_US/grand.html>(1,N,'nor',0,1);
y=fft <https://help.scilab.org/docs/6.1.0/en_US/fft.html>(s);
Cheers,
Claus




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




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


  1   2   3   >