Re: [Scilab-users] for-loop error

2020-10-29 Thread Rafael Guerra
That is weird. Your code in my Scilab 6.1 on Win 10, shows: "j=7; Nstep=18; k=126 j*Nstep=126" "j=8; Nstep=18; k=144 j*Nstep=144" Regards, Rafael -Original Message- From: users On Behalf Of anna28 Sent: Thursday, October 29, 2020 4:08 PM To: users@lists.scilab.org Subject: Re:

Re: [Scilab-users] for-loop error

2020-10-29 Thread Rafael Guerra
Hi, Are you sure that all the strings in matrix have at least 20 characters? PS: Not related to the index issue but probably not a good idea to use a variable with same name as existing function matrix. Regards, Rafael -Original Message- From: users On Behalf Of anna28

Re: [Scilab-users] Fwd: plotting dots vs xfarc

2020-09-30 Thread Rafael Guerra
Hi, Type in help: pixel_drawing_mode Could this help for your problem? Regards, Rafael From: users On Behalf Of P M Sent: Wednesday, September 30, 2020 5:50 PM To: International users mailing list for Scilab. Subject: [Scilab-users] Fwd: plotting dots vs xfarc Dear community, I need to

Re: [Scilab-users] scilab -f file : can it uses an existing instance of scilab?

2020-09-28 Thread Rafael Guerra
Hi Antoine, >From an existing Scilab console doing: exec("filepath\filename",-1), is not >good enough? Regards, Rafael -Original Message- From: users On Behalf Of Antoine Monmayrant Sent: Monday, September 28, 2020 12:06 PM To: users@lists.scilab.org Subject: [Scilab-users] scilab

Re: [Scilab-users] errors (uncertainties) in non-linear least-squares fitting parameters

2020-08-24 Thread Rafael Guerra
In that case, the code can be simplified using backslash left matrix division: // Fixed point (-4,0) solution: a = (MW+4)\Y; b = a*4; GG= a'.*.xx' + repmat(b',1,size(xx,1)); plot(xx,GG','LineWidth',1); Regards, Rafael ___ users mailing list

Re: [Scilab-users] errors (uncertainties) in non-linear least-squares fitting parameters

2020-08-24 Thread Rafael Guerra
Hi Heinz, For the regression errors, I am not an expert but from wikipedia or from reference below, I would risk the following code (at your peril): https://pages.mtu.edu/~fmorriso/cm3215/UncertaintySlopeInterceptOfLeastSquaresFit.pdf // Note: for degrees of freedom>=6, t-distribution ~2 N =

Re: [Scilab-users] bvode example broken?

2020-07-15 Thread Rafael Guerra
Hi, Face same error in Win10 Scilab 6.1.0. But no such error in Win10 Scilab 5.5.2. Rgds, Rafael From: users On Behalf Of Rene Djack Sent: Wednesday, July 15, 2020 8:39 PM To: users@lists.scilab.org Subject: [Scilab-users] bvode example broken? Hello, I' m new to this list and to scilab too!

Re: [Scilab-users] How to pass arguments by reference from Scilab?

2020-07-03 Thread Rafael Guerra
Hi, The following Scilab document available online may answer some of your questions: Programming in Scilab, by Michael Baudin, 2011 Regards, Rafael From: users On Behalf Of si_soso Sent: Friday, July 3, 2020 4:46 AM To: users@lists.scilab.org Subject: [Scilab-users] How to pass arguments

Re: [Scilab-users] Random colours for plot markers

2020-06-27 Thread Rafael Guerra
Hi, Maybe you could complement polarplot with scatter, as in rush example below: clear clf() x = 300; angle= %pi; p=primes(x); rad= p; theta= -angle + 5*p*angle/x; n = length(p); f = gcf(); f.figure_size=[1024,1024]; mcolors = int(n*rand(p)); polarplot(theta,rad)

Re: [Scilab-users] scilab 6.1 crashes when trying to load big matfile (loadmatfile)

2020-06-19 Thread Rafael Guerra
Script runs fine on Win10, Scilab 6.1, 64 GB RAM. But btw, the file a28.mat seems to have only 342MB. -Original Message- From: users On Behalf Of Stéphane Mottelet Sent: Friday, June 19, 2020 10:15 AM To: users@lists.scilab.org Subject: Re: [Scilab-users] scilab 6.1 crashes when trying

Re: [Scilab-users] Pong contest (new version)

2020-06-08 Thread Rafael Guerra
Pong2 score: [cid:image001.png@01D63DA1.57252750] Regards, Rafael -Original Message- From: users On Behalf Of Stéphane Mottelet Sent: Monday, June 8, 2020 11:46 AM To: Users mailing list for Scilab Subject: [Scilab-users] Pong contest (new version) Hello all, Here is a

