Re: [Scilab-users] Jordan normal form

2020-08-07 Thread fujimoto2005
Dear Samuel,

I'm sorry that I'm looking for a external program and my reply is late.
Unfortunately, the program does not exist.
It seems due to an unstable numerical result of Jordan normal form.
There is a paper that the jordan function of matlab produces wrong result
for a certain matrix.
Papers on the algorithms have been sometimes published and I read them.

Best regards,
Masahiro Fujimoto



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Jordan normal form

2020-07-26 Thread fujimoto2005
Dear Samuel,

The following sample is from the sample 3 and 5 of wiki "Generalized
eigenvector".
https://en.wikipedia.org/wiki/Generalized_eigenvector#Example_3

A=[[5 0 0 0]',[1 5 0 0]', [-2 2 5 0]', [4 2 3 4]']
X=[[-14 4 -3 1]',[2 0 0 0]',[-2 2 0 0]',[0 0 1 0]']
J=clean(inv(X)*A*X)

J  = 

   4.   0.   0.   0.
   0.   5.   1.   0.
   0.   0.   5.   1.
   0.   0.   0.   5.
 
J is a Jordan form.
   
[JJ,XX]=bdiag(A,1/%eps)
XX  = 

   1.   0.   0.  -14.
   0.   1.   0.   4. 
   0.   0.   1.  -3. 
   0.   0.   0.   1. 

 JJ  = 

   5.   1.  -2.   0.
   0.   5.   2.   0.
   0.   0.   5.   0.
   0.   0.   0.   4.
   
 
 JJ is a block dialog matrix but not a Jordan form,
 
 Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Jordan normal form

2020-07-26 Thread fujimoto2005
Dear Samuel,
Thanks for your reply.

>Have you tried bdiag()?
Yes, I have tried it with rmax=1/%eps.
But result of the sample of help page is not  the Jordan form.

--> a=rand(5,5);[ab,x,bs]=bdiag(a,1/%eps);ab
 ab  = 

   2.5777548   0.  0.  0.  0.   
   0. -0.2247587   0.1379764   0.  0.   
   0. -0.461395   -0.2958436   0.  0.   
   0.  0.  0.  0.1867271   0.   
   0.  0.  0.  0.  0.8245204



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Jordan normal form

2020-07-26 Thread fujimoto2005
Is there any function which finds the jordan normal form and its canonical
basis of n-square matrix A?
Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Spec function

2020-05-22 Thread fujimoto2005
This question is about how to use the spec function to calculate eigenvalues.
Suppose a square matrix D is a function of real number b.
I am trying to find the eigenvalues of D for various b with the spec
function.
When I calculate for b = 1 and 3 simultaneously with the attached code, I
get all eigenvalues for b = 1 are 0.
However, I calculate for b = 1 alone , I get an eigenvalue of -0.5 ± 4.97i
and 0 otherwise.
Why are the results of the two methods different? Is the usage of the spec
function wrong? Which result is correct?

Best regards

testSpec.sce   



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] ”histc”''s bug?

2020-05-20 Thread fujimoto2005
I think "histc" has a some bug.
The following sample code of the help file does't work.

**
data = [1 1 1 2 2 3 4 4 5 5 5 6 6 7 8 8 9 9 9];
N = size(data,"*")   // ==19

// Default binning; "sqrt": sqrt(19) => 4. .. => 4 bins
[h, j, b, i] = histc(data)
[h, j, b, i] = histc(data,10)
h= histc(data,10)
*



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] multiple histograms on one graph

2020-05-20 Thread fujimoto2005
Is there a way to display histograms of multiple data groups in the same
graph? An n × m matrix A which column represents the data of each group. I
want to display the histogram of Aj data on the same graph to see the
difference in frequency between groups.
Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Re : Stopping at the line generating warning

2019-12-02 Thread fujimoto2005
Dear Samuel
I could identify the line causing the problem.
Thak you!



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Stopping at the line generating warning

2019-12-02 Thread fujimoto2005
During a loop, I have the following warning.
"operation +: Warning adding a matrix with the empty matrix will give an
empty matrix result."
The loop continues and eventually fails.
Since I use operation + in many places, it is difficult to find out which
line is the cause of the warning.
Is it possible to stop at the line that generated the warning and display
that line number?

Beat regards,
Masahiro Fujimoto



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Multiplication of hyper-matrix

2019-11-24 Thread fujimoto2005
Is it possible to do the following code without k loop?

A=rand(5,4,10)
B=rand(5,4,10)
C=zeros(4,4,10)
for k=1:10
X=matrix(A(:,:,k),5,4)
Y=matrix(B(:,:,k),5,4)
C(:,:,k)=Y'*X
end

Best regards,
Masahiro Fujimoto




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] row-sum of a hyper-matrix without loop

2019-11-24 Thread fujimoto2005
Dear Samuel

Thanks for your answer.

Best regards,
Masahiro Fujimoto



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] How to fix the round off error of "intg"

2019-11-18 Thread fujimoto2005
Dear Samuel
Thank you for your reply.

Inside the function f(x),I added "disp" to display the value of x and error
flag "ierr" after "intg" line .

The "fsolve" and "numderivative" called f many times for many x around the
correct solution x, and the values of x and ierr were displayed for many
calls.
I couldn't find regularity because ierr = 2 occurs for x very close to x
with ierr = 0. I couldn't find the cause of the rounding error.
I couldn't proceed further since the inside of "intg" could not be
monitored.

However, when "ierr" is output, it turns out that the code did not stop even
if the rounding error occurs. As a result, fsolve could find the correct x.

I adopted this ad-hoc solution. Since the inside of g (x, z) have not been
improved so that rounding errors do not occur reliably, similar problems may
occur in the future, but I decided to satisfy this ad-hoc solution.

Best regards,
Masahiro Fujimoto




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] How to fix the round off error of "intg"

2019-11-17 Thread fujimoto2005
My objective is to find a variable x which set the derivative of the function
f (x) with respect to x to zero.
The function f (x) is the integration of g(x, z) from a to b with respect to
z., that is,
f (x) = ∫g(x, z) dz over  (a, b).
The function g (x, z) is a well-behaved function that has one peak with
respect to z.
I used "intg" to calculate ∫g(x, z)dz.
I used  "numuderivatibe" to calculate f '(x)
I used   "fsoleve" to find x where f '(x) = 0.

When executed it, it stopped with the following warning.

