Federico,

I appreciate the help. Below is a list of the code on which I try to plot
the data with Isq_splin:

c = size (vt12)
a = 0
b = c (1) // c (1) = 16
n = c (1)
x = linspace (a, b, n)
[y, d] = lsq_splin (vt12, vv12, x ')
plot (y, d, 'r')
xlabel ('Speed (rpm)')
ylabel ('Torque (Nm)')
title ('Torque x speed values')

//vt12 = 5350.3 5380.19 5410.08 5439.96 4149.5 4179.35 3756.57 3602.73
3568.12 3597.85 3681.91 3711.59 6143.24 6172.86 6202.49 6232.1
//vv12 = 40.16   39.93   39.71   39.49   69.04   68.54   95.32   119.26
140.49   139.32   155.62   154.37   93.27   92.82   92.38   91.94

but I'm getting the error: lsq_plin: There are not enough points to adjust.

Does anyone understand what could be wrong?

On Wed, Apr 8, 2020 at 12:54 AM Federico Miyara <[email protected]>
wrote:

>
> Daniel,
>
> You may try with lsq_spline, which unlike ordinary spline, doesn't fit the
> data exactly, and it doesn't need the data with any particular order.
>
> But trying to understand your graph, it seems that you should parametrize
> two variables independently, each one with respect to the index. Something
> like this:
>
> x = [x1, x2, ..., xn]
> y = [y1, y2, ..., yn]
>
> Then you approximate x vs 1:n and y vs 1:n using spline or lsq_splin.
> Finally you plot xs vs ys (the smoothed versions of x and y)
>
> Regards,
>
> Federico Miyara
>
>
> On 07/04/2020 22:48, Daniel Stringari wrote:
>
> Good night friends,
> I wrote an email before, but I believe that I was not clear in my words and
> so I will write more clearly.
>
> In this annex 1, I have the graph I am generating. Basically I am extracting
> values of x (speed) and y (torque) from excel and generating vectors of x []
> and y [] to plot internal lines. I want to smooth these lines, but the
> functions of the scilab are only for growing points. I thought about
> creating cubic splines manually, but I don't know how to do it. Can anybody
> help me ?
>
> In addition, I would like to color my chart with level colors according to
> the colorbar, but I am not able to implement contour2d for this case.
>
> thanks.
> <http://mailinglists.scilab.org/file/t498028/annex_1.png> 
> <http://mailinglists.scilab.org/file/t498028/annex_1.png>
>
>
>
> --
> Sent from: 
> http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
> _______________________________________________
> users mailing 
> [email protected]http://lists.scilab.org/mailman/listinfo/users
>
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.scilab.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to