Re: [Scilab-users] Pong contest

2020-06-07 Thread Rafael Guerra
Hello Stéphane et al., Would it make sense in this “Pong contest”, in addition to the OS used, to also provide some sort of benchmarking of machine CPU? Fyi, find below simple test by Gershenfeld (1999), it computes Pi=4*atan(1) by two methods: Scalar test: Pi(N)~Sum{i=1:N;

Re: [Scilab-users] Pong contest

2020-06-05 Thread Rafael Guerra
It runs very fast on Win10 and the pong ball looks like a Flintstones ball… [cid:image003.jpg@01D63B72.F1EBEED0] ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] Spec function

2020-05-25 Thread Rafael Guerra
Hi, In the sample code provided, the loops 'for j=length(b_V)', seem to only evaluate the case b=3. It does not seem to match the explanation below. Regards, Rafael From: users On Behalf Of fujimoto2005 Sent: Friday, May 22, 2020 4:06 PM To: users@lists.scilab.org Subject: [Scilab-users]

Re: [Scilab-users] Can Scilab compute the inverse of the regularized Incomplete Beta Function?

2020-05-18 Thread Rafael Guerra
Hi Heinz, Fyi, the following site provides Matlab code that may be translated to Scilab: https://people.sc.fsu.edu/~jburkardt/m_src/asa109/asa109.html betain.m : incomplete Beta function ratio xinbta.m : inverse of the incomplete Beta function The Scilab Atoms 'Distfun' package contains:

Re: [Scilab-users] [EXT] parsing TSV (or CSV) file with scilab is a nightmare

2020-04-28 Thread Rafael Guerra
Antoine, One workflow that works fast for me, for large data files, is to load first the whole file with mgetl, then remove all empty lines using isempty in a loop (as shown below), process the header block, isolate the data block and save it to a temporary backup file to disk using mputl,

Re: [Scilab-users] spline and color plot on the chart

2020-04-11 Thread Rafael Guerra
Reading the lsq_splin function help, should help in this case: The error “There are not enough points to adjust” is due to the fact that the 3rd input to lsq_splin (‘x’ the list of breakpoints of the cubic spline) has values all lying outside the input vt12 variable range (39.49 to 155.62).

Re: [Scilab-users] printf "\r" in Scilab 6x

2020-04-10 Thread Rafael Guerra
@lists.scilab.org Subject: Re: [Scilab-users] printf "\r" in Scilab 6x Le 10/04/2020 à 09:46, Rafael Guerra a écrit : Dear Scilab'ers, The following code, when executed from SciNotes in Scilab 5x, printed the loop progress to console, at same location, thanks to printf ("\r"). The pr

[Scilab-users] printf "\r" in Scilab 6x

2020-04-10 Thread Rafael Guerra
Dear Scilab'ers, The following code, when executed from SciNotes in Scilab 5x, printed the loop progress to console, at same location, thanks to printf ("\r"). The printf behaviour seems to have changed in Scilab 6x, and the strings are now printed one after the other. printf("Print loop

Re: [Scilab-users] Corona modelling

2020-03-30 Thread Rafael Guerra
Hi, In Wikipedia article " Mathematical modelling of infectious disease " it says that people counted in R have been infected and removed from the disease due to immunization or death. I am not an expert but the fatality ratio could be defined as a percentage of the people infected 'I'.

Re: [Scilab-users] Corona modelling

2020-03-30 Thread Rafael Guerra
Merci Stéphane, for the very interesting code and Heinz for the reference to the math behind the epidemy “curve”, or one of its models. From: users On Behalf Of Stéphane Mottelet Sent: Monday, March 30, 2020 9:14 AM To: users@lists.scilab.org Subject: Re: [Scilab-users] Corona modelling

Re: [Scilab-users] Finding elements occurring once in a matrix

2019-07-05 Thread Rafael Guerra
Try the following, without loops, inspired by a solution by B. Mohandes : --> x = [1.1 1.1 3.2; 2.3 1.1 1.1; 4.7 5.2 5.2] x = 1.1 1.1 3.2 2.3 1.1 1.1 4.7 5.2 5.2 --> y = unique(x); y0 = [min(y)-1; y]; y(find(histc(y0,x(:),%F)==1)) ans = 2.3 3.2 4.7 Regards,

Re: [Scilab-users] Problem with reglin function

2019-04-17 Thread Rafael Guerra
Transpose X and Y vectors: [a,b,sig] = reglin(Data_Zeta(:,1)',Data_Zeta(:,2)'); // Call of the reglin function ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] Nested function definition