"fsolve: numderivative: Error while evaluating the function: "intg: Error:
Round-off error detected, the requested tolerance (or default) cannot be
achieved. Try using bigger tolerances."

I would like to ask two questions.
1. Can I investigate the cause of rounding error by adding "disp" line in
macros "numderivative" or "intg" in order to monitor the variables?
2. Where can I modify to increase the tolerances of "intg"?

Thank you.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? save the variables except the functions

2019-10-31 Thread fujimoto2005
Dear Antoine,
Thank you for your reply.
I could fix the problem by your idea.

Best regards,
Masahiro Fujimoto



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] strange result of an exponential function integeration

2019-10-04 Thread fujimoto2005
I'm working on a stochastic control problem.
When I calculate an integral of the exponential function, I got strange
results.
I want to integrate densDisutil of the attached file from -∞ to + ∞, but the
correct result is not obtained.
The integrand is an exponential function which exponent part is the sum of
the piecewise linear function and the exponents of the standard normal
density function.
The slope of the linear function changes piecewise for each event
(D_T>=dC),(dC>D_T) & (D_T>=0) and (=0>D_T).
Each event is represented by event_idx=1,2 and 3.
I calculated the integration for each event. This sum should match the
integral of all events(event_idx=4).
The calculation results for each event are 59.865979, 0 and 2.592D + 14
whose sum must match the result for all events.
But the result for all event is 3.112D + 14 which is not equal to the sum of
three events. 
What is wrong?
I would appreciate any advice.


starangeResltsIntg.sce
  



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] statenge result of integration of exponential function

2019-10-04 Thread fujimoto2005
I'm working on a stochastic control problem.
When I calculate an integral of the exponential function, I got strange
results.
I want to integrate densDisutil of the attached file from -∞ to + ∞, but the
correct result is not obtained.
The integrand is an exponential function which exponent part is the sum of
the piecewise linear function and the exponents of the standard normal
density function.
The slope of the linear function changes piecewise for each event
(D_T>=dC),(dC>D_T) & (D_T>=0) and (=0>D_T).
Each event is represented by event_idx=1,2 and 3.
I calculated the integration for each event. This sum should match the
integral of all events(event_idx=4).
The calculation results for each event are 59.865979, 0 and 2.592D + 14
whose sum must match the result for all events.
But starangeResltsIntg.sce
   the
result for all event is 3.112D + 14 which is not equal to the sum of three
events. 
What is wrong?
I would appreciate any advice.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] cotg and acot

2019-10-01 Thread fujimoto2005
Dear Federico,

Even if there is such a rule, I think that it is not useful to follow the
rule mechanically.
For example, the integral function is "intg" in scilab.
If we follow strictly the rules, it becomes "int" which is confused with the
integer (although int is not used as  a keyword in scilab). The "intg" is
easier to understand it means integral.
I think it is a good way from the practical viewpoint not to limit us to
follow three characters rule.

Best regards,
Masahiro Fujimoto



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?=Re: ?=Re: ?=Re: ?==?utf-8?q?

2019-09-23 Thread fujimoto2005
Dear all,

Thanks for a lot of information.

If the documentation contained information on the workable version, it would
be much better for users.
Now the almost documentations have a warning message "Please note that the
recommended version of Scilab is 6.0.2. This page might be outdated. See the
recommended documentation of this function".

Such warning message is very helpful for the special function workable for
only the old version.

By the way is there any parallel computing tool for version 6.0.2?
I am solving the stochastic control problem.
The problem has about 20,000 lattice nodes with 2 dimensions for each time
step, and time steps are 15.
Though calculation on one node is independent each other in each time step,
it uses "optim" and "intg" so that the vectorization of the node is
impossible.
I use loop 300 thousand times.
Any tools of paralell conputing are welcome.

Best regards,

Masahiro Fujimoto



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?= =?utf-8?q? parallel_run

2019-09-23 Thread fujimoto2005
Dear  Antoine

I am using  windows  7.

Best regards 



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] parallel_run

2019-09-23 Thread fujimoto2005
I wanted to use "parallel_run" and tried the sample script in the help page.
But it did not work with the error message "undefined
variable:parallel_run".
Please teach me what is wrong?

The sample script I used is as follows
**
for i = 1:10
  res(i) = i*i;
end;
// for parallel_run, we need to have a function performing the computation
function a=g(arg1)
  a=arg1*arg1
endfunction

res = parallel_run(1:10, g);
// => res = [1  4  9  16  25  36  49  64  81  100];
*





--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] The err value of optim

2019-09-13 Thread fujimoto2005
I used "optim".
I sometimes got err values of "-5", "12" or "13".
The help page only explains err values between 1 and 10.
What does err values "-5", "12" or "13" mean?

Best regards



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] a linear equation

2018-12-02 Thread fujimoto2005
Dear all
I found a solution.
I get the column echelon form of A  by X=rref(A')'.
Then the rows' numbers with the non-zero pivot of X are the independent
rows' numbers of A.

In this problem 26th row and 27th row are redundant.
26th rows are represented by linear combinations of 24th row and 1st-23rd
rows.
27th rows are represented by a linear combination of 25th row and 1st-23rd
rows.

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] a linear equation

2018-12-02 Thread fujimoto2005
Dear Wescot

I know how to approximate A with SVD, but I do not know how to find
independent row vectors of A.
How can I do?

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] a linear equation

2018-12-02 Thread fujimoto2005
Sorry, I was werong with the constraint matrix.

The right values are as follows.

A=zeros(27,27)

A(1,10)=1
A(1,10)=1
A(2,5)=1
A(3,14)=1
A(4,23)=1
A(5,7)=1
A(6,16)=1
A(7,25)=1
A(8,17)=1
A(9,1)=0,A(9,18)=1
A(10,2)=1,A(10,3)=1
A(11,4)=1,A(11,5)=1,A(11,6)=1
A(12,7)=1,A(12,8)=1,A(12,9)=1
A(13,10)=1,A(13,11)=1,A(13,12)=1
A(14,13)=1,A(14,14)=1,A(14,15)=1
A(15,19)=1,A(15,20)=1,A(15,21)=1
A(16,22)=1,A(16,23)=1,A(16,24)=1
A(17,1)=0,A(17,25)=1,A(17,26)=1,A(17,27)=1
A(18,4)=1,A(18,7)=1
A(19,2)=1,A(19,5)=1,A(19,8)=1
A(20,10)=1,A(20,13)=1,A(20,16)=1
A(21,11)=1,A(21,14)=1,A(21,17)=1
A(22,19)=1,A(22,22)=1,A(22,25)=1
A(23,1)=0,A(23,20)=1,A(23,23)=1,A(23,26)=1
A(24,10)=1,A(24,19)=1
A(25,2)=1,A(25,11)=1,A(25,20)=1
A(26,4)=1,A(26,13)=1,A(26,22)=1
A(27,8)=1,A(27,17)=1,A(27,26)=1

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] a linear equation

