[scilab-Users] Problem with loop

Celso Co celso.co at gmail.com
Sat Oct 2 14:41:13 CEST 2010


Mike, Thanks. I learn new things in your codes. cco

On Fri, Oct 1, 2010 at 5:12 PM, Mike Page <Mike at page-one.waitrose.com> wrote:
> Hi Marcin,
>
> I agree - it is difficult to know what exactly you want from your description.
>
> I have modified Celso's script (attached) to do something like what you might want.  Maybe that gives you enough ideas to write the code you need?
>
> If you want some explanation of what this code does, please ask.  I didn't want to create a wonderfully documented script if it is completely off-target ;-)
>
> HTH
> Mike.
>
>
>
>
> -----Original Message-----
> From: Celso Co [mailto:celso.co at gmail.com]
> Sent: 01 October 2010 03:16
> To: users at lists.scilab.org
> Subject: Re: [scilab-Users] Problem with loop
>
>
> Dear Marcin,
>
> I cannot make such loop since there are still missing informations.
>
> Base on your discussion, I see that your inputs are b and A and your
> output is modified A.
> Then you reused your modified A with the same function until A=[].
>
> My suggestionn is to copy your A matrix into say B matrix. Then work
> on your B. Then for the next loop, copy A again on B and work on the B
> matrix. and so on.  In other words, your input is A and your output is
> B.  Don't change the input A as you reuse it in your loop.
>
> You may be deleting rows of A to serve as your exit index in "do" or
> "while" loop. However, using "for" loop the index nos is given and you
> do not need to delete rows.
>
> Attached file contains some example of matrix manipulation.
>
> Regards,
> celso
>
> 2010/9/30 marcin.wozniczka Gazeta.pl <marcin.wozniczka at gazeta.pl>:
>> Ok, so I'll try to explian and describe (in general) how my program is
>> working and what exactly it should count.
>> I have matrix 'A' and vector 'b'.
>> A = [10     5    2   56.1385
>>          2   10    5    61.8331
>>          5   10  17    46.2755
>>        10   17    5    70.5242
>>          5   17   30   66.5410
>>        30    5   17    86.5961] - Numbers in columns 1-3 are numbers of
>> points which define angle in triangle (First column is left point in angle,
>> second is center and third is rigth).
>> b = [10 2] - points which coordinates are known.
>> So, next I have several function (general loops), which are taking from
>> matrix 'A' data (4 column) using data in vector 'b'. When data is taking
>> from matrix 'A' they are automatically deleted in this matrix, and the new
>> number is added to vector 'b'. In this example in matrix will be deleted
>> lines 1 & 2 and to vector will be added number 5. This function I have
>> defined and they are working correctly.
>> And the problem which I have is to create loop or function which will repeat
>> all loops and function until the matrix A will be empty (A=[]).
>> Do you know how to create this loop?
>> --
>> Marcin Woźniczka
>>
>
>
>
> --
> Eng'r Celso B. Co, PhD ECE
> Assistant Professor
> Dept. of Electronics, Computer, and Communication Engineering,
> Loyola Schools of Science and Engineering, Ateneo De Manila
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.856 / Virus Database: 271.1.1/3169 - Release Date: 09/30/10 19:34:00
>
>
>



-- 
Eng'r Celso B. Co, PhD ECE
Assistant Professor
Dept. of Electronics, Computer, and Communication Engineering,
Loyola Schools of Science and Engineering, Ateneo De Manila



More information about the users mailing list