2019-04-10 Thread Rafael Guerra
I think the simple examples serve to show the syntax only, and do not explain its utility. The nested function definition will be useful if called many times within a lengthy function, or just for sake of code clarity. Regards, Rafael -Original Message- From: users On Behalf Of

Re: [Scilab-users] Nested function definition

2019-04-10 Thread Rafael Guerra
In your example, why not using a simpler URQ function definition into fsolve? For example: mg = 0.1; h=0.1; l=0.1; L0=0.1; function y=URQ(q) e = mg./(2*q); z= asinh(mg.*h./(2*q.*l.*sinh(e)))+e; y= mg.*L0./(q.*l)-sinh(2*e-z)-sinh(z) endfunction q=1; y=URQ(q) Rgds Rafael

Re: [Scilab-users] Nested function definition

2019-04-09 Thread Rafael Guerra
global mg h l L0; mg = 0.1; h=0.1; l=0.1; L0=0.1; function e=eta(q) e= mg./(2*q) endfunction function z=zeta(q) z= asinh(mg.*h./(2*q.*l.*sinh(eta(q+eta(q); endfunction function y=URQ(q, e, z) y= mg.*L0./(q.*l)-sinh(2*e-z)-sinh(z) endfunction q=1; y=URQ(q,eta(q),zeta(q)) Rgds,

Re: [Scilab-users] Vectorfind with accuracy

2018-11-12 Thread Rafael Guerra
Hi Iza, Why not rounding-off both inputs to the desired accuracy before vectorfind? Regards, Rafael -Original Message- From: users On Behalf Of Izabela Wójcik-Grzaba Sent: Monday, November 12, 2018 5:16 PM To: users@lists.scilab.org Subject: [Scilab-users] Vectorfind with accuracy

Re: [Scilab-users] Enquiry

2018-10-31 Thread Rafael Guerra
The French Touch ! -Original Message- From: users On Behalf Of Stéphane Mottelet Sent: Wednesday, October 31, 2018 3:01 PM To: Users mailing list for Scilab Subject: Re: [Scilab-users] Enquiry The price ! > Le 31 oct. 2018 à 12:31, Kombo Theophilus-Johnson > a écrit : > > What's

Re: [Scilab-users] Frequency response

2018-09-18 Thread Rafael Guerra
“just notice that the answer similar as the one Tim provided, just a bit confused on Claus' comment on the "random" data” Claus problem is defined in the script: “stepresponse - 2018-09-16.sce” that was forwarded earlier ___ users mailing list

Re: [Scilab-users] {EXT} Re: Frequency response

2018-09-17 Thread Rafael Guerra
Redundant qwant-fu'ing ... response was already provided ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] Frequency response

2018-09-17 Thread Rafael Guerra
Chin Luh: good to know but how does that solve Claus Futtrup specific problem? ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] Frequency response

2018-09-16 Thread Rafael Guerra
ents in the script, I didn't clean it up for publishing... Best regards, Claus On 15.09.2018 22:47, Rafael Guerra wrote: Forgetting MATLAB for a second, can you define your problem ? How is your specific frequency response defined? In Laplace, Fourier, z-transform, ..., domain?

Re: [Scilab-users] Frequency response

2018-09-15 Thread Rafael Guerra
Just to refresh some definitions, for non-DSP specialists like me. For a Linear Time Invariant system with impulse response h(t) and transfer function H(f), input/output signals x(t) / y(t) and Fourier transforms X(f) / Y(f) we have: y(t) = x(t) * h(t) (convolution) ?? Y(f) = X(f).H(f)

Re: [Scilab-users] Frequency response

2018-09-15 Thread Rafael Guerra
Forgetting MATLAB for a second, can you define your problem ? How is your specific frequency response defined? In Laplace, Fourier, z-transform, ..., domain? From: users on behalf of Claus Futtrup Sent: Saturday, September 15, 2018 11:15:08 PM To:

Re: [Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ?

2018-09-10 Thread Rafael Guerra
Antoine, As requested, your script seems to produce the same results in Win 7 64-bit Scilab 5.5.2 and 6.0.1, as you reported for Linux_x64. Regards, Rafael ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] A plane intersecting a surface

2018-09-10 Thread Rafael Guerra
The new attached snapshot is taken from a better angle to illustrate the plane cutting the 3D data cloud. PS: The Scilab 3D plots all use orthographic views. An option to include perspective is missing. ___ users mailing list users@lists.scilab.org

Re: [Scilab-users] A plane intersecting a surface

2018-09-10 Thread Rafael Guerra
Paul, The attached home-made example illustrates the very simple procedure that I have suggested earlier (i.e., using distance to plane + cshep2d function). PS: if you have multi-valued input

Re: [Scilab-users] A plane intersecting a surface

2018-09-08 Thread Rafael Guerra
Hi Paul, I am not aware of such tool. To extract the points in the experimental cloud that are within a given distance from the plane, use equation in: https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_plane If your cloud of points behaves well enough, you can interpolate it first into

Re: [Scilab-users] Scilab 6.0.1 crashes with printf command

2018-09-04 Thread Rafael Guerra
The answer to my last question is Samuel's magic uman: --> uman -wb "%%" Forgot to install it in Scilab 6.0, what a mistake. Regards, Rafael -Original Message- From: users On Behalf Of Rafael Guerra Sent: Tuesday, September 04, 2018 7:45 AM To: Users mailing list for Sc

Re: [Scilab-users] Scilab 6.0.1 crashes with printf command

2018-09-03 Thread Rafael Guerra
Stephane, Thanks for the bugzilla reference, which I was surprised to see as I have searched there before posting, with search strings like %% but it produced no results... This raises my next question: how to seach Bugzilla for "%%" string? Regards, Rafael

[Scilab-users] Scilab 6.0.1 crashes with printf command

2018-09-03 Thread Rafael Guerra
Dear Scilabers, Any clues on why the following command totally crashes Scilab 6.0.1 on Win7: --> printf("A = B ./(C+%%eps) (to avoid division by 0)\n"); while in Scilab 5.5.2 escapes % and outputs properly: A = B ./(C+%eps) (to avoid division by 0) How to escape % in Scilab 6.0.1's printf?

Re: [Scilab-users] Removing elements of one vector from another vector

2018-08-19 Thread Rafael Guerra
Hi, An alternative to remove all occurrences of 'b' in 'a' is to do: a(~members(a,b)) Regards, Rafael ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] ode with algebraic constraint

2018-08-14 Thread Rafael Guerra
Hallo Jens, Glad to hear. No, I could not find any "ready-solution" in cartesian coordinates. But I have reviewed the topic (https://en.wikipedia.org/wiki/Circular_motion) PS: Physics was my biggest passion at school and I think a little flame is still burning... Regards, Rafael

Re: [Scilab-users] ode with algebraic constraint

2018-08-13 Thread Rafael Guerra
Bitte ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] ode with algebraic constraint

2018-08-10 Thread Rafael Guerra
Hi Jens, I have got the particle moving on the sphere by writing the total acceleration as a sum of a centripetal component and a tangential component: // START OF CODE // Particle motion on a sphere using cartesian coordinates function dz=EoM(t, z, m, f)//z=[x; y; z; vx; vy; vz] (6 x 1)

Re: [Scilab-users] Moving window over 2D grid

2018-08-03 Thread Rafael Guerra
Hi Lester, Without further information, the simplest approach would be to write two nested loops. Now, regarding the computation of radially averaged PSDs, you may want to take a look in the web for published code. For example, look at the function raPsd2d, written by Ruzanski (2009) for

Re: [Scilab-users] Moving window over 2D grid

2018-08-03 Thread Rafael Guerra
What type of function you need to evaluate at each patch? How long does it take to run with the simplest double-loop implementation? Your problem seems to have only 24 x 24 = 576 iterations ... ___ users mailing list users@lists.scilab.org

Re: [Scilab-users] Need solution

2018-08-03 Thread Rafael Guerra
This is requires subject matter expertise, not Scilab’s. You may check out the following thesis, it provides Matlab code: http://etd.dtu.dk/thesis/210403/M_Sc_thesis_Jan_Slunsky.pdf From: users On Behalf Of onyebuchy benard Sent: Friday, July 13, 2018 12:09 PM To: Users Mailing List for Scilab

Re: [Scilab-users] xmltopdf() broken : workaround ?

2018-08-02 Thread Rafael Guerra
ugeon Sent: Thursday, August 02, 2018 11:28 PM To: Users mailing list for Scilab Subject: Re: [Scilab-users] xmltopdf() broken : workaround ? Le 02/08/2018 à 16:17, Rafael Guerra a écrit : > Ok, it seems that Calibre does that: > https://manual.calibre-ebook.com/conversion.html > https://calibre

Re: [Scilab-users] Padding and clipping a grid

2018-08-02 Thread Rafael Guerra
Hi Lester, Thanks for the pointer to the GMT (grdfft) documentation. An additional standard pre-processing step is detrending (removing the best-fitting linear trend). Regards, Rafael ___ users mailing list users@lists.scilab.org

Re: [Scilab-users] xmltopdf() broken : workaround ?

2018-08-02 Thread Rafael Guerra
: [Scilab-users] xmltopdf() broken : workaround ? Le 02/08/2018 à 15:45, Rafael Guerra a écrit : > Have you tried opening the HTML in MS Word and saving as PDF? The issue is not to convert some independent pages, but to convert a whole tree with its internal links (i mean: links pointing to other memb

Re: [Scilab-users] xmltopdf() broken : workaround ?

2018-08-02 Thread Rafael Guerra
Have you tried opening the HTML in MS Word and saving as PDF? From: users On Behalf Of Samuel Gougeon Sent: Thursday, August 02, 2018 12:49 PM To: International users mailing list for Scilab. Subject: [Scilab-users] xmltopdf() broken : workaround ? Does anyone know an external (free) tool to

Re: [Scilab-users] == and : relative priorities, as in 0==-1:1

2018-07-31 Thread Rafael Guerra
Le 31/07/2018 à 21:51, Samuel Gougeon a écrit : It is somewhat reported here (in 2011..), but i don't understand the conclusion of the report... : "It seems that "he who must not be named" has different priorities on operators."

Re: [Scilab-users] == and : relative priorities, as in 0==-1:1

2018-07-31 Thread Rafael Guerra
Hi Samuel, Parsing p==-1:1 as p==(-1:1) would make Scilab output: ans = F T F consistent with Matlab: ans = 1x3 logical array 0 1 0 And with Octave: ans = 0 1 0 Regards, Rafael From: users On Behalf Of Samuel Gougeon Sent: Tuesday, July 31, 2018 9:52 PM To: International

Re: [Scilab-users] Counter of pointers to an XML object, and clear destructor

2018-07-29 Thread Rafael Guerra
Samuel, Thanks for confirming & bug reports. Regards, Rafael From: users On Behalf Of Samuel Gougeon Sent: Sunday, July 29, 2018 12:34 PM To: Users mailing list for Scilab Subject: Re: [Scilab-users] Counter of pointers to an XML object, and clear destructor Le 28/07/2018 à 22:21, Ra

Re: [Scilab-users] Padding and clipping a grid

2018-07-29 Thread Rafael Guerra
Hi, A more detailed reference is: https://en.wikipedia.org/wiki/Two_dimensional_window_design In the simplest approach, the 2D window is the outer product of two 1D windows: Wxy = wx'*wy For example: nx=100; ny=200; wx = window('hm',nx); wy = window('hm',ny); ix =

Re: [Scilab-users] Padding and clipping a grid

2018-07-29 Thread Rafael Guerra
Hi, A standard practice is to apply tapering then padding (with zeros). Regards, Rafael ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] Counter of pointers to an XML object, and clear destructor

2018-07-28 Thread Rafael Guerra
Regarding the save() function, the output *.sod file fails to be consumed by load() for some graphical handles. Example of error message in Scilab 6.0.1: load: Unable to load 'h'. --> typeof(h) ans = handle --> h h = Handle of type "uicontrol" with properties:

Re: [Scilab-users] FFT - upward continuation of a 2D grid

2018-07-28 Thread Rafael Guerra
One additional remark. Fftshift might have been misused. Try instead: fft_clean=clean(fft2(Boug_corr)); // merge commands k= fftshift(k); Fup=fft_clean.*exp(-k*uc); Regards, Rafael -Original Message- From: users On Behalf Of Rafael Guerra Sent: Saturday, July 28, 2018 2:44 PM

Re: [Scilab-users] FFT - upward continuation of a 2D grid

2018-07-28 Thread Rafael Guerra
Hi Lester, The spatial resolution of 0.016 m seems unrealistically too-finely sampled... Could you confirm the units? Also, it is possible that your upward continuation requires an angular wavenumber: exp(-2*%pi*k*uc) ? Regards, Rafael -Original Message- From: users On Behalf Of

Re: [Scilab-users] FFT - upward continuation of a 2D grid

2018-07-28 Thread Rafael Guerra
You are welcome ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] FFT - upward continuation of a 2D grid

2018-07-26 Thread Rafael Guerra
Hi Lester, If I understood properly, for an even number of spatial input grid points along Nx and Ny, with regular spacing dx and dy, I think k should be computed from: kx = dkx*(-Nx/2+1:Nx/2); ky = dky*(-Ny/2+1:Ny/2); with: dkx = 1/Nx/dx; dky = 1/Ny/dy; Regards, Rafael -Original

Re: [Scilab-users] How to keep figure active with x_mdialog window open?

2018-07-24 Thread Rafael Guerra
Iza, Glad that you solved your problem. In my case, your example works in standalone only (as previous attempts). However, when I place the code in my larger script with loops and a few graphical windows open, it does not work. The output vector 'a' remains empty and a warning is issued: "

Re: [Scilab-users] How to keep figure active with x_mdialog window open?

2018-07-24 Thread Rafael Guerra
Iza, We are close to the solution but not there yet. My head is now flattened of so much banging it against the desk, like the Columbus' egg... Hopefully some experts may return from vacation and post the solution. Regards, Rafael -Original Message- From: users On Behalf Of Izabela

Re: [Scilab-users] How to keep figure active with x_mdialog window open?

2018-07-24 Thread Rafael Guerra
wever both typeof(h0.userdata.hlist.value) and typeof(nh0) are constant ... And I see some hope in this as now, h0.userdata.hlist.value has the correct array of integer values Any clues please? Regards, Rafael -Original Message- From: users On Behalf Of Rafael Guerra Sent: Monday, July 23, 2018 10:42

Re: [Scilab-users] How to keep figure active with x_mdialog window open?

2018-07-23 Thread Rafael Guerra
My apologies, after further testing the last callback code does still not seem to be satisfactory. Banging the head on this Scilab topic... ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] How to keep figure active with x_mdialog window open?

