help-octave
[Top][All Lists]
Advanced

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

Re: Extraction of elements of an array inside the other array


From: Thomas D. Dean
Subject: Re: Extraction of elements of an array inside the other array
Date: Sun, 5 Apr 2020 09:38:39 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2020-04-05 09:21, GK19 wrote:
a = (1,3,4,6,8,9,0,5,4,)
b = (3)
c = (4,56,7,8,5,1)
a, b,c are saved in .vec extension
for t1 =1:1:length(a)
         for t2=1:1:length(b)
         for  t3=1:1:length(c)
                 period_fun(a,b,c)=time(p);
                 p=p+1;
         end
         end
         end
So this code will give me the time
  period fun(5,1,3) which means it will fetch
5th element of a = 8, 1st element of b = 1, 3rd element of c = 7, and the
output is time = 1.1
Now just by looking the output time 1.1 i want to extract the 5th element of
a or the 1st element of b or  3rd element of c and get that element as
output
is it possible ?



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



To assign a list to a, use [].  Same for b and c.

Look at help list.

Tom Dean



reply via email to

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