Re: [Scilab-users] Generate 5 unique random integer number between 1 and 10

2014-06-10 Thread TAN TH
yes, I got it already, thanks a lot. On Wednesday, 11 June 2014, 14:42, Paul Bignier wrote: Hello, How about taking the five first elements of a permutation of vector 1:10 ? Random_10 = grand(1, "prm", 1:10); Random_5  = Random_10(1:5) http://help.scilab.org/docs/5.5.0/en_US/grand.ht

Re: [Scilab-users] Generate 5 unique random integer number between 1 and 10

2014-06-10 Thread Paul Bignier
Hello, How about taking the five first elements of a permutation of vector 1:10 ? Random_10 = grand(1, "prm", 1:10); Random_5 = Random_10(1:5) http://help.scilab.org/docs/5.5.0/en_US/grand.html Regards, Paul On 06/11/2014 05:34 AM, tanthiamhuat wrote: how do I generate 5 UNIQUE, DISTINCT

Re: [Scilab-users] Using Scilab Genetic Algorithm to solve Simple Card Problem

2014-06-10 Thread tanthiamhuat
managed to write a objective function for this GA problem. How do I get the final solution for Card_Stack1 and Card_Stack2? which variables are they stored in? clear;clc;clf //function y=f(x) // y = sum(x.^2) //endfunction function out = objectivefunction(AllCards) AllCards = 1:1:10; Rand

[Scilab-users] Generate 5 unique random integer number between 1 and 10

2014-06-10 Thread tanthiamhuat
how do I generate 5 UNIQUE, DISTINCT random integer between 1 and 10? I try this, but it is not unique. Random_5=round(rand(1,5)*9)+1 -- View this message in context: http://mailinglists.scilab.org/Generate-5-unique-random-integer-number-between-1-and-10-tp4030712.html Sent from the Scilab us

Re: [Scilab-users] interp implementation

2014-06-10 Thread Luis Rodrigues
Thanks Antoine, I've also found this: http://doxygen.scilab.org/master/d1/d31/someinterp_8c.html Do you know what is the relation? Or which one is actually used? Best, Luis On 10 June 2014 16:06, Antoine Monmayrant wrote: > On 06/10/2014 04:57 PM, Luis Rodrigues wrote: > > Hi all, > > I'

Re: [Scilab-users] interp implementation

2014-06-10 Thread Antoine Monmayrant
On 06/10/2014 04:57 PM, Luis Rodrigues wrote: Hi all, I'm using a cubic spline to calibrate a sensor, the code in scilab is as follows. n=10; x=linspace(min(dists(:,1)), max(dists(:,1)), n); [y, d] = lsq_splin(dists(:,1), dists(:,2), x); ys = interp(dists(:,1), x, y, d,'natural'); I would l

[Scilab-users] interp implementation

2014-06-10 Thread Luis Rodrigues
Hi all, I'm using a cubic spline to calibrate a sensor, the code in scilab is as follows. n=10; x=linspace(min(dists(:,1)), max(dists(:,1)), n); [y, d] = lsq_splin(dists(:,1), dists(:,2), x); ys = interp(dists(:,1), x, y, d,'natural'); I would like to store x, y, d in an eeprom and calculate th