2018-07-23 Thread Rafael Guerra
Hi Izabela and Samuel, I have followed Samuel's awesome offline advice to try using the gcbo() function to retrieve the lost callback handle. The improved code below now seems to work like a charm, regardless of where I place it within a larger Scilab program/loop. // START OF CODE stringmat

Re: [Scilab-users] How to keep figure active with x_mdialog window open?

2018-07-23 Thread Rafael Guerra
Hi Izabela, Following your post and Samuel’s feedback, I have tried the code below to do what you are after. Script seems to work fine if run as standalone. After hitting the pushbutton, the output vector “nn” contains the integers of multiple rows selected. However, when I insert this code in

Re: [Scilab-users] Getting netCDF files into Scilab 6.0.1

2018-07-22 Thread Rafael Guerra
Hi, You can strip the header rows and save a newfile. Then use mfscanf as follows: fid = mopen(newfile); M = zeros(nrows, ncols); for k=1:nrows M(k,:) = mfscanf(ncols,fid,"%f"); end Regards, Rafael ___ users mailing list

Re: [Scilab-users] Settings for page scrolling with mouse wheel

2018-07-22 Thread Rafael Guerra
Hi Lukas, In my Scilab 6.0.1 SciNotes, if setting in Win7 > Mouse Properties > Wheel > Vertical Scrolling = 1 line, I get scrolling steps of about 4 lines. Increasing the Vertical Scrolling to 5 lines, I get jumps of about 20 lines. There might be a unit jump of 4 lines set somewhere in SciNotes,

