Re: [Scilab-users] density in a graph

2020-01-27 Thread Jean-Philippe Grivet

P M, Claus, Antoine, Christophe; Federico:

Thank you  all fior your multifaceted and interesting suggestions. A 
special mention to Christophe: the pages on the SVG format are extremely 
clear; in my opinion, they deserve a wide audience and should be 
translated in English.


I now understand that I should have described my ultimate goal, even 
though it is somewhat complicated.. My aim is to emulate image 
reconstruction in X-ray tomography. In the simplest reconstruction 
algorithm,  back projection, one must darken the image plane 
proportional to the value  of  a "projection" of the object, for each 
projection direction (at least 128 in all). These "darkenings"  must add 
everywhere in the image plane. A sketch of this process is shown in the 
attached figure.


I have found two other possible approaches. In thee book by Michel 
Goossens et al (the Latex graphics companion) there appears (pp 257-258) 
a Latex program that emulates transparency. To use this , I would have 
to read into pstricks the coordinates of the various rectangles, which 
seems possible. Moreover, I have read that PDF supports transparency, 
though I have no idea how this fact could be exploited in Scilab.


I have quie a lot of home work to do! Thank you again for your help.

JP Grivet



scanner.pdf
Description: Adobe PDF document
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? density in a graph

2020-01-24 Thread Jean-Philippe Grivet

Le 23/01/2020 à 21:27, P M a écrit :

something like this...only in gray?
test.png

Am Do., 23. Jan. 2020 um 19:08 Uhr schrieb Antoine Monmayrant 
mailto:amonm...@laas.fr>>:


Hello Jean-Philippe,

