Scilab 2025.0.0

Dear Scilab users,

We are pleased to announce the release of Scilab 2025.0.0 as a joint effort between Scilab contributors and the Numerical Computation team at Dassault Systèmes.

The main new features available to the users are:

Introduction of new language feature: lambda

Lambda functions are functions that can be declared and used at the same time:

t = 0:0.01:%pi;
y = ode(0, 0, t, #(t, y) -> (
    y ^ 2 - y * sin(t) + cos(t)
));

plot(t, y);

For more information: lambda

Complex numbers syntax

To make them easier to write, complex numbers adopt a syntax closer to mathematics and science.

--> 1i - 1j
ans = 

   0. + 0.i
   
--> 3 + 2i
ans = 

   3. + 2.i
   
--> 5 + 0j
ans = 

   5. + 0.i

Graphic functions returns

Plotting functions return created graphic handles

h = xstring(0, 0, "Scilab");
h.font_foreground = color("red");

For more information: plot2d, plot3d, xstring and all others pages about plotting functions.

LaTeX in graphics text

Text in graphics can now mix math formulas and regular text by setting a new interpreter property

h = xstring(0.5, 0.5, "$\frac{x}{y}$ is a fraction");
h.interpreter = "latex";

For more information: math_rendering_features_in_graphic.

Introduction of kmeans function

kmeans is an unsupervised learning method for clustering data points.

fig = scf();
fig.figure_name = "kmeans_demo";
fig.axes_size = [1021,460];
fig.color_map = [77, 175, 74
    55,126,184
    152,78,163
    255,127,0] ./ 255

n = 200;
x1 = rand(n, 2, "normal") + 2 * ones(n, 2);
x2 = rand(n, 2, "normal") - 2 * ones(n, 2);
x3 = rand(n, 2, "normal") * 1.5 + ones(n, 2);
x4 = rand(n, 2, "normal") * -1.5 - ones(n, 2);
x = [x1; x2; x3; x4];

[index, c] = kmeans(x, 3);
subplot(121)
scatter(x(:,1), x(:,2), [], color(255,127,0), "fill")
title("Raw data")

subplot(122)
scatter(x(:,1), x(:,2), [], index, "fill")
scatter(c(:,1), c(:,2), 150, color(228, 26, 28), "fill") // centroid of each cluster
title("3 clusters and centroid")

For more information: kmeans

Add anti-aliasing on plots

Anti-aliasing is now fully functional and activated by default on plots (8x)

For more information: figure properties

For the complete list of changes and fixed bugs, please take a look at CHANGES.

Download this brand new version on Scilab website

Best regards,
Scilab Team

6 Likes

Hello,

The new lambda feature is really great as it avoids to use a list to pass parameters or use an intermediate function to reorder arguments when calling solvers like ode(). For example, this example in the documentation

function ydot=f(t, y, A)
    ydot=A*y;
endfunction
A=[1,1;0,2];
y0=eye(A);
t0=0;
t=1;
y=ode(y0,t0,t,list(f,A))

can be rewritten like this:

A=[1,1;0,2];
y0=eye(A);
t0=0;
t=1;
y=ode(y0,t0,t,#(t,y)->(A*y));

Thanks for this long awaited feature !

S.

2 Likes

Hi all,
thank you for this new version with several new features and enhancements.
anti-aliasing by default set to x8 : I was ignoring the existence of such parameter so I quickly drew previous figures from existing experimental data processing scripts and the rendering is really much better, clearer !
Great, thank you

David

Is there a way to simplify the leastsq command line (below)?
Heinz

function YP=Model(p,xc)
    YP=1-exp(-xc/p)
endfunction
x=0:0.1:30; plot(x,Model(8,x)); xgrid;
M=[   1.     5.     7.    8.     10.    17.    20.
       0.09   0.49   0.6   0.68   0.71   0.89   0.91];
time=M(1,:); value=M(2,:);
function DV=cost(p, xv, yv)
    DV=Model(p,xv)-yv;
endfunction
p0=9;
[fopt,xopt,gopt]=leastsq(list(cost,time',value'),p0);p=xopt // 7.6376945

Hello Heinz,

Sure:

[fopt,p,gopt] = leastsq( #(p)->(Model(p,time')-value') , p0)

S.

1 Like

Great! Thank you! Heinz

Congratulations for the new release!

I’m eager to try it.

How everyone can use xcos?

I tried but always crash when simulate sample files.

I tried to open ATOMS, too crash.

why happend this?

See How to install Scilab 2025 with XCOS in Windows 11? - #2 by vincent.couvert

1 Like

6 posts were split to a new topic: Install stixbox on Scilab 2025.0.0