[Scilab-users] Re : for-loop does't work

Pierre-Aimé Agnel pierre-aime.agnel at scilab-enterprises.com
Fri Jun 5 14:02:39 CEST 2015


Hi,

I believe the problem is on the encoding of the text

A=zeros(151,3);
x=[0.0  5.0  10.0  15.0  19.0]
i=5
A(1,:)=x(i)
for  i=1:5
     A(1,:)=x(i);      
end

This worked for me without any problems
compare

ascii("A(1,:)=x(i);") // Text copied from your original mail
and
ascii("A(1,:)=x(i);") // Text copied from my console

Best,

Le 05/06/2015 13:40, paul.carrico at free.fr a écrit :
> hi
>
> Maybe you should first explain what you would like to do ...
>
> A is a matrix 151x3
> x is a matrix 1x5
>
> I do not understand the prupose of the loop????
>
> Depending on what you are expecting for, a good solution will be found
>
> Paul
>
> ----- Mail d'origine -----
> De: fujimoto2005 <fujimoto2005 at gmail.com>
> À: users at lists.scilab.org
> Envoyé: Fri, 05 Jun 2015 12:36:58 +0200 (CEST)
> Objet: [Scilab-users] for-loop does't work
>
> I run the following script.
> It works at 4th line
> But It failes from 5th line to 7th line.
> It seems to be right
> Where is this script wrong?
>
> *******************
> A=zeros(151,3);
> x=[0.0	5.0	10.0	15.0	19.0]
> i=5
> A(1,:)=x(i)
> for i=1:5
>      A(1,:)=x(i);
> end
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/for-loop-does-t-work-tp4032382.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-- 
Pierre-Aimé Agnel
R&D Projects Manager
Phone:  +33.1.80.77.04.67
Mobile: +33.6.82.49.35.23
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.68
http://www.scilab-enterprises.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150605/b28124e0/attachment.htm>


More information about the users mailing list