2018-12-02 Thread fujimoto2005
Hi mottelet.
Thank you for the question.

I'm happy if all possible solutions are available. Since the rank is known
to be 22, the number of solutions is 27Conb22 = 80730 or less, but if the
number is small, I think I can find "basic" constraints that is economically
meaningful.

If it is impossible, if even one solution is found, then it may be possible
to follow a chain from the economic relationship to the basic constraints.

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] a linear equation

2018-12-02 Thread fujimoto2005
This problem is an economic problem. The i-th row of the square constraint
matrix A with m dimension expresses certain economic constraints.
The elements of the constraint matrix are either 0 or 1.
Suppose the rank of A is r and by changing the row number a_1, ..., a_r are
linearly independent. 
I guess the coefficient cj (1 ≤ j ≤ r) in a_i = c1 * a_1 + ... cr * a_r for
any m>=i> r is found to be 0, -1, 1 for some economic reasons.
I would like to find such a_1, ..., a_r pairs.

The following matrix is the constraint matrix which I am dealing with.

A=zeros(27,27)

A(1,10)=1
A(2,5)=1
A(3,14)=1
A(4,23)=1
A(5,9)=1
A(6,18)=1
A(7,27)=1
A(8,17)=1
A(9,1)=0,A(9,18)=1
A(10,2)=1,A(10,3)=1
A(11,4)=1,A(11,5)=1,A(11,6)=1
A(12,7)=1,A(12,8)=1,A(12,9)=1
A(13,10)=1,A(13,11)=1,A(13,12)=1
A(14,13)=1,A(14,14)=1,A(14,15)=1
A(15,19)=1,A(15,20)=1,A(15,21)=1
A(16,22)=1,A(16,23)=1,A(16,24)=1
A(17,1)=0,A(17,25)=1,A(17,26)=1,A(17,27)=1
A(18,4)=1,A(18,7)=1
A(19,2)=1,A(19,5)=1,A(19,8)=1
A(20,10)=1,A(20,13)=1,A(20,16)=1
A(21,11)=1,A(21,14)=1,A(21,17)=1
A(22,19)=1,A(22,22)=1,A(22,25)=1
A(23,1)=0,A(23,20)=1,A(23,23)=1,A(23,26)=1
A(24,4)=1,A(24,7)=1
A(25,2)=1,A(25,5)=1,A(25,8)=1
A(26,10)=1,A(26,13)=1,A(26,16)=1
A(27,20)=1,A(27,23)=1,A(27,26)=1

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] a linear equation

2018-12-02 Thread fujimoto2005
I am trying to solve linear equations with 30 variables. Since the
determinant of the coefficient matrix is 0, I can tell that some row vectors
are linearly dependent on other row vectors. I want to solve the problem by
deleting the linearly dependent rows while simultaneously changing the
variables to exogenous variables.
But I can't find which row vector expresses redundant constraints.  
Is there any way to find out which row is linearly dependent?

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] n dimensional normal distribution

2018-03-26 Thread fujimoto2005
Dear all.
Thank you for your answers.
I am sorry that the reply is delayed.

My original problem is v=∫∫..∫f(X1,X2,..,Xn,Y)n(X1,X2,..,Xn,Y)dX1dX2..dXndY
where n(X1,X2,..,Xn,Y) is a n+1 dimensional normal density function.

This is a problem of a mathematical finance and this integral is usually
calculated by numerical integration using random numbers.
In my problem f() has the following special form.
f(X1,X2,..,Xn,Y)=g(Y)I(x1>=k1)...I(Xn>=Kn) where I() is an indication
function.
In this case, v can be decomposed as v=∫g(Y){∫..∫n(X1,X2,..,Xn
|Y)dX1dX2..dXn}n(Y)dY= ∫g(Y)Prob[(X1>=K1)& ..&(Xn>=Kn)|Y}n(Y)dY where
n(X1,X2,..,Xn |Y) is a normal density conditiona to Y, Prob(..|Y) is a
probability conditional to Y and n(Y) is a one dimensional normal density
function. 
This integration can be calculated firstly when n = 1 since Prob(x1>=K1|Y)
has an analytical approximate function.
When n = 2, it works still fine because Prob[(X1>=K1
>=K2)|Y}=1-Prob[X1<=K1]-Prob[X2<=K2]+Prob[X1<=K1<=K2] and I hear that
Prob[X1<=K1<=K2] have an analytical approximate functions.

I posted the question because I can calculate it first if there is an
analytical approximate function of Prob[(X1>=K1)& ..,(Xn>=Kn)|Y} for large
n.
However, as Samuel demonstrated explicitly and Stéphane implicitly by
referring to R, it seems that there is no choice but to calculate
Prob[(X1>=K1)& ..,(Xn>=Kn)|Y} for large n by using random numbers.
I understand my prospects doesn’t go well because there is no such function
for large n.
When using random numbers, it is the best way to calculate v in the original
form.

Best regards.




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] n dimensional normal distribution

2018-03-19 Thread fujimoto2005
Dear Chan
Thank for your reply.

" the product of the Qs for all your single component. " is a right answer
only when xis are independent.
I am looking for the function when they are not independent.

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] n dimensional normal distribution

2018-03-18 Thread fujimoto2005
Let x1, x2, .., xn be an random variable of n dimensional normal
distribution. Is there any function that gives the probability of {x1> =
k1}&{x2> = k2}&...&{xn> = kn}?



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] mean of elements corresponding element is "true"

2018-03-03 Thread fujimoto2005
Dear Rafael,

Thank you for another excellent solution.

Best regards



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] mean of elements corresponding element is "true"

2018-03-02 Thread fujimoto2005
Dear Samuel

Thank you for your answer.

Best regards



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] mean of elements corresponding element is "true"