I think I understand what you want to do, but there is no easy way
to get this in scilab.
The main issue is that scilab does not support transparency.
Otherwise, you could just plot your lines in black with 1/32 alpha
(or 255/32 alpha if 0 means transparent and 255 solid color).
For this kind of plot, I usually plot everything in scilab with a
dummy color (let's say blue), export in svg, edit the svg to
replace the dummy color by the transparent one.

Antoine


Le Jeudi, Janvier 23, 2020 16:35 CET, Jean-Philippe Grivet
mailto:jean-philippe.gri...@wanadoo.fr>> a écrit:

> Dear all,
>
> I am drawing a graph in a gray scale (say from 1 to 32), using
lines of
> different density. I would like that, in the region of
intersection of
> two lines, the shade of gray be the sum of the densities of each
line.
> How can I manage that ?
>
> Thanks in advance for any hint
>
> JP Grivet
>
>
> ___
> 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 <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


You understood perfectly, although my goal is simpler: instead of a 
blend of colors I look for a sum of densities.


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


Re: [Scilab-users] ?==?utf-8?q? density in a graph

2020-01-24 Thread Jean-Philippe Grivet

Le 23/01/2020 à 19:07, Antoine Monmayrant a écrit :

Hello Jean-Philippe,

I think I understand what you want to do, but there is no easy way to get this 
in scilab.
The main issue is that scilab does not support transparency.
Otherwise, you could just plot your lines in black with 1/32 alpha (or 255/32 
alpha if 0 means transparent and 255 solid color).
For this kind of plot, I usually plot everything in scilab with a dummy color 
(let's say blue), export in svg, edit the svg to replace the dummy color by the 
transparent one.

Antoine
  
  
Le Jeudi, Janvier 23, 2020 16:35 CET, Jean-Philippe Grivet  a écrit:
  

Dear all,

I am drawing a graph in a gray scale (say from 1 to 32), using lines of
different density. I would like that, in the region of intersection of
two lines, the shade of gray be the sum of the densities of each line.
How can I manage that ?

Thanks in advance for any hint

JP Grivet


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


___
users mailing list
users@lists.scilab.org


Thank you Antoine; I am not famo=iliar with the SVG format, but I will 
investigate.


JP Grivet

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


Re: [Scilab-users] {EXT} density in a graph

2020-01-23 Thread Jean-Philippe Grivet

Le 23/01/2020 à 17:24, Dang Ngoc Chan, Christophe a écrit :

Hello,


De : Jean-Philippe Grivet
Envoyé : jeudi 23 janvier 2020 16:36

I am drawing a graph in a gray scale (say from 1 to 32), using lines of 
different
density. I would like that, in the region of intersection of two lines, the 
shade
of gray be the sum of the densities of each line.
How can I manage that ?

I'm affraid I can't figure out what you're trying to do.

Maybe a small drawing or a small sample of data?

Do you have lines with a linear density and try to draw a surface density or?

--
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


Sorry that I haven't been clear enough. Suppose that I want to draw a 
figure X made up of two strips. Strip 1 (SW_NE) has gray level 3; strip 
2 (NW-SE) is drawn at gray level 7. The region of overlap of these 
strips (roughly a parallelogram) should display a density of 7 (darker 
than either strip). Is that possible within Scilab ?


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


[Scilab-users] density in a graph

2020-01-23 Thread Jean-Philippe Grivet

Dear all,

I am drawing a graph in a gray scale (say from 1 to 32), using lines of 
different density. I would like that, in the region of intersection of 
two lines, the shade of gray be the sum of the densities of each line. 
How can I manage that ?


Thanks in advance for any hint

JP Grivet


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


[Scilab-users] strange behaviof of function isreal

2019-11-13 Thread Jean-Philippe Grivet

Hello,
I have stumbled upon the following strange behavior of function "isreal" 
(Scilab 6.02, win7):


--> z = [1,2,3*%i]
 z  =
   1.   2.   3.i
--> isreal(z(1))
 ans  =
  F
What did I miss ? Rhank you for your help.

J.-P. Grivet

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


Re: [Scilab-users] {EXT} How to count pixels

2019-06-07 Thread Jean-Philippe Grivet

Hello Philipp,

Thank you for your program, it looks like it would do exactly what I 
wanted. However (as I should have stressed before) I work under win7. In 
this environment, the only image processing toolbox is IPCV in which 
several functions are lacking, namely


    scicv_Init(); matplot(); Mat_cols_get(); Mat_rows_get()

Further, in my case, img appears as a matrix of booleans (?).

I will try to download SIVP and determine the role of these functions.

Thank you,again

Jean-Philippe


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

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


Re: [Scilab-users] {EXT} How to count pixels

2019-06-05 Thread Jean-Philippe Grivet

Hello,

I am mainly interested in obtaining the ratio (number of white 
pixels)/(number of black pixels), so that units are not of primary interest.


Le 03/06/2019 à 15:21, Stéphane Mottelet a écrit :

Le 03/06/2019 à 14:56, Jean-Philippe Grivet a écrit :

My thanks to all respondants.

The figure is in internal Scilab firmat made up of polylines., the 
border is a polygon.
you did not say if you want to compute a surface in current units or 
really compute a surface in pixels



Le 03/06/2019 à 12:47, Dang Ngoc Chan, Christophe a écrit :

Hello,


De : Jean-Philippe Grivet
Envoyé : lundi 3 juin 2019 12:08

Using Scilab (6.02/Win7), I have drawn a picure made up of thick 
lines and

arcs, within a region with irregular borders.

What is the data structure of your picture?
A matrix of dots?
A Scilab figure containing polylines?

--
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
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users 



---
L'absence de virus dans ce courrier électronique a été vérifiée par 
le logiciel antivirus Avast.
https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/www.avast.com/antivirus 



___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users 






---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

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


Re: [Scilab-users] {EXT} How to count pixels

2019-06-03 Thread Jean-Philippe Grivet

My thanks to all respondants.

The figure is in internal Scilab firmat made up of polylines., the 
border is a polygon.



Le 03/06/2019 à 12:47, Dang Ngoc Chan, Christophe a écrit :

Hello,


De : Jean-Philippe Grivet
Envoyé : lundi 3 juin 2019 12:08

Using Scilab (6.02/Win7), I have drawn a picure made up of thick lines and
arcs, within a region with irregular borders.

What is the data structure of your picture?
A matrix of dots?
A Scilab figure containing polylines?

--
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


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

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


[Scilab-users] How to count pixels

2019-06-03 Thread Jean-Philippe Grivet

Hello everybody,

Using Scilab (6.02/Win7), I have drawn a picure made up of thick lines 
and arcs, within a region with irregular borders. The backround is 
white, all lines are black. Now I would like to count the number of 
black and white pixels. Any idea on how I could do that ?


Thank you for your help

JP Grivet



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

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


Re: [Scilab-users] orthogonal polynomials

2018-06-09 Thread Jean-Philippe Grivet
Thank you Samuel. However, there are some remaining bugs !When I launch 
Scilab, I ger the following d=series of messages:


Start Linalg
Start Makematrix
Start Specfun
Start Helptbx
Start Distfun
Start Stixbox
Start Apifun
    Load macros
    Load help
    Type "help apifun_overview" for quick start.
Start Ortpol
    Load macros
    Load help
    Load demos
    Type "help ortpol_overview" for quick start.
    Type "demo_gui()" and search for "Ortpol" for Demonstrations.

So far so good. I type help ortôl_overview and I am redirected to the 
last help^page I l consulted ("disp" in the present case). Back to the 
console, I write demo_gui() and chose ortpoly in the popup menu. Scilab 
replies


à la ligne   -11 du fichier exécuté 
C:\Users\grivet\AppData\Local\SCILAB~1.1\contrib\Ortpol\0315DD~1.1\demos\Ortpol.dem.gateway.sce
à la ligne    41 de la fonction demo_gui_update ( 
C:\Users\grivet\AppData\Local\scilab-6.0.1\modules\demo_tools\macros\demo_gui_update.sci 
ligne 58 )
get_absolute_file_path : Le fichier ortpol.dem.gateway.sce n'est pas 
ouvert dans Scilab.


Further question: What should I do to uninstall these modules ?

JP Grivet



Le 09/06/2018 à 12:11, Samuel Gougeon a écrit :

Hello,

Le 06/06/2018 à 16:46, Jean-Philippe Grivet a écrit :

Hello,

I wish to use orthogonal polynmials within Scilab. Axxording to 
"ttps://atoms.scilab.org/toolboxes/Ortpol",  I do


 atomsInstall('Ortpol')

and I get the answer

atomsInstallList: The package "Ortpol" is not registered.
Please check on the ATOMS repository that it is available for Scilab 
6.0 on Windows.

If it is, run atomsSystemUpdate() before trying atomsInstall(..) again.


As the message suggests it, you have checked on the ATOMS repository that
Ortpol was not available for Scilab 6.0 on Windows.



Where did I go wrong ? Is there a workaround ? Thank you in advance 
for your help.


Ortpol is now ported to Scilab 6.0 (+ some examples fixed). You may do:

atomsSystemUpdate()
atomsInstall Ortpol
exit
// Start a new session
atomsLoad Ortpol


Samuel

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


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

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


[Scilab-users] orthogonal polynomials

2018-06-06 Thread Jean-Philippe Grivet

Hello,

I wish to use orthogonal polynmials within Scilab. Axxording to 
"ttps://atoms.scilab.org/toolboxes/Ortpol",  I do


 atomsInstall('Ortpol')

and I get the answer

atomsInstallList: The package "Ortpol" is not registered.
Please check on the ATOMS repository that it is available for Scilab 6.0 
on Windows.

If it is, run atomsSystemUpdate() before trying atomsInstall(..) again.

Where did I go wrong ? Is there a workaround ? Thank you in advance for 
your help.


Jean-Philippe Grivet



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

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


Re: [Scilab-users] pixel level programming

2018-04-18 Thread Jean-Philippe Grivet

Thank you ¨M: I'll try that.

JP Grivet


Le 17/04/2018 à 17:52, P M a écrit :

Hi Grivet,

weather...yes it is

how...if you know:

- the pixel coordinate of the pixel you want to manipulate and
- how to work with colormap ...

you should be able to manipulate a single pixel

For a start I suggest you understand how Matplot() works.
This is used in IPD to draw the image, when the ShowImage() command is 
used.


simple Example:

img = ones(100,100) * 256;    // white image with sioze of 100 x 
100 px

ShowImage(img, "white image");
img(50,50) = 0; // set a single pixel to zero 
(= black)

ShowImage(img, "white image with one single black pixel");

Hth,
Philipp




2018-04-16 12:53 GMT+02:00 Jean-Philippe Grivet 
<jean-philippe.gri...@wanadoo.fr 
<mailto:jean-philippe.gri...@wanadoo.fr>>:


Hello,

I would like to know whether and how it is possible to program
individual pixels within a Scilab figure ? I have in mind a simple
application: a disk moves inside a bounded region and changes the
colour of every pixel it sweeps over.  Thanks for your hints.

JP Grivet



---
L'absence de virus dans ce courrier électronique a été vérifiée
par le logiciel antivirus Avast.
https://www.avast.com/antivirus <https://www.avast.com/antivirus>

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




--
In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.

There we have the salad.

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



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] pixel level programming

2018-04-16 Thread Jean-Philippe Grivet

Hello,

I would like to know whether and how it is possible to program 
individual pixels within a Scilab figure ? I have in mind a simple 
application: a disk moves inside a bounded region and changes the colour 
of every pixel it sweeps over.  Thanks for your hints.


JP Grivet



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

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


Re: [Scilab-users] Stacked 2D plot in 3D

2018-02-05 Thread Jean-Philippe Grivet

Hi Claus,
I tried to post an example of a stacked 2D plot but my post was held up 
due to a too large graphic
file (postscript). I have now converted this plot to png format. Here it 
is. Ypu may still be interested
in using the xpoly function, despite seeing Samuel's beautiful examples 
with param3d.

Cheers
Jean-Philippe

Le 03/02/2018 à 21:27, Samuel Gougeon a écrit :

Le 03/02/2018 à 20:11, Claus Futtrup a écrit :

Hi Samuel

Thank you. This thing with the direction of the lines is difficult to 
"discover" by accident. :-)


