Re: [Scilab-users] Loop query - Scilab 5.5.2

2016-01-18 Thread Lester Anderson
Thanks for the solution(s). Had to change the flex line to get it
working in 5.5.2:

flex = 2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x);

Otherwise it gave an error of undefined variable (flex). The three
column array did not work; looking it to that one.

checked

x=linspace(0,200,41); is a row vector

//test
dist=linspace(0,200,41);
x(:,1)=dist'
// convert to column vector)


On 18 January 2016 at 13:48, Serge Steer  wrote:
> The plot instruction should be inside de loop
>
> k=0;
> st=["r","g","b"];
> for Te = 5000:1:25000 // start: step: end
> k=k+1
> D = E*Te .^3/(12*(1-v^2));
> lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
> lamda_k = lamda*1000;
> flex =
> [flex,2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x)];
> plot(x,flex,st(k))
>  end
>
>
>
> or you may build a three column array . in the script below I assume x is a
> column vector
>
> flex=[];
> for Te = 5000:1:25000 // start: step: end
> D = E*Te .^3/(12*(1-v^2));
> lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
> lamda_k = lamda*1000;
> flex =
> [flex,2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x)];
>  end
> plot(x,flex)
>
>
>
> Le 18/01/2016 11:50, Lester Anderson a écrit :
>>
>> Thanks for that pointer.
>>
>> The plot works but only does Te=25 in this case
>>
>> for Te = 5000:1:25000 // start: step: end
>>  D = E*Te .^3/(12*(1-v^2));
>>  lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
>>  lamda_k = lamda*1000;
>>  flex =
>> 2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x);
>> end
>> plot(x,flex)
>>
>> Can't get it to loop and plot the other values
>>
>>
>> On 18 January 2016 at 10:38,   wrote:
>>>
>>> Hello,
>>>
>>>
 for Te = 5000:25000:1 // start:end:step to make 5000, 15000, 25000
>>>
>>> The syntax is start:step:end, not start:end:step
>>>
>>> https://help.scilab.org/docs/5.5.2/en_US/colon.html
>>>
>>> Samuel Gougeon
>>> ___
>>> users mailing list
>>> users@lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>>
>> ___
>> users mailing list
>> users@lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>>
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Loop query - Scilab 5.5.2

2016-01-18 Thread Serge Steer

The plot instruction should be inside de loop

k=0;
st=["r","g","b"];
for Te = 5000:1:25000 // start: step: end
k=k+1
D = E*Te .^3/(12*(1-v^2));
lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
lamda_k = lamda*1000;
flex = 
[flex,2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x)];
plot(x,flex,st(k))
 end



or you may build a three column array . in the script below I assume x 
is a column vector


flex=[];
for Te = 5000:1:25000 // start: step: end
D = E*Te .^3/(12*(1-v^2));
lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
lamda_k = lamda*1000;
flex = 
[flex,2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x)];
 end
plot(x,flex)


Le 18/01/2016 11:50, Lester Anderson a écrit :

Thanks for that pointer.

The plot works but only does Te=25 in this case

for Te = 5000:1:25000 // start: step: end
 D = E*Te .^3/(12*(1-v^2));
 lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
 lamda_k = lamda*1000;
 flex = 2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x);
end
plot(x,flex)

Can't get it to loop and plot the other values


On 18 January 2016 at 10:38,   wrote:

Hello,



for Te = 5000:25000:1 // start:end:step to make 5000, 15000, 25000

The syntax is start:step:end, not start:end:step

https://help.scilab.org/docs/5.5.2/en_US/colon.html

Samuel Gougeon
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plot versus date

2016-01-18 Thread Serge Steer

Le 18/01/2016 09:15, jbaud...@insa-rennes.fr a écrit :

Hi,

Le 18/01/2016 09:00, anna78 a écrit :

Hi all,
I'm beginner of SCILAB.

I have the file here after reported, made of 5 columns.
I would like to plot column 4 versus column 1, column 1 being a date 
in the

yymmdd format.
Is there any way to make SCILAB understand the x-axis is a date in 
yymmdd

format?