Re: [Scilab-users] Stability chart

2018-07-22 Thread Rafael Guerra
Hi, This reference may help: http://ijme.us/cd_06/PDF/IT%20301-050.pdf Regards, Rafael ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] Changing polyline properties in param3d1

2018-07-19 Thread Rafael Guerra
Then the following 'if' clause might be preferable, especially if you have many properties to change: if size(X,2)==1 then X = [X X]; Y = [Y Y]; Z = [Z Z]; end param3d1(X,Y,Z); gce().children.polyline_style=4; gce().children.thickness=2; gce().children.foreground=32; etc... Regards,

Re: [Scilab-users] Changing polyline properties in param3d1

2018-07-18 Thread Rafael Guerra
Hello, I do not know the answer. On the other hand, as usually one wants to differentiate the different curves, could you predefine a number of curve properties (ps, th, fr, arrays below) and loop thru each curve? N = size(X,2); for i = 1:N param3d1(X(:,i),Y(:,i),Z(:,i));

Re: [Scilab-users] Matlab to Scilab code query

2018-07-17 Thread Rafael Guerra
(A) returns A. unchanged.” The root problem was that the two vectors below in your script were considered row vectors by Octave and column vectors by Scilab. Regards, Rafael From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of Rafael Guerra Sent: Tuesday, July 17, 2018 4:08 PM To: Users