... And thanks for the good help for param3d(1). I hope Scilab will 
adopt it.


When parts of curves are behind each others, there is a mess due to 
the perspective.

Here is a way to avoid this (i will also add it in the page):

[Xo,  Yo]  =  ndgrid(-10:0.5:10);
R  =  sqrt(Xo.*Xo  +  Yo.*Yo)  +  %eps;
Zo  =  sin(R)./R;

clf

// Simple plot with messed curves in the perspective
subplot(1,  3,  1)
param3d1(Xo,  Yo,  Zo,  150,  85,  flag=[2,4])

// With a curtain and filled curved (to avoid messed areas)
subplot(1,3,2)
nc  =  size(Xo,"c");
zmin  =  min(Zo);

X  =  [Xo(1,:)  ;  Xo  ;  Xo($,:)];
Y  =  [Yo(1,:)  ;  Yo  ;  Yo($,:)];
Z  =  [zmin*ones(1,nc)  ;  Zo  ;  zmin*ones(1,nc)];

param3d1(X,  Y,  Z,  150,  85,  flag=[2,4])
e  =  gce();
e.children.fill_mode  =  "on";

// Try to mask the curtain with %nan
// =>unsuccessful due to the bug http://bugzilla.scilab.org/11803
subplot(1,3,3)
X  =  [Xo([1  1],:)  ;  Xo  ;  Xo([$  $],:)];
Y  =  [Yo([1  1],:)  ;  Yo  ;  Yo([$  $],:)];
Z  =  [[zmin  ;  %nan]*ones(1,nc)  ;  Zo  ;  [%nan  ;  zmin]*ones(1,nc)];