I think, first you need to split yymmdd in a vector [yy,mm,dd]
> yy=floor(meas_date/1);
> mm=floor(meas_date/100)-100*yy;
> dd=meas_date-100*mm-1*yy;
and convert this vector with datenum([yy,mm,dd])


and see also the x_ticks property in the axes_properties help page.

Jean-Yves
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plot versus date

2016-01-18 Thread jbaud...@insa-rennes.fr

Hi,

Le 18/01/2016 09:00, anna78 a écrit :

Hi all,
I'm beginner of SCILAB.

I have the file here after reported, made of 5 columns.
I would like to plot column 4 versus column 1, column 1 being a date in the
yymmdd format.
Is there any way to make SCILAB understand the x-axis is a date in yymmdd
format?



I think, first you need to split yymmdd in a vector [yy,mm,dd]
> yy=floor(meas_date/1);
> mm=floor(meas_date/100)-100*yy;
> dd=meas_date-100*mm-1*yy;
and convert this vector with datenum([yy,mm,dd])

Jean-Yves
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] plot versus date

2016-01-18 Thread anna78
Hi all,
I'm beginner of SCILAB.

I have the file here after reported, made of 5 columns.
I would like to plot column 4 versus column 1, column 1 being a date in the
yymmdd format. 
Is there any way to make SCILAB understand the x-axis is a date in yymmdd
format?
thanks!
anna


meas_date[yymmdd], particle(0=p,1=c), energy_mm, pu_avg_mm, pu_std_mm
150628 0 74 0.70 0.05 
150711 0 74 0.68 0.06 
150725 0 74 0.71 0.05 
150802 0 74 0.65 0.06 
150829 0 74 0.63 0.08 
150905 0 74 0.67 0.06 
150927 0 74 0.74 0.10 
151018 0 74 0.77 0.13 
151101 0 74 -5.37 0.06 
151101 0 74 -5.48 0.06 
151106 0 74 -5.82 0.09 
151115 0 74 -5.09 0.07 
151121 0 74 -6.00 0.06 
151128 0 74 -5.56 0.06 
151208 0 74 -5.72 0.05 
151219 0 74 0.64 0.06 
160105 0 74 0.59 0.07 




--
View this message in context: 
http://mailinglists.scilab.org/plot-versus-date-tp4033297.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] Loop query - Scilab 5.5.2

2016-01-18 Thread sgougeon
Hello,


>for Te = 5000:25000:1 // start:end:step to make 5000, 15000, 25000

The syntax is start:step:end, not start:end:step

https://help.scilab.org/docs/5.5.2/en_US/colon.html

Samuel Gougeon
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Loop query - Scilab 5.5.2

2016-01-18 Thread Lester Anderson
Hello,

I am trying to create a loop to plot three curves from an input variable (Te):

clear()
rho_m = 3330;
rho_fill = 2400;
g = 9.81;
Pb = -1.5e12;
v = 0.25;
E = 1e11;
x=linspace(0,200,41);

for Te = 5000:25000:1 // start:end:step to make 5000, 15000, 25000
D = E*Te .^3/(12*(1-v^2));
lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
lamda_k = lamda*1000;
flex = 2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x);
end
scf(1)
clf(1)
set(gca(),"auto_clear","off")
set(gca(),"grid",[0,0])
plot(x,flex)

The data plots correctly but only the first value (Te= 5000). Any
poniters on what is missing would be great.

Cheers
Lester
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Loop query - Scilab 5.5.2

2016-01-18 Thread Lester Anderson
Thanks for that pointer.

The plot works but only does Te=25 in this case

for Te = 5000:1:25000 // start: step: end
D = E*Te .^3/(12*(1-v^2));
lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
lamda_k = lamda*1000;
flex = 2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x);
end
plot(x,flex)

Can't get it to loop and plot the other values


On 18 January 2016 at 10:38,   wrote:
> Hello,
>
>
>>for Te = 5000:25000:1 // start:end:step to make 5000, 15000, 25000
>
> The syntax is start:step:end, not start:end:step
>
> https://help.scilab.org/docs/5.5.2/en_US/colon.html
>
> Samuel Gougeon
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] R: plot versus date

