What is Array: Definition and 501 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. barryj

    I Using an array to solve a system of equations

    I was given a problem to use an array, not a matrix, to solve a system of equations. I have not heard of doing this and can not find any reference to how to do it. like... 2x+3y = 12, and 3x-4y = 14 How is this solved using an array or grid?
  2. Eclair_de_XII

    C/C++ Is there a shorter way to determine if a given element is in an array?

    #include <iostream> #include <vector> #include <string> using namespace std; int main(void) { vector <int> v = {0, 5, 9, 3, 2, 1}; bool nine_exists = false; for (int i: v){ if (i == 9) { nine_exists = true; break; } } string message =...
  3. BiGyElLoWhAt

    C# Return type that matches type passed to function in C#

    I am working on a project in C# that will be using arrays of various length that need to be determined at runtime. I am attempting to write a small personal library of functions that act on arrays of various types. Right now, I am trying to add an empty element to the end of an array, of...
  4. Vanilla Gorilla

    B Array Representation Of A General Tensor Question

    So, I've been watching eigenchris's video series "Tensors for Beginners" on YouTube. I am currently on video 14. I, in the position of a complete beginner, am taking notes on it, and I just wanted to make sure I wasn't misinterpreting anything. At about 5:50, he states that "The array for Q is...
  5. Manuel12

    Magnets with Halbach array in an AC generator

    As a project, I am demonstrating electromagnetic induction by making an AC generator. The magnets I currently have access to are very strong neodymimium countersunk magnets, but I noticed that they utilise a Halbach array. I am aware that this means the magnet has alternating N-S poles spaced...
  6. C

    Comp Sci Finding size of array passed as a parameter

    #include<stdio.h> void sort(int arr[]){ int n=sizeof(arr)/sizeof(arr[0]); printf("%d",n);} void main(){ int array[]={12,11,54,6,77}; sort(array);} But I'm getting the answer as 2. I searched it up and found out that array has decayed into pointer and hence its showing size of pointer...
  7. S

    [BASIC language] Removing an array element -- how?

    I cannot figure how to do this. I looked through some old programming textbook and tried an online search and still cannot find. How can one element from an array be removed, and then the array put together but now with the one item less, and so the array is now one item smaller than it was...
  8. Arman777

    Creating a grid type 3D data array from data points

    I have a 3 data column ##(X, Y, Z)## ranges from ##(min, max)##. For example, ##X = (0, 5)##, ##Y=(0, 3)##, ##Z=(0, 2)##. By using them I need to create a numpy array in the form of ##[(0, 0, 0), (0, 0, 1), (0, 0, 2), (0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 2, 0)...]## So in total there will be...
  9. Eclair_de_XII

    Fortran How do I create a pointer to an element of an array with a variable index?

    program main implicit none real,dimension(3),target::x=[0,4,5] real,pointer::y call point_to_biggest(x,y) !print *,y ! For testing purposes; to be unmuted only when y points to something contains subroutine point_to_biggest(array,ptr) implicit none...
  10. M

    Python - Endpoint : Can the function not return an array of dictionaries ?

    Hey! ๐Ÿ˜Š I am trying to write a code for a server in Python and I got stuck. I gave as an input a csv file and using pandas we get a dictionary where the titles are the keys and the inputs are the values. From that we get the below : I have written the below endpoint to get all the...
  11. B

    I How do I compute the second derivative of a one-dimensional array?

    How do I compute the second derivative of an one dimensional array?
  12. D

    How replace a numeral in the string 'abc1def' w/ an array element?

    Summary:: I need to loop through a number of strings replacing the numerals in them with an array element so that e.g.: flos1Field, flos2Field, flos3Field, etc. become flosAField, flosBField, flosCField. The array would be something like: const letters = ["A", "B", "C"]; I put the question in...
  13. Sai Maurice

    Populating a 1001x101 2D array in MATLAB

    The method I employed was based on a nested loop. I ran into two issues with this approach 1. The code took way too long to run, easily going for over 7 minutes. 2. In the end, it didn't even completely work, due to the "index exceeding the array length". This confuses me For the relevant...
  14. logical3902490

    Sorting an Array of 2-D Records

    I've just started learning sorting algorithms on arrays of records and wanted to ensure I'm not doing it wrong so I have a basic question. I am sorting an array of records, where the records have two components, A and B. For example a record (3,2) has an A value of 3 and a B value of 2. The...
  15. M

    A Array variable of envelope function (parameter representation)

    Hi, I have a question regarding the envelope function in parameter representation. Let an array of curves in cartesian coordinates be given in parameter representation, with curve parameter ๐‘ก and array variable ๐‘ ๐‘ฅ=๐‘ฅ(๐‘ก,๐‘) ๐‘ฆ=๐‘ฆ(๐‘ก,๐‘) Condition for envelope is: ๐œ•/๐œ•๐‘ก ๐‘ฅ(๐‘ก,๐‘) ๐œ•/๐œ•๐‘ ๐‘ฆ(๐‘ก,๐‘)=๐œ•/๐œ•๐‘...
  16. F

    I Calculate Diameter of Quad Coil Array for Speed of Light Rotation

    I would like to know how to calculate, for any specified frequency in Hz, the required diameter of a 90 degree phased, quadrature coil array such that its generated EM field achieves rotation at the speed of light. Could someone please provide an example of the calculation using a specific...
  17. N

    Source Level calculations of an Underwater Cylindrical Acoustic Array

    Hi all I am trying to calculate Source Level 'SL' of a underwater acoustic Cylindrical Array with multiple Transducers. The array has 03 Rings with 32 transducers in each Ring. The spacing between each ring is around 0.18m whereas Dia of each Ring is about 1m. Each transducer is being driven...
  18. berkeman

    Is this an antenna array on the new Chinese aircraft carrier?

    I saw this photo at CNN.com today, and I'm trying to figure out what the function could be for what looks like a linear antenna array lining both sides of the aircraft ski-jump launching ramp. They look to be an array of about 10m verticals along each side of the bow, but with the base of some...
  19. T

    How can I read a local file into an array in JavaScript?

    Hello I am aware that it is not natural for JavaScript to read a file; however I see it is being done. I am trying to read a local file of 100 numbers (separated by line breaks) into an array in JavaScript (I am aware that there are better ways to do this, but this is going to be the way I...
  20. F

    Why are new dimensions added to the left in numpy arrays?

    Hello, I am clear on 1D and 2D Numpy arrays, how to create them and address them). 1D array: single list 2D array: list containing multiple lists as elements 3D array: list containing lists which contain lists as elements Array elements can be address using indices as a[], a[][], a[][][]...
  21. F

    Variable, Data Type and Array Data Structures

    Hello, In Python and other programming languages, data can be of different types: integer, float, string, Boolean. On the other hand, Data structures are containers of data items which can (or not) have the same data type. A variable, when created, has: a) name (a piece of data stored in...
  22. S

    Mathematica Automatically create array of named variables

    In the following example... Manipulate[ ListPlot[{p1, p2}, PlotRange -> {{0, 3}, {0, 3}}, Joined -> True], {{p1, {0.5, 0.5}}, Locator}, {{p2, {1, 0.7}}, Locator} ] ... we have created variables p1 and p2 that are local to the Manipulate block...
  23. Y

    Polymorphism using pointer to array

    I am looking at the program 15.13 in the Gaddis book. My question is only regarding of int main(){} that using pointer tests of GradedActivity to point to an array. I am trying to understand how it works. I reviewed on pointer to dynamic allocation of memory for array and try to change the code...
  24. vutran

    Starlink phased array antenna

    It looks very cool. I have been using phased-array for direction finding & beam-forming, but recently I have come up with an idea that I find difficult to understand. Let's take the star-link phased array as an example, if we used a long-wave (MHz -- much lower than the one it is designed...
  25. S

    Python 4D array with elements only on one side of the diagonal

    Given the parameters ##n## and ##m##, I'd like to initialize a ##n \times n ## 4D array where each entry is an ##m \times m ## matrix, and where each column of the matrix is an array of type numpy.linspace(0,1,m). Furthermore, I'd only like to have entries on the diagonal and above it, or only...
  26. U

    Circular antenna array formula

    At page 20 of this pdf the two formulas that characterize the behavior of a linear and a circular antenna array are compared. The reason why I write this post is: I don't understand why the second formula is true. Below I show why I am not convinced. In general, given a configuration of sources...
  27. mfb

    How Does Starlink's Phased Array Antenna Track Satellites Without Moving?

    Starlink has begun its public beta phase, and naturally some people were more interested in the electronics than in fast internet access. Here is a video how the satellite receiver looks inside. The first half is focused on the mechanical side, the second half is looking at the electronics. It...
  28. I

    Comp Sci Searching Array for an Element using Linear Search

    I write a Linear Search code,then ฤฑ decided ask to user "r" and "int arr".I mean,User decide their r and arr numbers.I tried scanf("%d",r); command but doesn't work This code my first code before the decide Ask user : #include <stdio.h> int search(int arr[], int n, int r) { int i; for...
  29. A

    An array problem involving a recursive binary search

    Summary:: I have to solve this problem stirctly according to the question that follows: Mentor note: I edited the original code to add indentation and a few blank lines to make the code more readable, so line 43 is no longer the line in question. so this is the question i tried but it gives...
  30. Monsterboy

    Comp Sci Optimal code for the array problem

    Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each of the array element between two given indices, inclusive. Once all operations have been performed, return the maximum value in your array. For example, the length of your array of zeros ...
  31. Y

    Question about the efficiency of using an array or individual variables

    I have two questions here. In the program, I have two different boolean expressions, one using array A[10], the other just using individual variablesB(0..9). They both do the same thing as in the program. My question which one is faster in real life hardware? My guess is B(0..9) is faster even...
  32. Y

    C/C++ I cannot get the size of the array after passing it to a function in C++

    I have a strange problem. I pass an Array[20] to a function. When I put cout << sizeof(Ar); (line 29 in the program) it only shows the length of one element ( 4bytes). BUT if I write cout << Ar[10]; (line 30 in the program) It will give me the correct number of the original idNum[10]. I tried a...
  33. richworldinc

    Comp Sci Search an array in three subsections for a specified song

    #include <iostream> #include <string> using namespace std; int mySearch(string songArray[], int arraySize, string songTitle, int songIndex) { for (int i = 0; i < arraySize; i++) { cout << i << "..." << songArray << endl; } int searchBegin = 0; int searchEnd = 13...
  34. N

    High Frequency Linear Array BeamForming

    Hi all I am doing some research on High Frequency Linear Array beam forming (for imaging sonar). For that purpose, a linear Rx Array of 100 channels have been constructed with inter channel spacing of 14.3mm. A transmitting Tx probe operating at 420 KHz (approx. 300 cycles CW pulse) is placed...
  35. rayjbryant

    Cylindrical Halbach array with a vertical magnetic field?

    Similar to what is shown here, except the south side would be the weak side of the array. A link to purchase one of these or at least the magnetic field arrangement would be very helpful. Thanks in advance.
  36. S

    Mathematica Inc, Dec buttons while "Manipulating" an array (Mathematica)

    This code takes the coeffeicient array c0 from the first line and does the Manipulate thing, putting in as many sliders as the length of c0. Problem is that I couldn't find a way to enable the increment and decrement buttons that you usually get for the sliders, even though I have put in the...
  37. A

    Developing Algorithm to Recursively Walk Array: arr[4] Example

    I want to write code walk around the array recursively. For some reason I cannot share my code. Let's say I have a array like this: arr[4], I want to look 012 123 013 or 01 12 23 02 03 13. In code I write I can look 012 123 or 01 12 23 but I cannot look 013 or 02 03 13. What algorithm should I...
  38. J

    Comp Sci Java - Why no out of bounds error for this array

    I am writing a class called "Course" in Java so that one can input students names, etc. Here is my relevant code for the Course class: public class Course { private String courseName; private String[] students = new String[0]; private int numberOfStudents = 0; public...
  39. M

    Electronics Sourcing LED Components for High-Wattage COB Array (1200w - Woah)

    Hello, I am looking to build an LED Panel for a film/video application. I have a few specific requirements in mind. 1) Color Accuracy beyond general CRI ratings. 2) Flicker Free to Camera (What specifications in LED drivers should I be looking for to ensure this flicker free application?) 3)...
  40. V

    Comp Sci What is a more efficient way to change a value in a numpy array?

    import numpy as np def array_change(a,new_val): a=np.array([]) for i in range(a): if abs(i)<1: a[i]=new_val e=np.arange(-2, 2, 0.2).reshape(4,5) print(array_change(e,0)) I am not sure where I am going wrong exactly but I keep getting an error message. I came up...
  41. Avatrin

    Python Differences between Pillow and Pyplot in turning an array into an image

    The other day I was trying to visualize a field using line integral convolution. I thought I kept failing for days since Pillow was giving me outputs similar to this one (img = Image.fromarray(output_image, 'L')): I thought I was making some mistake until I tried Pyplot...
  42. V

    Comp Sci Subtracting the mean from a column in an array

    import numpy as np a=np.array([[1,2,3], [4,5,6]]) print(s) print() print(a.mean()) I know how to take the mean of the entire array. However I am having trouble understanding what it means to subtract the mean from each column. Does this mean subtract it from each element in the column? Thank...
  43. W

    Getting this Array to be in 2D instead of 1D for Python Linear Regression

    import matplotlibimport matplotlib.pyplot as plt import numpy as np from sklearn import datasets, linear_model import pandas as pd # Load CSV and columns df = pd.read_csv("C:\Housing.csv") Y = df['price'] X = df['lotsize'] # Split the data into training/testing sets X_train = X[:-250] X_test =...
  44. BabyHueyTAW

    Definition: What is meant by port "CARP" ASIC functionality in a Field Programmable Gate Array?

    Summary: What is meant by port CARP ASIC functionality to a field programmable Gate Array FPGA. And what is Acronym CARP? What is meant by port CARP ASIC functionality to a field programmable Gate Array FPGA. And what is Acronym CARP?
  45. A

    I How Far Can the Square Kilometre Array 'Listen' for Extraterrestrial Signals?

    As some of you probably know, the Square Kilometre Array will become the biggest radio telescope on Earth, with a collecting area of 1 square kilometre. The construction will start in 2021 and the first light is expected to take place in 2027. It will cover the frequencies from 50 MHz to 15...
  46. S

    Mathematica Plotting an array of functions in different colors

    If we plot a list of functions in a literal array, they get plotted automatically in different colors, for example: Plot [{x,x*x,-x},{x,0,10}] But if we get the list of functions from another user-defined function, they get plotted in a single color: fnY[x_]:={x, x*x, -x} ... OR ...
  47. coolboyshane88

    Halbach array arrangement for a transformer

    Can we use Halbach array for the electromagnetic field since the magnet field change with direction? What would be the disadvantage? Imagine if we use Halbach array special arrangements for the transformer instead of an iron core. Maybe it could give us the same result? Kindly Maybe we can...
  48. T

    XOR algorithm to find the missing number in a given array

    Recently I have been reading up about the logical operations OR, AND and XOR. Whilst reading about XOR I cam across a method using XOR to find the missing number in a given array, but I just can't understand how or really why it works. The algorithm is displayed below. A = [2, 3, 1, 4, 6, 7]...
  49. E

    How to Use a Multidimensional Array to SED?

    I have a .dat file which contains an ##m \times n## (specifically, a ##9 \times 2##) array and I have a file which has this kind of format, variable_x xx variable_y yy where xx and yy are numbers (I'll call this file the input_file). This file serves as an input to an external program, which I...
  50. LCKurtz

    C/C++ Efficient Array Initialization in Visual C++ for a 4-Digit Odometer

    Let's say you have a 4 digit "odometer" using just the digits 0 through 7. So it starts at 0000 and works its way up to 7777. So, for example, the next reading after 0007 is 0010 etc. There are ##8^4 = 4096## readings before it rolls over. I want to create and initialize an array with ##4096##...
Back
Top