param3d1(X,  Y,  Z,  150,  85,  flag=[2,4])
e  =  gce();
e.children.fill_mode  =  "on";

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



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Stacked 2D plot in 3D

2018-01-31 Thread Jean-Philippe Grivet

Hi Claus, Rafeal and Samuel,

Here is another method for stacked plots, which was suggested to me 
years ago by Serge Steer.

I used it succssfully for about 12 individual curves.

Cheers,
JP Grivet



Le 28/01/2018 20:19, Claus Futtrup a écrit :

Hi Rafael and Samuel

Thank you both for great suggestions - and as I thought - I was on the 
wrong path. Indeed I looked at plot3d3 and didn't catch that this one 
is suitable for what I wish to do. I see clearly with the example by 
Samuel that it is quite a smart way. I initially made the mistake to 
feed vectors (frequencies + angles), and it complained (and it 
revealed, it seems, that plot3d3 is based on param3d1). I see it needs 
matrices. The example by Rafael made that clear to me. Thanks Rafael 
for a very good example to work with.


Best regards,
Claus

On Sun, Jan 28, 2018 at 5:24 PM, Rafael Guerra 
<jrafaelbgue...@hotmail.com <mailto:jrafaelbgue...@hotmail.com>> wrote:


Hi Samuel,

Absolutely, the two param3d functions should be merged.

The vectorised assignment example should also be included in the
helpfile.

Regards,
Rafael

-Original Message-
From: users [mailto:users-boun...@lists.scilab.org
<mailto:users-boun...@lists.scilab.org>] On Behalf Of Samuel Gougeon
Sent: Sunday, January 28, 2018 5:17 PM
To: Users mailing list for Scilab <users@lists.scilab.org
<mailto:users@lists.scilab.org>>
Subject: Re: [Scilab-users] Stacked 2D plot in 3D

Hello Rafael,

About param3d() and param3d1():
In 3 days, it will be the 10th birthday of this report:
http://bugzilla.scilab.org/6155 <http://bugzilla.scilab.org/6155>
Shall we make a present to other users? :) By the way, beyond
their pages, don't you think the functions themselves should be
merged?

Le 28/01/2018 à 16:39, Rafael Guerra a écrit :
> .../...
> for i=1:nf;
>  e.children(i).foreground = color('dark blue');
>  e.children(i).thickness = 2;
> end

Or more simply:

e.children.foreground = color('dark blue'); e.children.thickness = 2;

This kind of vectorized assignment (almost always) works.

Cheers
Samuel

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




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




---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus
x=linspace(-10,10,500);
clf;ax=gca();
ax.axes_visible='on';
xmin=-10;
xmax=+10;
ymin=-1;
ymax=2
ax.data_bounds=[xmin,ymin;xmax ymax];
yshift=0.2;
drawlater
for xshift=5:-0.4:-5
  xfpoly([xmin x xmax],[ymin yshift+sinc(x+xshift) ymin],1)
  e=gce();e.background=-2;
  yshift=yshift-0.02;
end
drawnow()
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Radon transform

2017-11-15 Thread Jean-Philippe Grivet

Hello,

Does an implementation of the Radon transform exist in Scilab, similar 
to the Matlab

"radon" function ? Would anybody be willing to share a homemade version ?

Thank you for your input
JP Grivet


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

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


Re: [Scilab-users] using csvRead

2016-10-21 Thread jean-philippe grivet
Both vi and emacs can handle vary large files. You could use either to 
replace all

separatots by commas and then use csvRead.

Le 15/10/2016 15:45, Samuel Gougeon a écrit :

Hello

Le 14/10/2016 00:08, Philipp Mühlmann a écrit :

Dear Scilab users,

having a data file (*.cvs) containg following format:


HEADER-Line
dd.mm., HH:MM:SS.MS , value01, value02

dd = day
mm = month
 = year

HH = hour
MM = minute
SS = second
Ms = milli second

ValueXY = numerical value

Is it possible to use cvsRead in such a way to define the separator 
beeing ',' and ':' at the same time?
Beside the solution provided by Serge, if you wish to stick to 
csvRead(), have you tried using its "substitute" option, with a [":" 
","] value?
I didn't, but would be interested by results. I am wondering whether 
the substitution is done before splitting the line with the separator 
(then "substitute" will work), or after. This detail would deserve 
being documented.


Read you soon
Samuel Gougeon



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




