help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: recreate array original


From: Dmitri A. Sergatskov
Subject: Re: recreate array original
Date: Thu, 1 Aug 2019 14:23:36 -0500

On Thu, Aug 1, 2019 at 2:18 PM gigiolone123 <address@hidden> wrote:
>
> hi,
> i look your site but i don't understand how can i do it..
>
> i give you another example:
>
> a =  1 3 4..
>        4 2 1..
>        2 4 5..
>        .. . ..
>
> I have several pairs of rows and columns
>
> b :  1 3 ......(row)
> c:   2 3 ......(colum)
>
> d=zeros(size(a));
>
> for i=1:length(x)
>    d(b(x),c(x))= a(b(x),c(x))
> endfor
>
> it's possible to do it avoid loop?
>
> thank
>
>

You can convert your original matrix into vector aa= a(:); do find thing
and then recover the aa vector and then reshape() it back to original
matrix.

Dmitri.
--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]