2016-01-18 Thread anna78
Thank you.
And a question more: is there any way to 90° -rotate the x-axis ticks label?

Da: jbaudais [via Scilab / Xcos - Mailing Lists Archives] 
[mailto:ml-node+s994242n4033298...@n3.nabble.com]
Inviato: lunedì 18 gennaio 2016 9.26
A: Parravicini Anna
Oggetto: Re: plot versus date

Hi,

Le 18/01/2016 09:00, anna78 a écrit :
> Hi all,
> I'm beginner of SCILAB.
>
> I have the file here after reported, made of 5 columns.
> I would like to plot column 4 versus column 1, column 1 being a date in the
> yymmdd format.
> Is there any way to make SCILAB understand the x-axis is a date in yymmdd
> format?


I think, first you need to split yymmdd in a vector [yy,mm,dd]
 > yy=floor(meas_date/1);
 > mm=floor(meas_date/100)-100*yy;
 > dd=meas_date-100*mm-1*yy;
and convert this vector with datenum([yy,mm,dd])

Jean-Yves
___
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users


If you reply to this email, your message will be added to the discussion below:
http://mailinglists.scilab.org/plot-versus-date-tp4033297p4033298.html
To unsubscribe from plot versus date, click 
here.
NAML




--
View this message in context: 
http://mailinglists.scilab.org/R-plot-versus-date-tp4033306.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] Loop query - Scilab 5.5.2

2016-01-18 Thread Tim Wescott
Or you can build a three column array as a matrix.  Here's my example,
but I don't see where 'x' is defined.

Te = (5000:1:25000)';
D = E * Te .^ 3 / (12 * (1 - v^2));
lambda = ((rho_m - rho_fill) * g ./ (4 * D)) .^ 0.25;
lambda_k = lambda * 1000;
flex = (2 * Pb * lamda / ((rho_m-rho_fill)*g)) .* ..
   exp(-lamda_k .* x) .* cos(lamda_k .* x);

On Mon, 2016-01-18 at 14:48 +0100, Serge Steer wrote:
> The plot instruction should be inside de loop
> 
> k=0;
> st=["r","g","b"];
> for Te = 5000:1:25000 // start: step: end
>  k=k+1
>  D = E*Te .^3/(12*(1-v^2));
>  lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
>  lamda_k = lamda*1000;
>  flex = 
> [flex,2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x)];
>  plot(x,flex,st(k))
>   end
> 
> 
> 
> or you may build a three column array . in the script below I assume x 
> is a column vector
> 
> flex=[];
> for Te = 5000:1:25000 // start: step: end
>  D = E*Te .^3/(12*(1-v^2));
>  lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
>  lamda_k = lamda*1000;
>  flex = 
> [flex,2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x)];
>   end
> plot(x,flex)
> 
> 
> Le 18/01/2016 11:50, Lester Anderson a écrit :
> > Thanks for that pointer.
> >
> > The plot works but only does Te=25 in this case
> >
> > for Te = 5000:1:25000 // start: step: end
> >  D = E*Te .^3/(12*(1-v^2));
> >  lamda = ((rho_m-rho_fill)*g ./(4*D)).^0.25;
> >  lamda_k = lamda*1000;
> >  flex = 2*Pb*lamda/((rho_m-rho_fill)*g)*exp(-lamda_k*x).*cos(lamda_k*x);
> > end
> > plot(x,flex)
> >
> > Can't get it to loop and plot the other values
> >
> >
> > On 18 January 2016 at 10:38,   wrote:
> >> Hello,
> >>
> >>
> >>> for Te = 5000:25000:1 // start:end:step to make 5000, 15000, 25000
> >> The syntax is start:step:end, not start:end:step
> >>
> >> https://help.scilab.org/docs/5.5.2/en_US/colon.html
> >>
> >> Samuel Gougeon
> >> ___
> >> users mailing list
> >> users@lists.scilab.org
> >> http://lists.scilab.org/mailman/listinfo/users
> > ___
> > users mailing list
> > users@lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
> >
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
> 
> 

-- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users