---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ticks labels with coma instead of dot for decimal separator

2016-05-18 Thread grivet
Thank you Samuel: your suggestion works like a charm  (and also for 
inserting the correct subject heading).

JP Grivet


Hello,

As far as i know, gca().ticks_format does not allow to change the decimal 
separator.
However, you can post-process default labels with strsubst():

x = linspace(0,2,100);
plot(x, sin(x))
ax = gca();
ax.x_ticks.labels = strsubst(ax.x_ticks.labels,".",",");
ax.y_ticks.labels = strsubst(ax.y_ticks.labels,".",",");
ax.font_size = 3;

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



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


Re: [Scilab-users] How to find the number of polylines automatically

2016-05-17 Thread grivet

Hello,
Is it possible, within Scilab 5.2, to display tics_labels in European 
format, i.e. with commas instead of points as

decimal separators ?
Thank you for any suggestion
JP Grivet

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


Re: [Scilab-users] bug in function iir ?

2016-02-25 Thread grivet

Le 24/02/2016 21:40, Serge Steer a écrit :

Le 24/02/2016 11:30, grivet a écrit :
I appreciate your help; however, neither suggestion works: I still 
get the same error message.

The similar line
[frq,repf]=repfreq(hz,0.01,0.49);
has no problem
please can you save the hz value using the Scilab save function and 
send the file?

Serge



Voila le code:
//filtre Butterworth
Order   = 2; // The order of the filter
Fs  = 1000; // The sampling frequency
Fcutoff = 40;   // The cutoff frequency

// We design a low pass Butterworth filter
hz = iir(Order,'lp','butt',Fcutoff/Fs/2,[0.1 0.1]);

// We compute the frequency response of the filter
[frq,repf]=repfreq(hz,0,0.5);
[db_repf, phi_repf] = dbphi(repf);

// And plot the bode like representation of the digital filter
subplot(2,1,1);
plot2d(Fs*frq,db_repf);
xtitle('Obtained Frequency Response (Magnitude)');
subplot(2,1,2);
plot2d(Fs*frq,phi_repf);
xtitle('Obtained Frequency Response (Phase in degree)');

iir est sauvegardé dans "svgd_iir" joint (binaire).

Cordialement,
JP Grivet



svgd_iir
Description: Binary data
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] bug in function iir ?

2016-02-24 Thread grivet
I appreciate your help; however, neither suggestion works: I still get 
the same error message.

The similar line
[frq,repf]=repfreq(hz,0.01,0.49);
has no problem
Your problem arises because one frequency value you ask for  
corresponds exactly to a zero of hz.num

log(roots(hz.num))/(2*%pi)
so you want to compute the gain in dB of a zero value which is -inf

To avoid such problem you can let repfreq to do the frequency 
discretization.
[frq,repf]=repfreq (hz) or equivalently 
[frq,repf]=repfreq (hz,0,0.5)

in  this case the discretization uses  varying  frequency step
Serge

Le 23/02/2016 14:41, grivet a écrit :

Le 23/02/2016 14:21, Serge Steer a écrit :

Please can you give more details :
value of Order and Fcutoff/Fs/2
and what you are doing with hz (because iir does not call dbphi)
Serge




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


[Scilab-users] bug in function iir ?

2016-02-23 Thread grivet

Hello,
I am beginning to use digital filters to treat some data. As my first 
step, I try to run the examples in the help,how to design an elliptic 
filter (using Scilab 5.5.1, Win7-64). This works . However, when I 
select a Butterworth filter:

 hz = iir(Order,'lp','butt',Fcutoff/Fs/2,[0.1 0.1]);
I get this error message:

Singularité de la fonction log ou tan.
at line   6 of function dbphi called by :
[db_repf, phi_repf] = dbphi(repf);

What did I miss ?
No bugs have been reported for function dbphi, but three similar bugs 
are listed for iir.

Any suggestion welcome.
JPGrivet


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


Re: [Scilab-users] mixing normal and math mode in label

2016-02-03 Thread grivet

Thank you Samuel and Jean-Yves. The line
 xlabel("$\mbox{fréquence  (h}^{-1})$");
does exactly what I wanted.
A small complement: the first $ must not be followed by a space and the 
last $

must not be preceded by a space.
JP Grivet

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


[Scilab-users] mixing normal and math mode in label

2016-02-03 Thread grivet

Hello,
How can I insert exponents inside a text label ?
I tried:   xlabel("frequency (h$^{-1}$)"). This did not work for me (Win 
7, Scilab 5.5.1):

the Latex part is not interpreted but reproduced verbatim.
Thank you for any suggestion
JP Grivet

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


[Scilab-users] labels again

2016-02-03 Thread grivet

Hello,
When I do
 xlabel("$\mbox{fréquence  (h}^{-1})$");
 ylabel("DSP (échelle logarithmique)" );
I find that the x and y labels are neither in the same font nor in the 
same size. I have to add

   "fontsize",3,"fontname","times"
(for instance) in order to get to labels looking almost alike.