2018-03-02 Thread fujimoto2005
In the attached code,"boolean_M" is a random Boolean matrix.
I want to get the average of each column of A whose corresponding element of
boolean_M has "true" as row vector x_V, but it does not work.
Where am I wrong?

Best regards
test_meanWtboolean.sce
  




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] int2d

2018-02-28 Thread fujimoto2005
Hi Samuel

I fixed it as you pointed out and it worked.
There was another mistake. I misunderstood the function len () of another
language as size () and used it.

Was mesh2d internalized? I have not downloaded the Metanet module, but int2d
worked fine.

I have not used the ATOMS yet, but I will try using it little by little.
Are there any guides that wrote the whole picture?

Best regards
test_biv.sce   



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] int2d

2018-02-28 Thread fujimoto2005
In order to calculate the expected value of a certain two-variable function,
I have created a density function of two-dimensional normal distribution.
I created a code like the attached file to check the correctness of the
function, but it does not work.
Where is the code wrong?

I have been confirmed int2D supports list format for a function call.
Furthermore running the code doesn't show "called multNormDensFunc1".
This means it fails to call "multNormDensFunc" function.
 
Best regards.

test_multNorm.sce
  



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] "intg" and i"ntegrate"

2018-02-28 Thread fujimoto2005
Dear Samuel.
Thank for your advice.
I will fill in a wish report on Bugzilla.

Best regards.




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] "intg" and i"ntegrate"

2018-02-22 Thread fujimoto2005
I want to integrate a user function f(x,y1,y2) from a to b with respect to x.

1, I don't see the difference between "integrate" and "intg". I saw help
file and find "integrate" can manage multi upper limits.  Except it, I can't
find any differences between two functions. Is there a difference in the
accuracy or calculation method?
 "intg" has a fixed number of partitions. Does "integrate" increase the
number of partitions automatically until the accuracy is not improved? I do
not understand the difference with the help file.
2, I could use "intg" with "intg (a, b, list (f, y1, y2))", but I could't
use "integrate" with "integrate (list ("f", y1, y2), "x", a, b)" or
"integrate (list (f, y1, y2), "x", a, b)". What is wrong with the syntax?

Best regards



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] More rapid calculation

2018-02-15 Thread fujimoto2005
Dear Mottelet 
Thank you for your useful advice.

1, By changing repmat(timePoints_V,2*sample,1) to
timePoints_M=ones(2*sample,1)*timePoints_V and using it, calculation time is
improved by 25 seconds.

2, "cumsum" is not a bottleneck because it takes only 2 seconds to finish.
Also, if I change cumsum(wY1_M,'c') to linear algebra version
wY1_M*triu(ones(time_step,time_step)), calculation time increases to 2
minutes although CPU usage rate rose greatly. "cumsum" function seems
efficient function.

3, Is there any way to improve random number matrices generation? The
attached file is a snapshot of the task manager when generating random
matrices. It shows the CPU utilization remains low despite using many slots.
What is the cause?
snapshot_of_task_manager2.png
  

4, If I can generate multiple random matrices with smaller row size at the
same time and integrate them at the end, I expect the processing time will
be shorter, but can not  I do such a thing?

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] More rapid calculation

2018-02-14 Thread fujimoto2005
Sorry, my code contains line "exec user file " 
I attached revised version which contains the line as a user function.
Please see it.

Best regards

corSmplebaseZ1andZ2_with_UserFunc.sce

  



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] More rapid calculation

2018-02-14 Thread fujimoto2005
Dear all
Thank you for your replies.

I attached my code and a snapshot of task manager.
The snapshot shows a typical situation.
CPU utilization is usually between 10 and 20%.
There are about 3 times when the CPU utilization instantaneously reaches
from 40% to 50%.
The memory usage does not exceed 20 GB.
Always at least 40 GB is free.

Thank you.

corSmplebaseZ1andZ2.sce
  

snapshot_of_task_manager.png
  




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] More rapid calculation

2018-02-14 Thread fujimoto2005
Dear Mottellet

But there is an explanation "If we use the Intel MKL on Windows, then Scilab
use all the cores available on the processor. "
https://wiki.scilab.org/Documentation/ParallelComputingInScilab

So I expected there are some ways to increase the usage of cpu.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] More rapid calculation

2018-02-14 Thread fujimoto2005
Dear Samuel
Thanks for your reply.

My PC is equipped with 64GB SDRAM.
Isn't it enough?

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] More rapid calculation

2018-02-14 Thread fujimoto2005
I am using 6.00 for windows.
I am doing a simulation using a random number matrix with a huge size. The
size of the random matrix is 10 ^ 4 x 25000.
I am using a PC equipped with 8 cores and 16 threads.
It takes a considerable time to finish the simulation, but CPU utilization
is as low as 10-20%. Is there any way to increase the CPU usage and finish
the calculation sooner?
The loop is not used. I am using matrix functions.
I also considered parallel computing, but it is said that it can not be used
on windows.

Best regards.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Monotone preserving splin

2017-04-22 Thread fujimoto2005
Dear Buruno,

I see the situation.
Suppose the number of the sub-interbal is n-1 ( that is
[x1.x2],[x2,x3],...,[xn-1,xn]).
The number of unknown variables of sub-cubic polynomials is 4n-4.
When "spline_type" is "not_a_knot","clamped"or "periodic" ,we have 4n-4
constraints as follows.
2n-2 for data matching and continuity.
n-2 for the first derivatives and comtinuity at x2,...,xn-1.
n-2 for the second derivatives and continuity at x2,...,xn-1.
2 for the derivative values at near the end points which the above
"spline_type" gives.

When "spline_type" is "monotone", the constaraits are as follows.
2n-2 for data mathing and continuity.
2n-2 for the first deribatives mathing and continuity at xi and xi+1 on
sub-interval(i=1,...,n-1).
These derivatives are calculated by the finite difference method.

Best regards.



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


[Scilab-users] Monotone preserving splin

2017-04-21 Thread fujimoto2005
As for the function "splin", when we set spline_type ="monotone", "splin"
returns the slope values preserving data monotonicity.
These slope values are the adjusted ones of the original slope values to
satisfy some constraints.
In order to get the original slope values, we need additional information on
the derivatives of end points such as "not_a_knot", "clamped" and "natural"
or others.
I would like to know what conditions are used when spline_type ="monotone".

Best regards




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


Re: [Scilab-users] efficient calculation for a moving window

2017-03-27 Thread fujimoto2005
Hi Rafael

Thanks for your explanations.
I understood it.