Re: [Scilab-users] Matlab to Scilab code query

2018-07-17 Thread Rafael Guerra
Hi Lester, Your problem seems to be fixed by defining in Scilab: //sl = fliplr(sl); sl = sl($:-1:1); // Scilab reverse //Wd = fliplr(Wd); Wd = Wd($:-1:1); // Scilab reverse For vectors, the L-R flip should be instead reverse order. Regarding the massive time savings of Scilab 6 vs Octave, I

Re: [Scilab-users] Matrix of strings and grid

2018-07-15 Thread Rafael Guerra
French colors codes (#0050A4, #FF , #EF4135) at: https://en.wikipedia.org/wiki/Flag_of_France#Design And Croacia's ones at: https://en.wikipedia.org/wiki/Flag_of_Croatia#Colours PS : Allez les Bleus! Regards, Rafael ___ users mailing

Re: [Scilab-users] Matrix of strings and grid

2018-07-15 Thread Rafael Guerra
The demo_gui() > GUI > Listboxes, show examples with entire lines with grey or black backgrounds. For other colors just use appropriate html code: https://htmlcolorcodes.com/ Regards, Rafael -Original Message- From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of

Re: [Scilab-users] Matrix of strings and grid

2018-07-14 Thread Rafael Guerra
Hi Samuel, Thanks for this key example, which greatly improves the readability of long output lists. If Scilab provided the same background color functionality for the uicontrol in Table mode (rows, columns or cells), it would be awesome. Regards, Rafael From: users

Re: [Scilab-users] Matrix of strings and grid

2018-07-14 Thread Rafael Guerra
Hi, Have you looked at the table example in "uicontrol" help file? It displays a nice Excel-style table inside a graphic window, with scroll bars. Regards, Rafael ___ users mailing list users@lists.scilab.org

Re: [Scilab-users] 3d pair correlation function PCF

2018-07-07 Thread Rafael Guerra
Hi Heinz, Have you checked following codes (both 2D and 3D cases provided) for particles inside a cubic volume: https://github.com/cfinch/Shocksolution_Examples/blob/master/PairCorrelation/paircorrelation.py It might be possible to adapt that code from a cubic volume to a spherical one. For

Re: [Scilab-users] Passing function argument by reference

2018-07-03 Thread Rafael Guerra
Hi Grzegorz, You could also use same input object as output: function obj=ref_test(obj) obj.a = 10; endfunction o = tlist(["tlisttype", "a", "b"], 0, 0); o = ref_test(o); if o.a == 10 then disp("It works"); else disp("It does not work"); end Not much difference in this simple

Re: [Scilab-users] Passing function argument by reference

2018-07-03 Thread Rafael Guerra
Proszę ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] Passing function argument by reference