Samuel: you are correct about spaces. I don't know what happened in my 
previous trials.

Cheers,
JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] read format

2015-10-13 Thread grivet

Your suggestion does not work for me. Here is what I get:
-->M = csvRead('dataN.txt', ';', "double");
 -->M(1:10,:)
 ans  =
 Nan5.491.
Nan5.491.
Nan5.481.
Nan5.481.
Nan5.481.
which seems to check with the help for csvRead:

When the input argument "conversion" is equal to "double", the 
non-numeric fields within the .csv (e.g. strings) are converted into NaN.


Thank you for your time and help.
JP Grivet

Hello,

Well in fact the `evstr` call is not needed if you parse the csv and
interpreting directly the values as "double" using :

M = csvRead('/tmp/sample.csv', ';', "double");
values = M(:,2);

Regards,

--
Clément

Le lundi 12 octobre 2015 à 18:00 +0200, grivet a écrit :

Thank you Samuel, this works like a charm, even though the last step
(evstr) takes a couple of minutes (8 lines!).
For a completely different solution: read the file into emacs, define
a
rectangle of width 20 chars and height the whole file, delete this
rectangle, search for ".1" and erase every occurence of this string.
Thanks to everybody,
JP Grivet


Le 12/10/2015 14:26, grivet a écrit :

Hello,
I have a data file of about 80k lines. A typical line looks like
this:
 01/03/2015 00:01:00;5.49;1
(date time; value;parameter). I am only interested in the field
"value", which can be 3 or 4
characters wide (i.e. 5.49 or 5.4).
How can I extract the desired data from this file ?

.
Likely with
M  = csvRead(TheFileName, ";", ".", "string");
values = evstr(M(:,2));

Samuel Gougeon


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


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


Re: [Scilab-users] read format

2015-10-12 Thread grivet
Thank you Samuel, this works like a charm, even though the last step 
(evstr) takes a couple of minutes (8 lines!).
For a completely different solution: read the file into emacs, define a 
rectangle of width 20 chars and height the whole file, delete this 
rectangle, search for ".1" and erase every occurence of this string.

Thanks to everybody,
JP Grivet


Le 12/10/2015 14:26, grivet a écrit :

Hello,
I have a data file of about 80k lines. A typical line looks like this:
01/03/2015 00:01:00;5.49;1
(date time; value;parameter). I am only interested in the field 
"value", which can be 3 or 4

characters wide (i.e. 5.49 or 5.4).
How can I extract the desired data from this file ?

.
Likely with
M  = csvRead(TheFileName, ";", ".", "string");
values = evstr(M(:,2));

Samuel Gougeon



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


[Scilab-users] read format

2015-10-12 Thread grivet

Hello,
I have a data file of about 80k lines. A typical line looks like this:
01/03/2015 00:01:00;5.49;1
(date time; value;parameter). I am only interested in the field "value", 
which can be 3 or 4

characters wide (i.e. 5.49 or 5.4).
How can I extract the desired data from this file ?
Thank you for your help.
JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] animation of multiple plots

2015-09-16 Thread grivet

Hi,
Many thanks to all who responded to my post. Your help is all the more 
commendable that my

problem had (as Serge pointed out) nothing to do with Scilab.

Special thanks to Antoine Monmayrant who discovered my error. When 
creating an animation with ImageMagick,
one may specify a parameter (-delay) which is the delay between 
successive frames. I sometimes chose (randomly) a zero value. With 
recent versions of Firefox, this is equivalent to showing the last 
frame. Any non-zero value leads to a correct display. Such is not the 
case with Internet Explorer which apparently forces a minimum value of 
this parameter.


Subsidiary question to Antoine. I know how to set the delay (-delay nn 
or -set delay nn), but how can I find out its value for an existing 
animatio ?


Cheers,
JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] animation of multiple plots

2015-09-15 Thread grivet

Hi,

I am trying to animate multiple plots. For instance, when modeling the 
motion of a planet
around the sun, I wish to plot, in one window, the planet's position 
and, in another window, the tip of the velocity vector, both plots 
evolving with time.

I can do that in principle with the following algorithm.
for each time point
compute x,y,vx,vy
define he2 handle of the trajectory
define he6 handle of the velocity curve
drawlater()
subplot(1,2,1)
update trajectory: he2.children(1).data = [x(t(1:i)),y(t(1:i))]
subplot (1,2,2)
update velocity: he6.children(1).data = [vx(t(1:i)),vy(t(1:i))]
drawnow()
record gif image
update x,y,vx,vy
end
Using imageMagick, I then combine all the gif's in an single animation 
file.


This process works on my computer. I can visualize the animation using 
Irfanview,
Chrome or Internet Explorer, but not Firefox which shows only the last 
image.
The situation gets worse when I try to post this animation on the Net: 
no program

that I know of can display the animation, they all display the first image.

