[scilab-Users] Using a cell entry to access part of a matrix

Adrien Vogt-Schilb vogt at centre-cired.fr
Mon Nov 7 09:15:18 CET 2011


Hi

why don't you just

y(ii(1)) ?


On 07/11/2011 02:43, Iai Masafumi ax wrote:
> Hi,
>
> Could anyone tell me if, in the codes below, there is any way to make
> "y(II(1))" work without error, just like "y(ii)"? I wanted to access a
> part of a matrix by using an entry of a cell. I think it is a pretty
> intuitive way of using a cell.
>
> //--------------------------
> y=[100:110]
> ii=[1 3 5 7];
> jj=[2 4 6 8];
> y(ii)   // OK. This is an ordinary way.
>
> II=cell(2,1);
> II.entries(1)=ii;
> II.entries(2)=jj;
>
> II(1)
> y(II(1)) // <-- ERROR
>
> y(II.entries(1)) // OK. But not as concise as I see the benefit of using
> cells.
> //--------------------------
>
>
>
> Thanks,
> Iai


-- 
Adrien Vogt-Schilb (Cired)
Tel: (+33) 1 43 94 *73 77*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20111107/128d6ef7/attachment.htm>


More information about the users mailing list