2018-07-02 Thread Rafael Guerra
Using global variables instead: global obj; obj = tlist(["tlisttype", "a", "b"], 0, 0); function ref_test(obj) global obj; obj.a = 10; endfunction ref_test(obj); if obj.a == 10 then disp("It works"); else disp("It does not work"); end

Re: [Scilab-users] Passing function argument by reference

2018-07-02 Thread Rafael Guerra
Hi, This seems to be a question of global and local scope of variables. You can try: function o2=ref_test(obj) o2 = obj; o2.a = 10; endfunction o = tlist(["tlisttype", "a", "b"], 0, 0); o2 = ref_test(o); if o2.a == 10 then disp("It works"); else disp("It does not work"); end

Re: [Scilab-users] What can be done with a signed zero -0 ?

2018-06-28 Thread Rafael Guerra
Samuel, Regarding signed zero applications, check this page out: https://www.advanpix.com/2016/04/28/branch-cuts-and-signed-zeros-in-matlab/ Regards, Rafael -Original Message- From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of Samuel Gougeon Sent: Friday, June 29, 2018

Re: [Scilab-users] Voronoi tessellation/ Delaunay triangulation in 3d in Scilab?

2018-06-26 Thread Rafael Guerra
Hi Heinz, For C, you may want to check this: https://www.codeproject.com/Articles/587629/A-Delaunay-triangulation-function-in-C Regards, Rafael -Original Message- From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of Heinz Nabielek Sent: Tuesday, June 26, 2018 8:42 PM To:

Re: [Scilab-users] circshift() : Scilab Enhancement Proposal

2018-06-18 Thread Rafael Guerra
Proposal Hello Rafael, Le 07/06/2018 à 15:04, Rafael Guerra a écrit : Hi Samuel, Fyi, many DFT references recommend averaging the values at endpoints and discontinuities in general. See for instance: Briggs, W. L. and V. E. Henson [1005] The DFT: an owner's manual for the Discrete Fourier

Re: [Scilab-users] Compute normals to 3D surface

2018-06-18 Thread Rafael Guerra
Lester, To just show the vector arrows close to level Z ~ 0, you can define the # of points for each parametric coordinate of the Mobius strip: Nl = 40; // long axis #points Ns = 10; // short axis #points u = linspace(0,2*%pi,Nl); v = linspace(-0.5,0.5,Ns); and then at the end of the code