I have written other animations which behave properly (see 
https://grenoble-sciences.ujf-grenoble.fr/pap-ebook/grivet/liste-animations). 
However, there is one,
probably significant, difference: these working animations don't use 
multiple windows.


I would be very grateful for any suggestion on how to run two animations 
side by side.

Thank you in advance for your time and help.
JP Grivet


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


Re: [Scilab-users] Bessel functions

2015-01-26 Thread grivet

Le 26/01/2015 10:57, Dang, Christophe a écrit :

Hello,


De  Claus Futtrup
Envoyé : samedi 24 janvier 2015 17:53

I've made a small script to play around with Bessel functions of the first kind
[...]
for m=0:19 // ...
powerseries_m = ((-1)^m / (factorial(m) * factorial(m + n))) * (x/2)^(2*m);
powerseries = powerseries + powerseries_m; // sum the powerseries
end

Generally speaking, I think you'd better use the possibilities of vector 
calculation as much as possible, to have a faster calculation.

The lines above could look like the following, assuming x is a column vector:

m = 0:19;

[x_mat, m_mat] = ndgrid(x, m); // rectangular matrices for group evaluation

f = 1 ./(factorial(m) .* factorial(m + n));

f_mat = ndgrid(f, x)';

powerseries = sum((-1).^m_mat.*f_mat.*(x_mat/2).^(2*m_mat), c);

However, this quite naive implementation is probably not accurate when x and m 
are high,
for f would have some zeros (if m or m+n  170) leading to zeros in powerseries,
whereas f*(x/2)^(2m) might not be negligible.

The reason why you should follow Nikolay's advice and use built-in functions, 
which usually use strong algorithms.

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
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
Almost every numerical analysis textbook comprises a chapter on the 
evaluation of Bessel functions, as for instance
Abramowitz ans Stegun, Handbook of mathematical functions, chapters 
9,10 (elegant use of recurrence relation)

Press et al., Numerical recipes, chapter 6 (rational approximations)
Enjoy!
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] truncated postscript image

2014-08-27 Thread grivet

Hi,
I believe there is a bug in the export function for postscript and 
encapsulated postscript, under win7, 64bits,

with both Scilab 5.4.1 and 5.5.

When I use a wide plotting window  and then choose export to 
[encapsulated] postscript, then the
resulting figure is truncated; its width is never larger than 600 
pixels. This behavior is independant
of the choice portrait/landscape. Could the problem be linked to the use 
of wide (16x9) screens ?


On the other hand, export to .gif or to .pdf works fine.

Can somebody confirm this bug ?
JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] multiple plots

2014-08-21 Thread grivet
Thank you Serge for correctiong my mistake; my program now work fine. 
However,
I notice that the two subplots are rather small and occupy a small 
fraction of the overall
window. They shrink when the window is made small but they do not get 
larger than a
certain size when i enlarge the window. Is it possible to choose the 
size of the subplots ?


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


[Scilab-users] multiple plots

2014-08-20 Thread grivet
For a single plot, it is possible to choose many aspects of the plot 
using, for instance

ha = gca();
ha.data_bounds=[-5, -5 ; 20, 20];

Is it possible to have the same possibilities within subplots, like
subplot(2,1,1)
ha1 = gca();
ha1.data_bounds=[-5, -5 ; 20, 20];
subplot(2,1,2)
ha2 = gca;
ha2.data_bounds=[-1, -1 ; 2, 2];
(which does not work with Scilab 5.5/win7).

I would like to plot two different variables, with different units and 
ranges. Even more

ambitious, I would like to run different animations in each subplot.

Thank you for any suggestions.
JP Grivet

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


Re: [Scilab-users] orientation of encapsulated postscript

2014-06-26 Thread grivet

x = 0:200;
y = sin(2*%pi*x/50);
plot(x,y)

I forgot to mention that I work under Win7.

Regards,
JP Grivet

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


Re: [Scilab-users] orientation of encapsulated postscript

2014-06-26 Thread grivet

Le 26/06/2014 12:30, Calixte Denizet a écrit :

Could you attach the generated EPS file please ?

Calixte

On 26/06/2014 11:52, grivet wrote:

x = 0:200;
y = sin(2*%pi*x/50);
plot(x,y)

I forgot to mention that I work under Win7.

Regards,
JP Grivet

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



Here they are. Opening both file with Numpad, I notice that the ounding 
box is idential in th two cases, and wider than the page.

Cordialement
JP Grivet



paysage.eps
Description: PostScript document


portrait.eps
Description: PostScript document
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] function find()

2014-05-28 Thread grivet
Thank you all for your suggestions concerning pair-wise distances. The 
motivation behind my
question is that I am writing a simplistic molecular dynamics program, 
where hard disks move
freely inside a plane region, except when colliding with boudaries or 
with other disks. I hoped
that my program could be as fast as the beautiful Python program of Jake 
Vanderplas
(http://jakevdp.github.com) but, up to now, the Python code is still 
significantly faster.

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


[Scilab-users] distance matrix

2014-05-27 Thread grivet

I have a suggestion related to my previous post concerning pairwise
distances. I have just learned the Matlab provides a function, pdist,
that computes these in a single instruction: pdist(M). it would be
convenient if the same functionwere implemented in Scilab.
JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] window size

