What is Arrays: Definition and 151 Discussions

An array is a systematic arrangement of similar objects, usually in rows and columns.
Things called an array include:

View More On Wikipedia.org
  1. D

    Is there a quick way to put quotation marks around strings in an array?

    Hi everyone I'd like to cut and paste a list of words into an array. I'll need to put quotation marks around them all. Is there a way to do this other than to go through each word one by one? Thanks
  2. gjleigh10

    How to read a column of data into Fortran without arrays? (Fortran 77)

    TL;DR Summary: I am beginning research as an undergrad in Physics and have an example file I must analyze for the mean of each column. I cannot use arrays. I need to take the sum of a column of data. Hi all, I am new to fortran and programming in general, but I'm having issues with creating a...
  3. M

    Python Appending a dictionary whose keys contain np arrays

    Hi PF! I have a large dataset called data_dict I'm parsing that's stored as a numpy array. I'm subcategorizing it via a dictionary titled data_dict. Currently there is a dictionary key called key_curr that stores an np array data_col_prev. I'd like to append to this key data_col_curr. When I...
  4. MahdiI84

    Fortran Dimension of arrays (RESHAPE) in Fortran 90

    program testmatek implicit none integer :: Nc=1000 ,k integer,parameter :: N=2 REAL :: kx ,a0=1.0 ,t0=0.25 DOUBLE PRECISION :: pi=4*ATAN(1.) COMPLEX , PARAMETER :: i=(0,1) complex :: ek1 ,ek2 complex :: MATRIX_ek(N,N) open(1,file='matek.txt') MATRIX_ek(N,N)=(0,0) DO k=-Nc,+Nc...
  5. Astronuc

    Hexagonal fuel arrays (VVER and fast reactor fuel)

    I'm working on an interesting task at the moment related to a core and fuel design for a fast reactor system. Given that the system is a fast reactor, we select a sensible lattice, i.e., a triangular or hexagonal lattice. Neutronically, one can solve for the necessary mass of enriched (less...
  6. K

    Understanding 5G Beamforming Using Phased Arrays

    The general concept of 5G beamforming using phased arrays makes sense from the videos I've seen. Something I've noticed was that there are always side lobes and also the beam spreads as it travels. My hypothetical question is, is it possible to suppress all side lobes (side lobes -->0) and...
  7. V

    Comp Sci Optimizing Numpy Arrays for Efficient Data Manipulation

    I feel like I have over complicated this question but here is the code I wrote out for it, I wrote it as a function but when I printed my values I realized I did not need a function to do so. So would I just use my second code to answer the question. import numpy as np def array_zero(n)...
  8. S

    What is the difference between slat and tile arrays in active phased arrays?

    Hi, I’m reading the attached pdf article at https://www.microwavejournal.com/art...neration-radar about tile architecture in active phased arrays. Please help me with the following two questions. 1. Figure 2: Are this figure and the attached architecture (array.jpg) referred to the same...
  9. R

    Comp Sci Declaring arrays statically, on the stack and heap

    I'm confused here. I guess my professor mean "statically" in the problem, but anyways, I thought, in C++, that declaring an array statically is the as declaring the array on the stack? For example, if I have a function: void staticArr(){ int a[10000]; } here I am declaring an array...
  10. A

    Python To print two equal sized 2-D arrays adjacently in a single .txt file

    I have two 2-D equal sized arrays (m×n) say a,b and want to print them in a single .txt file and have tried this using numpy np.savetxt('data.txt',(a,b)) but it fails.., Can anyone please help in sort out this Thanks
  11. Arman777

    Looping Program Problem -- create and fill in two vector arrays....

    Homework Statement Take as input from the user an integer N. We don't want the user to enter very large integers, so exit with an error message if N>20. You may assume that N is an integer (and not a real number) and also that it is positive. Make two vectors v1 and v2 using v1.append() and...
  12. Drakkith

    Nanowire Arrays Restore Vision in Blind Mice

    Abstract: The restoration of light response with complex spatiotemporal features in retinal degenerative diseases towards retinal prosthesis has proven to be a considerable challenge over the past decades. Herein, inspired by the structure and function of photoreceptors in retinas, we develop...
  13. Wrichik Basu

    Java Representation of two-dimensional arrays in the memory

    Arrays declared in java are stored in the memory in two ways: row-major-wise and column-major-wise. As per our teacher, the choice of the storage technique depends on how we enter the array elements. For example, for this code: int arr[][] = new int[10][10]; Scanner kb = new Scanner...
  14. 1

    B Index numbers vs. Quantity in a group

    "Quantity in a group" If you have 6 apples and you subtract 4, then you have 2 apples left "in the group". "Quantity in an Indexed group" I'm a computer programmer - I manipulate arrays of data (a.k.a. matrix) In a math formula format: x1, x2, x3... xn (as a side note - in a computer format...
  15. M

    Library that supports multidimensional Arrays

    I'm am looking for a C++ library that supports high-dimensional arrays ( 3=< ) and element-wise calculations. Is there such a thing?
  16. Const@ntine

    Comp Sci 5x5 Arrays - Sum & Difference - (Fortran)

    Homework Statement Create two 5x5 arrays, A & B, and ask the person to fill them out. Save those numbers in matrix_a.txt & matrix_b.txt respectively. Then, save the sum and difference of those numbers in sum.txt & diff.txt respectively. Basically we need to create two arrays, fill them out...
  17. E

    Returning an array of generic type

    This is a homework problem, so I have to follow some stipulations, namely: The problem is, I have no idea how to get a method to return a generic-type array. Because of type erasure, I can't create an instance T[] of a generic array, empty or otherwise. The only way I was able to do it was...
  18. L

    MHB Shopping cart object problems using methods, and arrays no arrayLists. java

    Hello, I cannot seem to get the calculations correct for my shopping cart to print out the tickets and total how many tickets and how much they are. The first set of code is for the shopping cart the comment sections are for what is suppose to be happening in each section. I have the menu...
  19. toforfiltum

    Simple C program involving arrays which cannot execute

    < Mentor Note -- thread moved to HH from the technical Computer forum, so no HH Template is shown > I have a homework problem which requires me to convert a word a user entered to Pig Latin by moving the first letter of the word to the end and adding an ay to it. For example, Tuesday becomes...
  20. L

    MHB Multiple arrays: Key and value.

    Hello, I am stuck on this question.The bold part is where I am stuck. I was able to get at least 2 out of the 3 test outputs but I can't seem to get the last one. I tired taking out the dividing by 2 but then the first test output doesn't work. Thank you. Question: For any element in keysList...
  21. E

    Java Recursively sorting an array of strings w/o aux. parameter

    One of my professor's assignments is proving particularly tricky for me. It reads: "Write the method public static void sort(String[] a) that sorts the array a in increasing order. The method must be a short recursive program. Do not use quicksort or merge sort. It should be a lot...
  22. A

    Java Problem working with multi-dimensional arrays in Javascript

    Hi, I'm writing an HTML/Javascript application that will handle a large amount of data segregated into a set of n rings, each ring will have a set of m branches, and each branch will have four arrays of data, V, N, I, B. I would like to create a 3-D array to hold this data but am having...
  23. P

    Python Removing 0's from 2d arrays

    Hi there, I have 1024,1024 arrays (lots of them) which are really roughly 600,800 (it changes) and then buffered by zeros all the way around something like 000000000000000000 000000000000000000 000xxxxxxxxxxxxx000 000xxxxxxxxxxxxx000 000xxxxxxxxxxxxx000 000000000000000000 000000000000000000 i...
  24. levadny

    Dynamic Arrays (One, two, three dimensions)

    Dear Friends! My post about dinamic arrays. For example little bit code. // size int const X = 5; int const Y = 4; int const Z = 3; // one dimension array printf("\nOne dimension\n"); // array of pointers int * Arr; // create array Arr = new int [X]...
  25. Prof. 27

    Comp Sci Problem with C++ Information Structures, Pointers, Arrays

    Homework Statement So I'm getting an error when I try to compile my C++ code: Debug Error Abort() has been called I have commented the code reasonably well, but the idea of the program is to take a file, separate the contents in each line to a part of a structure containing: Product Lookup...
  26. S

    Maximum Theoretical Angular Accuracy of Planer arrays

    Hello,in this link http://dtic.mil/dtic/tr/fulltext/u2/a028054.pdf a paper „Maximum Theoretical Angular Accuracy of Planer and Linear Arrays of Sensors“ can be found.The accuracies are given in equations 19 (respect to the x axis) and 20 (respect to the y axis).My question is: Shall the angle...
  27. W

    I Could pulsar timing arrays see primordial gravity waves?

    Im wondering if pulsar arrays could see primordial gravity waves? I have understood the only way to seem them would be to a) via indirect imprint on CMB polarisation b) direct viewing via some gigantic space based interferometer like Big Bang Observer However I was looking at this image...
  28. 24forChromium

    Compressing arrays and various number of terms

    Behold this array of numbers: 3, 5, 11, 4 Sometimes, the programming limits the number of things that can be recorded in one location to a single number, such as 93240, but sometimes I also need to record an array of numbers such as the one shown above. An example of such platforms include the...
  29. H

    C program for calculating tax brackets(no arrays)

    Homework Statement I have an assignment with the following requirements for the functions: Tax_Bracket_Identification. This function will identify the tax bracket. This function: is of type int; has one call-by-value argument (income); uses nested if-else statements. Tax_Calculation. Will...
  30. SnakeDoc

    Pointers -->(makes integer from pointer without cast)

    Homework Statement I am to write a program that has its user enter 100 character or less and determine if the line is a palindrome or not. I must use pointers one that starts at the beginning and one at the end of the array that must work their way in until they meet.(I'm also having trouble...
  31. SnakeDoc

    C Programming: Arrays and pointers

    Homework Statement So I created two arrays one called departure_time and the other arrival_time and populate each array as follows. I've tried both putting 8 and defining N as 8 int departure_times[N]={480, 538, 679, 767, 840, 945, 1140, 1305}; int arrival_times[N]={616, 712, 811, 900, 968...
  32. L

    Comp Sci Elementary C++, assigning arrays

    Homework Statement Assuming that array1 and array2 are both arrays, why is it not possible to assign the contents of array2 to array1 with the following statement? array1 = array2;Homework EquationsThe Attempt at a Solution This is a question I just saw in a book. As far as I can tell the...
  33. T

    Comp Sci Sorting Arrays to a file Java

    Homework Statement You are provided the following list that contains (semi-random) years from modern history. Save the list to a text file named “events.txt” Write a program that: 1. Reads in the file “events.txt” 2. Sorts it with the latest events first 3. Determines whether the founding of...
  34. H

    Fortran How to Merge and Sort Two Fortran Arrays?

    I have 2 set of data (from different files) and I allocate each set of data to array in my main program. But now I want to merge those 2 array and sort them in ascending orders in my sub program. What should I do? I know how to sort array in ascending orders, but i don't know how to merge those...
  35. J

    Fortran Troubleshooting Fortran 90 Errors: Rank Mismatch in Arguments | RFK.f90

    Hey guys, I'm pretty new and desperate. I been trying to compile this program for a while and keep jumping from error to error. Currently I have the following error: Error: Rank mismatch in argument 't' at (1) (scalar and rank-1) I have checked that my arrays are correctly. I have checked that...
  36. D

    [Python] Importing csv files and creating numpy arrays

    So I am fairly new to Python and feel somewhat comfortable with it. I am trying to do something what I think seems kind of simple however am not too experienced with loading files into Python (or any programming language for that matter). What I am trying to do is I have csv files that contain...
  37. Feodalherren

    MATLAB: input arrays into function

    Homework Statement Homework EquationsThe Attempt at a Solution Okay, so first off I'm just trying to write the code for scalars: -------------------------------------- clc ; clear P = 2000 r = .035/12 n = 36 F = (1 + r).^n A = (r*P*F)/(F-1) --------------------------------------- This...
  38. SalfordPhysics

    Comp Sci Efficient Fortran Method for Trajectory Plotting with 4d Vector-First Order ODE

    Homework Statement I have a code that successfully plots the trajectory of a ball moving under gravity and air resistance, but my method is rather long-winded and I want to use a 4d vector-first order ODE instead - but I don't know how to do it. I've tried writing some simple skeletons but...
  39. C

    Comp Sci C++ put numbers in ascending descending order

    In this assignment, you are going to write a function called sortMe that sorts the elements of an array in numerical order from highest to lowest values (descending order) or vice versa (ascending order). The interesting point of the function is that sortMe does NOT re-arrange elements in the...
  40. _N3WTON_

    Matlab: arrays, matrices, and rotating plots

    Homework Statement Generate a triangle. For this problem, generate a triangle at a grid of points that are finely spaced in the x dimension. The triangle is defined as follows: -Side 1: y = 0 for x = 0 to 2 -Side 2: x = 0 for y = 0 to 1 -Hypotenuse: y = 1-0.5x for x = 0 to 2 Alternatively, the...
  41. Matterwave

    Fortran [FORTRAN] Assigning bad values in arrays

    Hi, I just realized that I have been making bad array assignments in my code. Specifically, I think I have been assigning to slots that the array does not have. For example, I might declare an array: int,parameter :: nflavor=3 int,parameter :: nflavor2=nflavor*2 real,dimension(nflavor)::x...
  42. G

    Winning Lines for Tic-Tac-Toe (C programming)

    The Question Winning Lines Tic-tac-toe is a game played by two players o and x. A player wins when he/she succeeds in placing three respective marks in a horizontal, vertical or diagonal row. Given a 3-by-3 tic-tac-toe board, a winning line is a line (row, column or diagonal) that is not...
  43. I

    C/C++ Understanding Arrays & Vectors: What They Do & Why They Matter

    whats an array for?...whats a vector for? what do they do? what purpose do they serve?
  44. gfd43tg

    MATLAB Mastering Structure Arrays in Matlab: Confusion and Exam Preparation

    Hello, I am preparing for the exam for my Matlab class, and have run into some confusion with Structure arrays. I have a hard time keeping all the concepts straight in my head. I am working on an old exam problem, where this is the structure array, which I will use as an example to demonstrate...
  45. T

    Fortran Fortran programming help arrays and arithmetic

    Hi folks, To begin with, I have no past programming experience and have just begun to teach myself programming in FORTRAN 95 and I've hit a wall. I'd be very grateful for any assistance here. I have around 150 text files with three columns of data (I have attached one as an example, and...
  46. G

    Fortran Assignments of Elements between differently ranked arrays (fortran95)

    Hello everybody/reader, Thank you for reading my post, i have been known to be long winded but i put a abridged version of my question and sectional labels so it can be skimmed easily for relevant information. note: I Wrote a very explanatory post, which had sections and was written...
  47. Philosophaie

    LaTeX Writing Arrays in New Latex: x^k, g_{ij}, Γ^i_jk, Riemann^i_jkl

    How do you write these in the new Latex: x^k = Array{r \\ \theta \\ \phi \\ t} g_{ij} = Array{1/(1-2*m/r) & 0 & 0 & 0 \\ 0 & r^2 & 0 & 0\\0 & 0 & r^2*(sin(h))^2 & 0\\0 & 0 & 0 & -(1-2*m/r)} \Gamma^i_{jk} = 1/2*g^{il} * (\frac{d g_{lj}}{d x^k} + \frac{d g_{lk}{d x^j} - \frac{d g_{jk}{d x^l})...
  48. S

    A paper about Planar Interferometer Arrays

    Hello, I have attached a paper about Planar Interferometer Arrays. Now I’m trying to understand this paper but something confuses me. I am very thankful if somebody can help me with it. 1: It seems to me that direction cosines and phase differences are 1:1 correspondent, that is, a phase...
  49. Student100

    Comp Sci C++ allocating arrays dynamically.

    Homework Statement The problem is to dynamically allocate (closer to relocating) a dynamic class array in C++ based on the number of user inputs. We can't use vectors, malloc, realloc, or any such functions beyond new or anything simple like asking the user for how many questions they want to...
  50. trash

    [Pascal] Counting letters in a row without arrays

    I'm working with this excercise: make a program that gives the number of consecutive letters of a word and the most repeated letter in a row -example: if i enter aaafdseergftth and i press return the program should return a = 3, e=2, t=2 and a=3-. I've come up with a couple of "solutions"...
Back
Top