Best regards.






--
View this message in context: 
http://mailinglists.scilab.org/efficient-calculation-for-a-moving-window-tp4035997p4036032.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] efficient calculation for a moving window

2017-03-26 Thread fujimoto2005
Dear Rafael

Thanks for your answer.
I can’t understand the meaning of 'y(X+Y-1)'.
I geuss the ith row of matrix(y(X+Y-1),n-m+1,m) is y(i:i+m-1) but I don't
see why it.
Please explain it.

Best regards



--
View this message in context: 
http://mailinglists.scilab.org/efficient-calculation-for-a-moving-window-tp4035997p4036021.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Color-bar hides a label for z axes.

2017-03-26 Thread fujimoto2005
I use the long label for z-axe.
So color-bar hides it.
Is is possible to change the position of z-axis from right to left to avoid
color-bar?

Best regards.

hidden_z_lael_by_color_bar.png
  



--
View this message in context: 
http://mailinglists.scilab.org/Color-bar-hides-a-label-for-z-axes-tp4036011.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Lengend for 3d-plot and an horizontal plane at z=0

2017-03-26 Thread fujimoto2005
Dear Rafael

Thank you for your helpful answer.
I can solve the problem.

By the way, is there legend function for 3d-plot?

Best regard



--
View this message in context: 
http://mailinglists.scilab.org/Lengend-for-3d-plot-and-an-horizontal-plane-at-z-0-tp4035999p4036010.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Lengend for 3d-plot and an horizontal plane at z=0

2017-03-25 Thread fujimoto2005
I have 3d-plot with 2 surfaces as an attached file.
I want to improve its appearance.

1, Can I add the legend for each surface as 2d-plot?
Help file tells me 'Legend' is only for 2d-plot and I can't find the same
functionality for 3d-plot.

2,  How can I add a horizontal plane at z=0.
I want to separate whole space and contrast the sub-spaces over and under
z-0 plane.
Though I could add by mesh(mesh_x,mesh_y,zeros(mesh_x)), this plane has the
poor appearance as a separator since I can't set it semi-transparent to be
able to see the under 0 subspace and it does't connect with x-z plane and
y-z plane.

Best regards




--
View this message in context: 
http://mailinglists.scilab.org/Lengend-for-3d-plot-and-an-horizontal-plane-at-z-0-tp4035999.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] efficient calculation for a moving window

2017-03-25 Thread fujimoto2005
Suppose x is a 1*n vector and mhttp://mailinglists.scilab.org/efficient-calculation-for-a-moving-window-tp4035997.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] mixed data type matrix

2017-03-24 Thread fujimoto2005
Dear All
Thanks for your helpful answers.
I could solve the problem.

Best regards.



--
View this message in context: 
http://mailinglists.scilab.org/mixed-data-type-matrix-tp4035956p4035979.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Does scilab 6.0 has day count funciton?

2017-03-12 Thread fujimoto2005
Does scilab 6.0 has day count function such as 30/360, A/360 for bond yield
calculation?



--
View this message in context: 
http://mailinglists.scilab.org/Does-scilab-6-0-has-day-count-funciton-tp4035793.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Bessel cubic spline

2017-02-26 Thread fujimoto2005
Is there a function of Bessel cubic spline?
I mean Besse cubic spline as follows.
1,pieacewise 3 degree polynomial on the each interval [x(i),x(i+1)] for
i=1,2,..,n-1
2,f(x(i))=y(i) for 1=1,2,..,n
3,continuous at all xi for i=2,...,n-1
4,differnciable at all xi for i=2,...,n-1
5,f''(xi) for i=2,...,n-1 is same as the slope of a quadratic function which
pass 3 points (x(i-1),y(i-1)) (x(i),y(i)),(x(i+1),y(i+1))
5,f''(x(1))is same as the slope of a quadratic function which pass 3 points
(x(1),y(1)) (x(2),y(2)),(x(3),y(3))
5,f''(x(n))is same as the slope of a quadratic function which pass 3 points
(x(n-2),y(n-2)) (x(n-1),y(n-1)),(x(n),y(n))

Best regards



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


Re: [Scilab-users] getting the first column of function

2016-11-11 Thread fujimoto2005
Hi Samuel

Thanks for your help.
I can get a more clean code by your solution.

Best regards.

M.F.



--
View this message in context: 
http://mailinglists.scilab.org/getting-the-first-column-of-function-tp4034849p4034966.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] ">" operation error in a some case

2016-10-26 Thread fujimoto2005
I am using  the scilab 6.0 beta 2.
Please load the attached file 'val.dat' which contains two variable x and y.
Operation 'x>y' returns the error message 'Undefined operation for the given
operands.
check or define function %s_2_s for overloading.' 
I don't know what is the cause and want to fix this error.
I got actual values of x and y in a bisect code to find the solution of some
equation and I can't go forward by this error.
Please teach me how to fix it.
Best regards.





--
View this message in context: 
http://mailinglists.scilab.org/operation-error-in-a-some-case-tp4034864.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] the name of a script

2016-03-19 Thread fujimoto2005
Hi,all

I executed the script with the execute command of the scinote so it failed.
I want to use the execute command of the scinote.

I tried
[units,typs,nams]=file().

But nams are as follows

stderr  
!
!   
 
!
!C:\***\gettingScriptName02.sce  !
!   
 
!
!stdin  
 
!
!   
 
!
!stdout 
 
!
 
My target is not nams($) but nams($-2) .
 I am not sure the number of element is always $-2.

Le me explain why I want to get the script name in the script itself.
The script makes a folder where many graphs made by the script ares saved.
The folder name is 'scritname'+'executiontime' as like
'gettingScripName01_2016_03_16_2300.
I use such folder name in order to distinguish easily which build number
script made those graphs.
I can use  the script name as the constant variable but I want to avoid such
method since I forget to change the constant value when I revise the build
number.

'get_absolute_file_path(scriptName)' is not a solution since it assume the
script knows own name which script want to know.

Best regards




--
View this message in context: 
http://mailinglists.scilab.org/the-name-of-a-script-tp4033744p4033757.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] the name of a script

2016-03-16 Thread fujimoto2005
Hi,JLAN

Thanks for your reply.

Your code return only 
"// -- 16/03/2016 18:04:51 -- //"
as a.

I  execute the script containing the following lines with the script name
''gettingSscriptName.sce'