2014-04-04 Thread grivet

Dear all,

Under Win7pro, I use plot to draw a rather complex curve. I often use 
the mouse to increase the plot window size,
in order to better see details. Is it possible to choose a window size 
(in pixel ? cm ?) before a call to plot ?


Cheers,
JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] 3D animated plot

2014-04-01 Thread grivet

Le 01/04/2014 00:36, Samuel Gougeon a écrit :

Hello,
It would be easier to debug with posting also t, xt
 and yt definitions, as well as
the copy/paste of the interrupted line with its error message.
Regards
Samuel


Sorry, here is the complete listing:

//exemple de param3d
t=0:0.1:5*%pi;
npt = size(t,*);
param3d(sin(t(1:2)),cos(t(1:2)),t(1:2)/10,35,45,X@Y@Z);

he=gce(); //the handle on the 3D polyline
he.foreground=color('red');

ha=gca(); //the handle on the axes
ha.rotation_angles=[60 80];
ha.data_bounds = [-1,-1,0;1,1,5];

for j = 1:npt
drawlater();
he.children(1).data = [sin(t(1:j));cos(t(1:j)); t(1:j)]';
drawnow();
end;

and here is the error message

 !--error 246
Fonction non définie pour le type d'argument donné.
  vérifiez les arguments ou définir la fonction %c_round pour la surcharge.
at line  94 of function %s_i_s called by :
at line  39 of function generic_i_h called by :
at line   2 of function %s_i_h called by :
 he.children(1).data = [sin(t(1:j));cos(t(1:j)); t(1:j)]';
at line  17 of exec file called by :
exec(%fileToExec); disp(msprintf(gettext(Execution done.\n)
while executing a callback

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


[Scilab-users] using mesh

2013-10-23 Thread grivet

Hi,

I have a data matrix  M (64x128) which I plot in 3-D using mesh(x,y,M). 
this produces a nice plot.

However, when I export this plot as an .eps file, I notice two problems:
-the process is very long (several minutes)
-the resulting file is large (3.1 Mo)
If I choose export to .pdf,  the transfer to disk is somewhat faster and 
the resulting file half as large.
Is this behaviour normal or is there a way to obtain a smaller file (in 
eps or pdf format) in a shorter time ?


Is it possible, using mesh, to plot a subset of the data, as is done 
with plot3d using ebox ?


There is an annoying discrepancy between mesh and contour2d: if 
mesh(x,y,M) works,
then I must write contour2d(y,x,M) to obtain a contour plot, ie lines 
and columns are switched.


I use win XP, SP3 and Scilab 5.4.1

Thank you in advance for your help
JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] color under a curve

2013-03-15 Thread grivet

Thank you Adrien and Christophe.

The code provided by Christophe is specially simple and elegant, but assumes
the function to be strictly positive. Filled areas are different when I 
change

x to x = linspace(-2*%pi,2*%pi,100).
For my purposes, it seems best to use xfpoly() for each region where the
function has a constant sign. The drawback is that color choices are not
as versatile as with plot().

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


[Scilab-users] strange behavior of function xstring

2013-03-15 Thread grivet

Hello,
I have noticed the following strange behavior of function xstring.

This piece of code works fine:

clear; clf();
s = A;
plot2d(0,0,-1,010, ,[-2,-2,2,2]);
xstring(0.5,0.5,s);

This one does not (simplified exemple, no useful purpose):

clear; clf();
function etiq(x,y)
s = A;
xstring(x,y,s};
endfunction
plot2d(0,0,-1,010, ,[-2,-2,2,2]);
etiq(0.5,0.5);

Scilab stops with error message

xstring(x,y,s};
   !--error 2
Facteur invalide.
at line   3 of function etiq called by :

What do I do wrong?
JP Grivet

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


[Scilab-users] vatying color along a curve

2013-03-01 Thread grivet

Hello,
I am trying to plot a curve using varying colors (or saturations) along 
the way. The curve is computed as a series of segments.
To plot a segment beginning at (xd,yd) and ending at (xf,yf), I have 
tried the following


plot([xd,xf],[yd,yf],foreground,3);

This works, but, at each call of plot (thousands in my case) Scilab 
emits the following message:


AVERTISSEMENT : Incorrect input : Color vector should be a 3x1 or 1x3 vector
Further, I would like to use colors which do not belong to the default 
color table. If I do


plot([xd,xf],[yd,yf],foreground,[3,3,3]);

the program stops on the first call to plot with the following error 
message:


addcolor : Type erroné de l'argument d'entrée n°1 : Une structure de 
données de type color_map attendue


I then tried

plot([xd,xf],[yd,yf],foreground,color_map(3));

the program stops on the first call to plot with the following error 
message:

Variable non définie : color_map

What is the correct syntax? I would like to choose a different color 
vector for each call of plot. Further, the help
sometimes states that color vector elements must be integers from 0 to 
256, sometimes reals between

0 and 1; which is correct ?

Thank you in advance for your time and help.
JP Grivet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users