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. R

    C# Converting integer into array of single digits in C#?

    Whats the easiest way to take an integer in C# and convert it into an array of length equal to the number of digits and each element is a digit from the integer? EG. If I had the integer 12345 I want to convert it to an array like so {1, 2, 3, 4, 5} Thanks AL
  2. W

    Resistance controlled voltage source (for led array

    hi all, I'm looking for a cheap (and by extension simple) circuit. i have a special pot (Piher's 10mm hex PT-10) that can't be changed. the pots can be physically changed but i have to use this type. the series has a 150mw power rating, with resistances of ...
  3. H

    Checking then removing duplicates in array

    Well, the title pretty much sums up my question. public static int[] removeDuplicates(int[] x) { for (int i = 0; i < x.length; i++) { for (int j = i + 1; j < x.length; i++) { if (x[i] == x[j]) System.out.print("Found a duplicate!"); } } } I...
  4. G

    C/C++ Need help in putting data into an array in c++

    Hi guys, I need to create an array in c++. But before I declare how many elements are in the array I want to prompt the user for input. I want to ask the user how many elements do they want in the array. What ever the user said, 5 or 20. I then want to enter these 5 values or 20 values...
  5. H

    Copying arrays/assigning the 'value' of the array to another.

    int[] aCopy = new int[a.length]; for (int i = 0; i < a.length; i++) aCopy = a; Is this the way to 'copy' an array? Basically, I want the elements inside the the array [I]a to be copied or assigned to the array [I]aCopy.
  6. J

    Fortran Array arrangement in Fortran 77

    Hello, I am working on a Fortran 77 program for my computational physics course in which the program is an averaging of distances walked by a number of walkers for an nth step. I have started the calculations of the program by having an input seed generate a sequence of pseudo-random numbers...
  7. Saitama

    Comp Sci C++ Array Interchange: Solve Homework Problem

    Homework Statement Write a program to read an array of elements and interchange each element with the next one in the following manner:- Example:- Input:1 2 3 4 5 Output:21435 Homework Equations The Attempt at a Solution I have almost reached the solution but i am still...
  8. M

    Generating a Random Number from an array for a blackjack simulator-Matlab

    Generating a Random Number from an array for a blackjack simulator--Matlab I have a homework problem where I have to generate a single hand of blackjack to a player and allow the player to hit or hold. I'm ahving trouble generating the random card. My attempt: x =...
  9. L

    Fortran Fortran - compilator dependent, intrinsic array manipulation, memory problem

    Welcome all, I have a following code: program aaaa implicit none double precision, dimension(:), allocatable :: inp,outp integer ::n,i read(*,*) n allocate(inp(n),outp(n)) write(*,*) allocated(inp), allocated(outp) write(*,*) inp(1) inp=cshift(outp,-size(outp)/2)...
  10. stripes

    Comp Sci Declaring an array in a for loop (Java) or similar

    Homework Statement I need to create a loop that asks the user to input double numbers into an array. The number of elements in the array is not predefined; the user will continue to enter numbers as long as they wish until a NEGATIVE number is entered, at which point the control will exit...
  11. M

    Sorting 2d array with qsort, keeping rows in order (C)

    I have been trying to get qsort to sort the rows of a 2d array I read in from a data file, and I have not been having much success to get it to do what I want. My array is a 4xarraysize array, where arraysize is the number of columns read in from a data file, with four entrees per row. I...
  12. A

    Not sure how to start a Pseudo for an Array

    I am VERY new to this, i am trying to start a pseudo code write where i need to make an array. I have my flowchart done (at least i think i do ) but i am not sure how to actually start the code. The examples my teacher had are confusing and he is not answering my emails. I have to write pseudo...
  13. S

    Insert new element to array and how shift char type

    Homework Statement struct student { char name[20]; int id; float gpa; }; student a[20]; Homework Equations insert another element into the array a. The Attempt at a Solution #include<iostream> using namespace std; #include <stdio.h> #include <string.h>...
  14. L

    Array of underwater transducers for sound massage

    hello, since a while my mind is caught by an idea. This idea is concerned with underwater sound massage system. For this purpose i would like to build an array of underwater sound transducers, which can all be steered individually (to do a coarse beam forming). However, since i am...
  15. A

    Comp Sci Understanding Java Recursive Array Reversal

    supposed to reverse an array of strings recursively. this is in a class that has an array object. i came up with what's below. but it reverses the array in a weird order. the array is a 5 element array, the elements are {hello, how, are you, ?}. i passed in the object and after printed out...
  16. U

    C/C++ C/C++ question, const versus #define for defining array.

    I know that it's often considered better practice to use C's "typed constants" instead of "#define" as it may offer better error/type checking. I'm wondering however what happens if a const is used to declare the size of an array. For example consider the two possible methods below. #define...
  17. S

    Struct array memory layout of the elements

    hi every one , i am new in data structure course i need help in this : Struct Person { Char name[20]; int id; float gpa; }; Person student[5]; Compute the addresses of all the elements of array student and show a memory layout for the array if the address of the first...
  18. 1

    Fortran Fortran 77 making an array but changing the increment value

    Hi I have an array going from 0 to n (where n has been previously defined) but I want the array to be in steps of 5 rather than increasing each value by 1 eg 0,5,10,15,20,25...n how can I do this? Thanks
  19. J

    Replacing specific array elements in IDL

    Replacing specific array elements in IDL - solved! Hi I was just wondering if there was any way, other than using FOR loops, to replace specified elements of an array? For example, say A is a 1D array of 50 elements, each equal to 1.0. Is it possible to change say elements 0-9 and 30-49...
  20. M

    What is the difference between the two selection sort algorithms?

    I'm trying to understand a sorting algorithm (selection sort, to be exact). I started out with this: public static void selectionSort1(int[] x) { for (int i=0; i<x.length-1; i++) { for (int j=1; j<x.length; j++) { if (x[i] > x[j]) { //... Exchange...
  21. J

    Solve Function & Array Exercise for Students

    Dear please read this exercise and the codes and tells me what wrong with you codes Part 1 You are provided with a skeleton program, where the data is stored in arrays. Your task is to add the code that will do the following: Examine the data in the arrays. The data shows the results from...
  22. Y

    E and H pattern of 2 element antenna array.

    This is not a homework, too old for that! I just have a question that I create myself. All the books only show the pattern that is more obvious...they show either the E or the H pattern. I took an exercise that asked for the H pattern, in turn, using the pattern multiplication to try to find the...
  23. S

    Building a Plot with Array Data: A Challenge

    Hello. I've got an idea to build a plot in real time. What i want to do: 1) I've got a row (array) of numbers 2) for these numbers i calculate values of the expression i want to plot, put them into array, 3) use list plot or smth like that with the row and the array. The question is : how...
  24. R

    What's the purpose of an array?

    I know what an array is and what it does. I'm just having a hard time getting the concpet on how it is useful.
  25. Z

    Fortran Increasing Size of FORTRAN Array without Reallocation

    Is it possible to increase the size of an already allocated array in FORTRAN, without reallocation? e.g. if in start A(3)=[4, 5, 6] and now I want something like A(4)=[4, 5, 6, 7]. Currently I am using a temporary array to do this allocate(A(3)) A=(/4, 5, 6/) allocate(temp(3)) temp=A...
  26. M

    Comp Sci What does the error T does not match T mean in my Java code?

    I am getting compilation errors in the following segment of my code: _underlyingStorage was declared in the following way: private T[] _underlyingStorage = (T[]) new Object[128]; public T next() { _currentIndex++; if(_underlyingStorage[_currentIndex] ==...
  27. 1

    Fortran Fortran 77 help making an empty array (or blank list if they exist in fortran)

    I need to create an empty array but the length of the array is determined by the start and end numbers entered by the user for example if the range of numbers the user was interested in was 4-10 inclusive then i want the array to be of length 7 How to I go about doing this? Other...
  28. U

    Is it possible to build a mirror array with adjustable focal length?

    Is it possible to build a large mirror array (around 10 km²) with adjustable focal length (from 10 meters to around 400 kilometers)?
  29. D

    Optimal Tilt Angle of Solar Array

    Hello! I have a difficult problem I have been working with recently. I have been trying to model the ever changing position of a solar PV array system. The system is a single axis tracker and orientates itself to have the smallest angle of incidence(AOI) to the suns beam as possible (the best...
  30. A

    Fast Maximum Value Computation in CUDA C Arrays

    I was wondering if anyone knows a fast method of finding the maximum value in a Cuda C array. I can't get max_element to work, but not sure its very fast anyways. I know I could do a for loop, but for an array with 100,000+ elements (smallest cases) it takes a lot of time (plus it has to...
  31. L

    Split Numerical Array of 100 Integer Values 0-99

    Homework Statement Define an array with 100 integer values, and fill the array with random numbers in the range from 0-99. Then write a function named split () that reads the array and places numbers from 0-50 and another array that places numbers from 50 to 99. I wrote this code which...
  32. T

    MATLAB Counting Occurrences in a 2D Array with MATLAB

    Hey peeps, I was bored the other day and wanted to paint something, so I started tweaking images in mathematica to make them eaiser to paint/draw and I came across de jong attractors and the following http://flam3.com/flame.pdf" . Basically I immediately remembered I had forgotten most of...
  33. B

    MATLAB MATLAB newbie: how to index a string array?

    I'm a Matlab newbie. I have an array of strings, for example: header = {'Fred', 'Tom'} When I do: header(1) I get 'Fred' I want to be able to change elements--for example: header(1) = 'Jill' But I get this error: ? Conversion to cell from char is not possible. I would be...
  34. W

    How can I override my instance variable of array type

    Hi All, Sorry to bother anyone, but I have run into a inheritance problem. I have a base class which contains a member variable of array type, and an abstract method. Subsequently I created a sub class which derived from the base class. And I provide implementation for the abstract methods...
  35. D

    Calculating Solar Array Orientation: A Guide for Scientists

    Hello! I was hoping someone on this board might be able to point me in the right direction to solve my problem. I am trying to determine how the tilt angle (from the horizontal) and azimuth of a solar array changes as the array rotates around a fixed axis running from north to south. The...
  36. M

    Fortran How can I store values for every iteration in FORTRAN 90 using arrays?

    Well the issue here is that I will have 21 numerical values written into one array,but then goes iterative procedure and get 21 values for model 2.How to write l(m0),l(m1)?I will need these arrays later for calculations.
  37. G

    MATLAB Problem storing array value in MATLAB

    I have the following function function [W] = calcw(k1,k2,d,x) if x<d W = k1*x; elseif x>=d W = k1*x+2*k2*(x-d); end; save('varw.mat'); with the following script k1 = 10e4; k2 = 1.5e4; d = 0.1; x = 0:0.01:0.3; weight = calcw(k1,k2,d,x); plot(weight,x); but...
  38. T

    Why is the array not reading from the txt file

    help me with this vector program i want to create a program that will have an arraycalled array1[] of 30 sets of 3 one digit numbers i.e 804, 450,430 etc) i will have 13 vector containersor arrays defined with a series of 3 one digit numbers. i want the program to find any series of numbers...
  39. R

    Mathematica Mathematica Circular Shift of Array Elements

    Hi All, does anyone know of a mathematica function that efficiently circularly shifts all array elements? e.g. {1,2,3,4,5} -> {4,5,1,2,3} without iterating? The reason I ask is because I have a huge data set I'm working with and right now iterating through is very processing intensive...
  40. R

    Finding word in a two dimensional array

    Hi, I have a question about C.In a two dimensional array ,I will search a word (not a letter).Do i have to use pointers?
  41. U

    Spatial Wavelength of a Halbach array (Magnetism)

    Hello everybody Basically as the topic states: How can you calculate "The spatial wavelength of a Halbach array" (symbol lambda)? Context: The reason I ask is that since I've got bored during my easter holidays I decided to try a wee science project and try and make a model of an...
  42. C

    MATLAB How to load a non-rectangular array into MATLAB?

    We have a sensor in the lab that measures two quantities and uses two different sampling rates. All four of these vectors are saved into the same text file. How can I load this into MATLAB when it is non-rectangular? Thanks for your help.
  43. H

    Comp Sci Troubleshooting Array Lists in Java

    Homework Statement Input a list of n integer values into a 1-D array and do the following: • determine and output the number of positive values and the number of negative values • update the array values as follow • if the value is located at an even-numbered subscript, replace the value by...
  44. D

    LED Array Power Source Problem

    Greetings, I am rather clueless about this stuff so I'll leave it to you guys to come up with any bright ideas for this. I'm building an array of LED's for my high school that flash to music. I'm using a TIP31C transistor to get this effect. My problem is they're wanting a 1 foot by 1 foot...
  45. N

    Mathematica Creating Simple Arrays in Mathematica for Beginners

    Hello, I have a list {a,b,c,d} and i want a array of the form: {{a,b},{b,c},{c,d}} I think it is easy, but I'm new in mathematica and I don't know what funtion to use. Thanks.
  46. A

    Mathematica Mathematica: array of functions

    Hi intelligent people, Forgive me for a silly question, but I am really new to Mathematica and thus I need your help for my own research (I am done constructing NIntegrate values for some "non-integrable" functions, involving multiple steps, and I am kinda stuck at the last step. Here is the...
  47. A

    Fortran Fortran, subroutine with allocatable, intent(out) array

    Hi, I have a rather large program written in fortran 77/90. In one of the subroutines a lot of local dynamic arrays are declared. In order to make this program able to calculate more stuff, I need to bring these dynamic arrays back into the main program. I have tried to define the...
  48. S

    Fortran Fortran: Pointer to array section with vector subscripts

    Hi. I'm trying to make a pointer point to sections of a rank-2 array given by specific values of it's second index. I other words: given a table I wan't a pointer to point to specific columns, making of it a "filtered" table. The method I was trying was like DOUBLE PRECISION...
  49. G

    The Answer: Solutions to Array of Capacitors Homework

    Homework Statement An infinite array of identical 1-microFarad capacitors are arranged in a grid setup, where junctions are between capacitors, and each junction is connected to 4 other junctions separated by another capacitor. The array is initially uncharged. A battery is connected...
  50. C

    Can't put .txt file into an array

    I'm trying to input a .txt file with a variable number of rows and 3 columns into an array. The first row is just a single number expressing the remaining number of rows. so we have something like this 3 3 5.12 3 5.3 3 5 4 3 4 All the individual numbers are separated by spaces. So far...
Back
Top