Re: [Scilab-users] Compute normals to 3D surface

2018-06-17 Thread Rafael Guerra
Hi Lester, Try xarrows(). At the end of your code, add: // Compute normals to surface [x1,y1,z1]=surfnorm(x,y,z); sf = 0.2; // arrows scale factor x1 = sf*x1 + x; y1 = sf*y1 + y; z1 = sf*z1 + z; // Plot normal vectors to surface xarrows([x(:)';x1(:)'],[y(:)';y1(:)'],[z(:)';z1(:)'],-1,2)

Re: [Scilab-users] hist3d() puzzling rendering

2018-06-17 Thread Rafael Guerra
Hi, Preserving the color of the original hidden faces under interactive rotations, does not seem to be a bad idea. It allows assessing what parts of the objects are hidden under the original choice of view angles. The behaviour of plot3d is similar. Regards, Rafael

Re: [Scilab-users] Function "locate" for 3d graphs

2018-06-17 Thread Rafael Guerra
Hi Iza, Not sure if this is what you need but I wrote the following code you can try on: // START OF CODE //From param3d datatips to data vector clear clf param3d() datatipManagerMode(gcf()) // Edit --> Start Datatip manager --> Stop Datatip manager input("ENTER to continue after stopping

Re: [Scilab-users] circshift() : Scilab Enhancement Proposal

2018-06-07 Thread Rafael Guerra
Hi Samuel, Fyi, many DFT references recommend averaging the values at endpoints and discontinuities in general. See for instance: Briggs, W. L. and V. E. Henson [1005] The DFT: an owner's manual for the Discrete Fourier Transform, SIAM, Philadelphia. I think my solution is simple and it

Re: [Scilab-users] circshift() : Scilab Enhancement Proposal

2018-06-06 Thread Rafael Guerra
Noting also that between the endpoints of the DFT periodic input, there is the interval of one sample. From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of Rafael Guerra Sent: Wednesday, June 06, 2018 10:19 PM To: Users mailing list for Scilab Subject: Re: [Scilab-users] circshift

Re: [Scilab-users] circshift() : Scilab Enhancement Proposal

2018-06-06 Thread Rafael Guerra
, and DFT looks more powerful. So, to me, now the question is mainly: with symetrization, versus with damping. Read you soon Samuel Le 02/06/2018 à 15:23, Rafael Guerra a écrit : The previous fractional shift code was still not handling properly the endpoints. Herein an improvement. Fourier

Re: [Scilab-users] Wrapped numeric input files

2018-06-06 Thread Rafael Guerra
Never mind previous question, these files can be read very fast with the function mfscanf(). Regards, Rafael ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

[Scilab-users] Wrapped numeric input files

2018-06-06 Thread Rafael Guerra
Dear Scilab'ers, Has anyone come across wrapped numeric input files, where the data spans over thousands of lines? It takes ages using loops to read data like in example below with 20 input curves with index support from 1 to 4200 spreading over >20,000 lines: 1 12 0 3 2

Re: [Scilab-users] Empty matrix

2018-06-05 Thread Rafael Guerra
Hi Christophe, Quite impressive summary. Fyi, the following reference on empty matrices algebra is extremelly good (and it even refers to de Boor memo and some previous ideas on the subject): Nett, C. N. and W. M. Haddad [1993] "A system-theoretic appropriate realization of the empty matrix

Re: [Scilab-users] [EXTERNAL] Re: submatrix issue

2018-06-03 Thread Rafael Guerra
Paul, Does your input ASCII file have N-lines with 3-values on each row: X1 Y1 Z1 X2 Y2 Z2 ... or instead, does it have one value per row over Nx3 rows: X1 Y1 Z1 X2 Y2 Z2 ... ? Regards, Rafael ___ users mailing list users@lists.scilab.org

Re: [Scilab-users] Fill plot line properties into a list

2018-06-02 Thread Rafael Guerra
Hi Jen, Several of the arguments you would like to use do not seem to be valid GlobalProperty members for plot(). Maybe you could use a function that takes as input a proper graphics handle and your list. Herein a quick and dirty example: //START OF CODE function gce_list(h, list0) n =

Re: [Scilab-users] circshift() : Scilab Enhancement Proposal

2018-06-02 Thread Rafael Guerra
The previous fractional shift code was still not handling properly the endpoints. Herein an improvement. Fourier is still used but the sample laying between end and start points is interpolated. // START OF CODE // Circular fractional shift (R.Guerra, rev1, 02-Jun-2018) function v=cfshift(y,

  1   2   3   4   >