clear;
a=gethistory();
b=strsplit(a($), [filesep();]);
disp(b($-1));

The console window shows
--> ecec('gettingSscriptName.sce')

How to fix this?

Best regards





--
View this message in context: 
http://mailinglists.scilab.org/the-name-of-a-script-tp4033744p4033747.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] the name of a script

2016-03-16 Thread fujimoto2005
Hi, all
Is there any ways to get the name of script when I am executing it ?
I want to write a code to get the name of the script containing that code.
For example , suppose I execute a script named with 'abc.sce'  and I want to
have a line which get the script name 'abc.sce' .

Best regards




--
View this message in context: 
http://mailinglists.scilab.org/the-name-of-a-script-tp4033744.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] 'fsolver'

2016-01-28 Thread fujimoto2005
Hi, motterlet and Steer

Thanks a lot your helps.

Unfortunately 'lsqrsolve' did't give the smallest initial point for my
function.
The local minimum of f^2+a*x^2 is attained at x s.t. f(x)=-a*x.
So if a is small such x is a neighborhood of x s.t. f(x)=0.
But it is not necessarily of x which is the smallest one.
Probably my function is not well-behaved as like cos(x) so that it fail.

Now I get an awkward method.
I find the first x(i) s.t. f(x(i))>0 and f(x(i-1))<0 where x(i)=x0+i*dx and
x0 is some constant which is smaller than smallest solution of f(x)=0.
Then I modify f(x) to new function fnew(x) as
f(x)=f(x(i-1))+[f(x(i))-f(x(i-1))]/[x(i)-x(i-1)]*[x-x(i)] for x>=x(i) and
fnew(x)=f(x) for x<=x(i).
Using fsolv(x(i-1),fnew) gives the smallest solution of f(x)=0.
With your helps I could get a practical solution.
Thanks again.

Best regards.




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


Re: [Scilab-users] 'fsolver'

2016-01-27 Thread fujimoto2005
The feature of my f(x) defined for x>0 is as follows.
f(x)<0 for x0 for x1=x2

'fsolver' gives some x such as x>x2 as a solution.
I want to get x1 as a solution. 




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


Re: [Scilab-users] 'fsolver'

2016-01-27 Thread fujimoto2005
Hi, Christophe

I give a very small value as an initial point because it is known as the
character of my actual problem that this small value is necessarily smaller
than the smallest solution.
But 'fsolver' gives the largest solution which is most apart from the
initial point.

Best regards.

 



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


Re: [Scilab-users] optim

2016-01-27 Thread fujimoto2005
Hi,mottelet 

Now I understand I don't need to provide the value of 'Ind '.
As explained in the help page, 'the ind input argument is a message sent
from the solver to the cost function ' .

Also I understand  I have to provide the gradient explicitly even if I don't
need its value.
Unless an user does't  provide the gradient explicitly, the solver must
estimate it numerically even if there is an analytical form of the gradient. 
In general numerical estimation  is time-consuming compared with the  the
analytical form.
So solver asks a user to provide the gradient explicitly  to avoid
time-consuming estimation.
  
Best regards



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


[Scilab-users] 'fsolver'

2016-01-27 Thread fujimoto2005
if f(x)=0 has multiple solutions and I want to get the  smallest solution, is
there any way to get a such solution by 'fsolver'?
In my actual problem, 'fsolver' give the largest solution.

Best regards



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


Re: [Scilab-users] optim

2016-01-25 Thread fujimoto2005
Hi,mottelet

Thanks a lot for your solution.

Actually I don't need the gradient .
In that case may I provide only f?
Or is g indispensable?
In 'Description' of 'optim' help page, there is a explanation 'If ind=2,
costf must provide f.'  
https://help.scilab.org/docs/5.3.3/en_US/optim.html
It seem to mean when I input ind=2 optim can work without the gradient by
user.
If so, how do I input ind=2?
Best regards.




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


[Scilab-users] optim

2016-01-25 Thread fujimoto2005
I'm useing scilab 6.0.
I want to use 'optim' function .
But it fail to work in my code with an error message 'costfunction: Wrong
number of input argument(s): 3 expected.'
The following code is the simple code for the demonstration of the problem.
Though para1 and para2 don't influence on value of f, I introduce them to
keep the structure of arguments.
I can't see the cause of error.
Please teach me the cause and how to fix it.

Best regards

**
function f=costfunction(x,ind,para1,para2)
f=x(1)^2+x(2)^2;
endfunction

x0=[100,100];
para1=[1,2];
para2=[2,3];
costf=list(costfunction,para1,para2)
[fopt,xopt]=optim(costf,x0)

**




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


[Scilab-users] Conditional random variable

2016-01-23 Thread fujimoto2005
Is there any function generating random variable X with a standard normal
density conditional on a range (a,b] where 0

[Scilab-users] extracting elements of a matrix

2016-01-23 Thread fujimoto2005
Let X be a m×n matrix and f(i) is a column index for the ith row.
I want to get a m×1 vector y where y(i)=X(i,f(i)) for 1<=i<=m.
Is there any method to get y other than  the following code?
for i=1:m
y(i)=X(i,f(i));
end

Best regards




--
View this message in context: 
http://mailinglists.scilab.org/extracting-elements-of-a-matrix-tp4033321.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] unable to set style for histplot

2015-12-18 Thread fujimoto2005
DearSerge Steer.

Thanks for your reply.
Actually I am using solely scilab 6.0 for analytical purpose  and unable to
back scilab 5.2.
I think this is the bug of scilab 6.0 and  I will report Buzila.

Best regards. 
 



--
View this message in context: 
http://mailinglists.scilab.org/unable-to-set-style-for-histplot-tp4033225p4033233.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] unable to set style for histplot

2015-12-14 Thread fujimoto2005
I use scilab 6.0.0 alpha 2.

The following script is the sample code of the help file on 'histplot'.
But it  can't set the style as the help page.
The result is the default style.
Is this the bug or is there any ways to work rightly?
Best ragrds.
 

d = grand(1000,1,"bin", 6, 0.5);

c = linspace(-0.5,6.5,8);

clf()

subplot(2,1,1)

histplot(c, d, style=2)

xtitle("normalized histogram")

subplot(2,1,2)

histplot(c, d, normalization=%f, style=5)

xtitle("non normalized histogram")
***




--
View this message in context: 
http://mailinglists.scilab.org/unable-to-set-style-for-histplot-tp4033225.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] getting the first column number of each row

