Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Loop over Reducing Matrix Dimensionality
Valjean
post Feb 29 2016, 05:57 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 15
Joined: 22-February 16
Member No.: 19,047



My goal is to take a set of vectors, which run over an index i, and reduce their dimensionality by one for every zero in the array. In particular, I have a set of vectors which have elements

vecA_$i=[ a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 b ]

and I just want to reindex them to have the vector [ a b ]. If I have just one vector, I can do

VecA_1=("${VecA_1[@]:0}")

and this works just fine. However, I am having difficulty doing this over a loop. I attempted to do

for (( i=1; i<=$directory; i++ ))
do
VecA_$i=("${VecA_$i[@]:0}")
done

but this results in a syntax error on the definition line. Can anyone advise how to perform a do loop over a matrix dimensionality reduction?
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2017 - 08:40 AM