2015-11-30 Thread fujimoto2005
Hi,Angel and JA
I can get the solutions.

Thanks a lot for your helps.

Best regards.



--
View this message in context: 
http://mailinglists.scilab.org/getting-the-first-column-number-of-each-row-tp4033132p4033136.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] getting the first column number of each row

2015-11-29 Thread fujimoto2005
I want to get the first column number of each row with %T.
Now I use loop as follows.

x=rand(10,10);
for i=1 :10
y(i)=min(find(x(i,:)>0.5);
end

Is there any way to get  y without using 'for end' loop because it will take
a time when row number is large .

Best regards.




--
View this message in context: 
http://mailinglists.scilab.org/getting-the-first-column-number-of-each-row-tp4033132.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] long legend

2015-11-14 Thread fujimoto2005
Hello Rafael Guera 

This is a great solution!!
Thanks a lot.

Best regards



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


[Scilab-users] long legend

2015-11-13 Thread fujimoto2005
When the strings of the legend is too long, is it possible to display in 2
lines by legend(stringPart1+'a line feed code'+stringPart2)?



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


[Scilab-users] link-pasting into MS Word documnets

2015-11-05 Thread fujimoto2005
Is there any ways to paste the scilab graphic  into MS word documents linked
with the source file such as scg files or eps files?
I want the diagram embedded in the word documents to reflect the change of
the original source files.

Best regards



--
View this message in context: 
http://mailinglists.scilab.org/link-pasting-into-MS-Word-documnets-tp4033075.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Shrinkage of hyper-matrix happen again

2015-10-27 Thread fujimoto2005
I heard the shrinkage problem of the hyper-matrix with the last dimension of
1 element in scilab 5.5.2 has been fixed in scilab 6.
I confirmed the first version of scilab 6 has fixed it.

But it seems to re-happen in the nightly build scilab-master-1445614374
(64-bit).

Please try the following script.

x=zeros(2,3,1,3);
y=zeros(2,3,1);
size(x)
size(y)

I want to get size(y) to be 2,3,1.
But it returns 2,3.
Is it my misunderstanding?



--
View this message in context: 
http://mailinglists.scilab.org/Shrinkage-of-hyper-matrix-happen-again-tp4033046.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] "msprintf" in the NIghty build of Scilab 6.0 fails

2015-10-25 Thread fujimoto2005
"msprintf" in scilab-master-1445614374 (64-bit) fails for vector input.
Please try the following script.

x=[1:10]/100
msprintf("%.1f%%\n",x*100)

"Scilab 6.0 master" succeeded to generate vector outputs.
But  1445614374 failed.
It generate only the first output "1.0%".
How can I genarate vector output?

Best regards



--
View this message in context: 
http://mailinglists.scilab.org/msprintf-in-the-NIghty-build-of-Scilab-6-0-fails-tp4033036.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Change display x axis as %

2015-09-19 Thread fujimoto2005
Hello,
First please load the attached data file 'test.dat'.
Then run the below script.
In the script, x has values from 0.091 to 0.15.
I want to set % expression.
Before 'pause', the graph display x ticks with the values from 0.091 to 0.15
rightly.
But after 'resume' command to continue the run, 0.15(15%) disappear.
I want to keep 15%.
Please teach me how to do.
test.dat   
Best regards.

*
X_V=[min(x),max(x)];
scf
plot2d(x,y',[color('green'),color('blue'),color('red')]);
ax=get('current_axes');
ax.data_bounds(:,1)=[X_V]';
ax.tight_limits='on';

pause
//set x %
xt=ax.x_ticks;
for i=1:size(xt.locations,1)
xtLabels_V(i)=msprintf('%.'+string(0)+'f%%\n',xt.locations(i)*100)
end
xt.labels=xtLabels_V
ax.x_ticks=xt;




--
View this message in context: 
http://mailinglists.scilab.org/Change-display-x-axis-as-tp4032877.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] get the intersect x and y

2015-09-19 Thread fujimoto2005
I want to get the indices of vector x which satisfied x==y(j) for some j
where x and y are row vectors.
I am using
z=[]
for i=1 :size(y,2)
z=[z,find(x==y(j))
end
If there is a simpler code which use find method please teach me.

Best regards.
Fujimoto



--
View this message in context: 
http://mailinglists.scilab.org/get-the-intersect-x-and-y-tp4032870.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] get the intersect x and y

2015-09-19 Thread fujimoto2005
Hello

Thanks a lot.

Best regrds
Fujimoto



--
View this message in context: 
http://mailinglists.scilab.org/Re-get-the-intersect-x-and-y-tp4032872p4032876.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] get the intersect x and y

2015-09-19 Thread fujimoto2005
Hello Samuel

Thnks a lot.

This is  exactry what I want.

Is there any function f(a,b) which return ka where
[x,ka,kb]=intersect(a,b).
I want to get only ka.

Best regards
Fujimoto 



--
View this message in context: 
http://mailinglists.scilab.org/Re-get-the-intersect-x-and-y-tp4032872p4032873.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] sometime fail to save a file

2015-09-17 Thread fujimoto2005
please try this script

for i=1 :100
   y=i^3
   save('test.dat','y')
end



--
View this message in context: 
http://mailinglists.scilab.org/sometime-fail-to-save-a-file-tp4032831p4032853.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] sometime fail to save a file

2015-09-17 Thread fujimoto2005
Hello,all

Both solutions are fine!!

The reason why I want to save every time, I want to keep the result.
Renewal of y's value depends on the other condition and when renewal process
is skipped the same file is accessed rapidly.
(Actually this phenomena began to happen after I replace my old PC with more
fast and multi-core PC)  
Any way I understand the cause of the error, so I modify the script into
saving once in 10 renewal or sleep(100) whenever renewal is skipped.

Best regards.




--
View this message in context: 
http://mailinglists.scilab.org/sometime-fail-to-save-a-file-tp4032831p4032861.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] sometime fail to save a file

2015-09-16 Thread fujimoto2005
Hello,

I am sure there is no error in the script because selecting that line to
execute works with no error just after error happened in the run of whole
script.
Actually I load a same file, renew value of y and before save the file.
So the error  might be due to loading and saving a same file in very short
time.
I don't know the internal structure of scilab.
If some one can think possible cause of the error, please suggest some
solution.

Best regards.  



--
View this message in context: 
http://mailinglists.scilab.org/sometime-fail-to-save-a-file-tp4032831p4032846.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] sometime fail to save a file

2015-09-16 Thread fujimoto2005
Hello, 

I am sure there is no error in the script because selecting that line to
execute works with no error just after error happened in the run of whole
script. 
Actually I load a same file, renew value of y and  save the file with
renewed value. 
So the error  might be due to loading and saving a same file in very short
time. 
I don't know the internal structure of scilab. 
If some one can think possible cause of the error, please suggest some
solution. 

Best regards.  



--
View this message in context: 
http://mailinglists.scilab.org/sometime-fail-to-save-a-file-tp4032831p4032847.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] sometime fail to save a file

2015-09-15 Thread fujimoto2005
In below script,,It sometime fail to execute the line 'save(fileName,y)' 
with the error message 'save can not open fileName' where fileName is the
specific name depending i.

But after stop, I can execute that line by selecting it and executing with
echo  .
The value of i which makes error changes.
So I can't run whole process.
Is there any advise to fix this problem

Best regards.

**
for i=1:20
y=f(i)//in actual script this line is more complicated
fileName='valuey_'+strimg(i)+'.dat'
save(fileName,'y')
end 



--
View this message in context: 
http://mailinglists.scilab.org/sometime-fail-to-save-a-file-tp4032831.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Strange behavior of interpln function

2015-09-15 Thread fujimoto2005
Hello,

Thanks for your advice.
I can fix the problem.

Best regards.
Fujmoto




--
View this message in context: 
http://mailinglists.scilab.org/Strange-behavior-of-interpln-function-tp4032824p4032827.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Strange behavior of interpln function

2015-09-14 Thread fujimoto2005
I expect to get the value of yy  less than 0.01 which is the most left value
of x.
But actually I get  0.0591.

When I adopt only the first 3 elements of x and y,it works rightly.
I get 0.0100075 of yy2.

Please tell me where I was wrong in the first script.

Best regards

**
x1=[-1604,-23982,-31978,-38883,-45638,-52660,-59782,-60536,-67648,-75176,-82997,-92066,-101438,-110067,-119852,-130754,-142046,-153749,-165495]
y1=[0.01,0.04,0.05,0.06,0.07,0.08,0.09,0.091,0.1,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.2]
yy1=interpln([x1;y1],0)

x2=[-1604,-23982,-31978]
y2=[0.01,0.04,0.05]
yy2=interpln([x2;y2],0)



--
View this message in context: 
http://mailinglists.scilab.org/Strange-behavior-of-interpln-function-tp4032824.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] scilab6 and interrupt

2015-09-13 Thread fujimoto2005
scilab6 does't accept interrupt command.
Is this bug or not providing that command as alpha stage?



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


[Scilab-users] linearly spaced vector

2015-09-06 Thread fujimoto2005
I expected the following script to generate linearly spaced vectors x1,x2 and
x3 with step 0.01.
But x1(3),x2(2) and x3(15) are slightly different values from expected
values.
This phenomena happens with both Scila5.5.2 and Scilab 6.0.0 alpha.
Is there any ways to get exactly expected values?


min=0.04;
low=0.098;
high=0.2;
x1=[ceil(low*100)/100:0.01:floor(high*100)/100]
disp(x1(3)-0.12);
x2=[floor(low*100)/100:0.01:high]
disp(x2(2)-0.1);
x3=[floor(min*100)/100:0.01:high]
disp(x3(15)-0.18);
**
Best regards



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


Re: [Scilab-users] scipad

2015-09-05 Thread fujimoto2005
A downloaded from the download button in the page you suggested in the first
reply.
Actulally it was the package for Scicoslab as you said.
I downloaded the right one from the 'files tag'  and I succeeded to install
it.
Thanks a lot.

But I have another problem.
The corruption of text happens as the attached image.
I use the Japanese language and of course choose options-locale- 'japan'.

Is there any way to fix it?

Best regards





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


Re: [Scilab-users] scipad

2015-09-05 Thread fujimoto2005
Sorry I failed to attach.
I posted the screen shot in the next posting.

Best regards



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


Re: [Scilab-users] scipad

2015-09-05 Thread fujimoto2005
Which do you refer to the posting with time stamp 'Sep 05, 2015; 4:55pm' or
'4:44'?

Fujimoto



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


Re: [Scilab-users] scipad

2015-09-05 Thread fujimoto2005
 



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


Re: [Scilab-users] scipad

2015-09-05 Thread fujimoto2005
Hi,François

The problem is fixed.
The file encoding 'cp932' was chosen and after utf-8 is chosen it display
rightly.

Thanks a lot for your help.

Best regards

Fujimoto



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


Re: [Scilab-users] scipad

2015-09-05 Thread fujimoto2005
The left one of the above image is the display of same script with Scinote
and the ridht one is that with Scipad.
I am not sure non-Japanse can see the difference.
Left one display Japanese rightly but Right one doesn't.

Menu items are Japanese.
Maybe the cause of error is due to  bad choice of an encoding type.
Scinote has the menu item 'option-file encoding' which choose unicode utf-8.
Is there a corresponding item in Scipad?

Best regards

Fujimoto



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


Re: [Scilab-users] scipad

2015-09-05 Thread fujimoto2005
 



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


[Scilab-users] find function failure in scilab6

2015-09-01 Thread fujimoto2005
Dear all.
Save the attached file in current diorectry and run the following script.
**
load('test.dat');
disp(x);//x contains 0.1 as the 3rd elemnt.
disp(y);//y is 0.1
z=find(x==y);
disp(z)//failure because z returns [] instead 3.


Since x contains y as the 3rd element ,
find(x==y) should return 3.
But it returns [].
Is there any error in my script or is this just a bug of scilab6?

Best regards.

filure_of_find_function.sce
  



--
View this message in context: 
http://mailinglists.scilab.org/find-function-failure-in-scilab6-tp4032767.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] find function failure in scilab6

2015-09-01 Thread fujimoto2005
Hello Serge Steer 

As you suggested, x(3)-y = - 1.388D-17.
I must improve to genarate values of x.
Thanks a lot.

Best regards.




--
View this message in context: 
http://mailinglists.scilab.org/find-function-failure-in-scilab6-tp4032767p4032769.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] save all variables

2015-08-25 Thread fujimoto2005
Hi,Serge Steer
save('testall.data','all')  does not work.
It reply an error message The second argument is wrong.

Best regards




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


  1   2   >