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

    Can a DIY bolometer be used to create an IR viewer for aircraft?

    How is a pixel array read, such as in a LED TV, digital camera, microbolometer, etc. All of these things have an array of pixels that either transmit or receive. Each pixel must be read somehow, is this done with a multiplexer and do you need more and more multiplexers the more pixels you...
  2. J

    Find the median of two sorted arrays

    Well ... I completely failed that job interview. That was one of the programming questions. He said I answered it completely wrong.
  3. F

    Is there a library for table arrays?

    Hello For a software on which we are currently working we need a .net library for reading/writing array of data tables from/to relational databases. Is there such a library for .net? Tunc
  4. U

    Basic arrays, not sure if i'm right

    Homework Statement First of all, i wrote this code but i can't seem to get xcode to work on my mac and i'll only get to school in 2 days time, while this needs to be completed before school! I'm using xcode on Mac, programming language C. Here's the question: (a)Using a for loop...
  5. Biosyn

    Comp Sci C++ While Loop with Arrays

    Homework Statement Homework Equations The Attempt at a Solution #include <iostream> #include <cstdlib> using namespace std; using std::cout; int main() { int sum=0; int Array[] = {1,2,3,4,42,5,6}; // int Array[] = {42,1,2,3}; // int Array[] = {12,-10,42,10}; // int...
  6. V

    Programming in C question. Printing Arrays

    Homework Statement Alright, I actually solved this problem myself, it is just ugly and hilariously inelegant. I won't lose points since it is an introductory course, and it technically works, but I wondered what the "right way" to do this is. Here is what I had to do. Create an array where...
  7. A

    C Programming: Dynamic allocation of 2D arrays using an array of pointers.

    Homework Statement Ok, I'm learning C programming and I'm trying to create a dynamic 2D array. This is the code that seems to work in creating a dyamic array. I found it in a book. //rows and cols are values entered by the user when the program runs. int **(matA) =...
  8. F

    Dot product between arrays: basis representation of an image

    Hello Forum, When we represent a vector X using an orthonormal basis, we express X as a linear combination of the basis vectors: x= a1 v1 + a2 v2 + a3 v3+ ... Each coefficient a_i is the dot product between x and each basis vector v_i. If the vector x is not a row (or column vector)...
  9. N

    Comp Sci Find primes using sieve of erasthothenes by way of bit arrays in C++

    Hey. I have to create a program in C++ to calculate the number of prime numbers up to a specified number. I also have to print out the first and last 5, but I'll cross that bridge when I come to it. I can do this fine with integers, but we have to do it where each slot in an array represents...
  10. L

    MATLAB Producing arrays to plot (MATLAB)

    Hi everyone, my code is a little rusty and a work in progress but I was wondering how I would go about producing arrays for the calculations performed in the while loop for the analyses so they can be plotted. I have the following parameter input; G0 = 50; v = 0.25...
  11. M

    Java JavaScript arrays and loops combination question

    var lost = [4, 8, 15, 16, 23, 42]; var count = lost.length; var isLost = function (n) { for (i=lost[0]; i<count; i=lost[i+1]) { if ( n === lost[i]) { return "true"; } } return "false"; }; is it possible to in corporate array positions into the for loop? (i) do...
  12. S

    F90 arrays in namelists w/o abc(2,3)=44.4 notation

    I wrote a program that writes arrays in a namelist under MinGW in Win7. The array is 100x2. It is written in two columns, alf(*,1) and then alf(*,2), where * means 100 row elements. It puts out the name of the array followed by a lot of numbers without any alf(1,1), alf(2,1), ..., alf(1,100)...
  13. P

    Adding/Subtracting arrays in F77

    Hey, I'm new to fortran and I don't know how to add arrays. I opened a data file and assigned a different array to each number but if I type something like x(2)+x(3) it will not yield a result. This is probably a stupid question but thanks for any help you can offer.
  14. R

    Arrays and recursion in mips assembly language

    Homework Statement Write a MIPS assembly language program that accomplishes the following tasks: 1. The program will prompt the user to enter an Integer between 1 and 10. If the entered number doesn’t satisfy the above condition, use a loop and prompt the user for a new entry (until a valid...
  15. A

    Fortran Saving Data in FORTRAN Arrays: A Guide

    Dear Sir, I am using FORTRAN. I have little experience and i am facing one problem. I want to store data (i.e. X and Y values) in an array (A(900),B(900)) in such a way that at first I used only 30 elements of each array for storage 30 initial values of X and Y and then I have some...
  16. lpetrich

    C/C++ Associative Arrays in C/C++ - Favorite Strategies?

    Associative Arrays in C/C++ -- Favorite Strategies? I mean by that something like what Perl or Python or Ruby have, a.k.a. dictionary types. I can do it in Mathematica with the help of label[key] = value and Head and DownValues, but it's C/C++ where it is the most difficult of all. I once...
  17. S

    Algorithm Complexity: Sorted Arrays into Sorted Array

    Homework Statement We have k >= 1 sorted arrays, each one containing n >= 1 elements (all equal length). We want to combine all of them into a single sorted array with kn elements. We have a "naive" algorithm: merge the first two arrays, then merge the third array into the result, then merge...
  18. G

    Comp Sci Java Class Arrays: ArrayTest Method

    Homework Statement Create a Java class named ArrayTest with a method called arrayCombiner that creates three arrays of size 10. The first array should contain the values 1, 3, 5, 7, 9, 11, 13, 15, 17, and 19. The second array should contain the values 2, 4, 6, 8, 10, 12, 14, 16, 18, and 20...
  19. N

    MCNP Input of Voxel Arrays and Their Universes

    Hi I have problems in mcnp input of voxels. I define a voxel arrays and their universes,for example universe1 is defined as: 2001 43 -1.030 -70 u=1 vol=6.795352 but in runing I have below error: fatal error.the surface type is not recognized: -1.03 While 1.03 is the density of...
  20. E

    Understanding Arrays and Their Role in Converting Light into Data

    Hi all, I've been reading on how arrays (eg. EVLA) turn light from space into data, but I don't really get it. I know it has a lot to do with Fourier Transforms, but I can't find anything that gives a good and simple outline as to why they're used. And then once it's been transformed it needs...
  21. S

    Question on 2d charge arrays

    Homework Statement Derive and simplify an expression for the electrical potential energy of the charge configuration. It's an equilateral triangle with charges +q, -q and +q. Homework Equations Ep=Kq2/r The Attempt at a Solution I know how to do this with squares (it's basically...
  22. P

    C: 2D arrays with structs and pointers

    I wanted to make a variant on having a player just walking around a small 2d map. Instead of having 2 variables to store the current x and y values of the player position in a certain array, I want to make a 2d array that is filled with NULL pointers. Then the player would be represented as a...
  23. R

    C# GORITHMS AND SOLUTIONS FOR LEARNING C# ARRAYS

    Has anyone got any good problems with solutions that would be good for helping me learn about arrays in c#? Thanks AL
  24. T

    MATLAB Matlab 3D plot using arrays in if/else

    Dear fellows, I am trying to plot a 3D graph, determining the x and y values using an array and the z values using if/else. This is the code I am playing with but I can't get it to work: xmin=-1000; xmax=1000; division=1.0; num=((xmax-xmin)/division)+1; for i=1:(num/2)...
  25. M

    Comp Sci FORTRAN Help: Using Functions and Arrays

    Alright, so I've updated it once more... The only thing I need to do is figure out how to convert the functions x_data, y_data and choi_1 that store all 3 of the inputs I need for the main program and other functions. program calculator IMPLICIT NONE REAL :: addition, subtraction...
  26. M

    How can I simplify my sorting class and user input for my TestStudent program?

    I'm having issues with a sorting class that I'm trying to call from my main program, TestStudent. I don't think it's taking the user's input correctly when I try to read it into an array but I can't figure out why. class Student: public static void selectionSort(double[] numbers) {...
  27. J

    Fortran What could be causing a dynamic space array error in a Fortran 77 program?

    Hi all I am trying to run an executable compiled from some Fortran files (not my own), which look like they are written in Fortran 77. One of these includes some dynamic space arrays, where the number of elements depends on an integer value passed to the subroutine, e.g. subroutine...
  28. N

    Matching orientations of 2-d arrays of values - using fft?

    Matching orientations of 2-d arrays of values -- using fft? I was discussing the following problem (a subproblem of a personal project I'm working on) with a professor: we're given two 2-d arrays of values. We know them to be identical, but they might not be oriented corrected -- i.e., 0 0...
  29. S

    Fortran Fortran 95 Reading in Multi-Dimensional Arrays

    Hi. I have a file like this: 1990 01 01 0000 27 16 1990 01 01 0100 25 15 1990 01 01 0200 24 16 1990 01 01 0300 24 16 1990 01 01 0400 22...
  30. Saladsamurai

    MATLAB Efficiently Use polyfit() on Arrays for Accurate Curve Fitting | MATLAB Guide

    I have 2 arrays: vxb = 0.0001 0.0001 0.0001 0.0002 0.0002 0.0003 0.0003 0.0003 0.0003 0.0003 0.0003 0.0004 0.0005 0.0005 0.0005 0.0005 0.0006 0.0006 0.0006 0.0006 0.0006 0.0006 0.0007 0.0007 0.0007 . . . and...
  31. T

    MATLAB How to Create a Multiplication Matrix in MATLAB?

    Hi, I'm new to MATLAB and I have a problem: I am trying to create a multiplication matrix of sorts. The first row will have numbers from 0 to 1 in steps of .0101 The first column will have the same, from 0 to 1 in steps of .0101 Then to generate the rest I will multiple each entry in the...
  32. S

    C/C++ C++ Help: Sorting with Arrays & Merging Strings

    I'm working on programming my own sorting code in C++ using the divide and conquer algorithm. I'm a novice programmer and I've gotten a little stuck. Let's say you begin your code with an array of distances, dis[4] = {dis1, dis2, dis3, dis4} Then I want to separate this array into...
  33. K

    MATLAB Matlab Cell Arrays Help | Get Expert Assistance Now

    Hi Matlab community and clever people I desperately need help in matlab. My data are stored as cell arrays (1x48 cells). Each cell contains 5 cells {1,1}, {1,2}...{1,5}. Cells {1,1} contains image name and {1,3} contains onsets time. I need to create a simple matrix in MATLAB with 6...
  34. R

    Inputting to Char Arrays from Keyboard - Linux/GCC

    Hi,I have a question about C.I have declared two char arrays.I want to write one string through one line to take them first array.When ı touch enter and go to next line ,it will place my charecters which have been given later touching enter to second array.What can I do this? ,please help me...
  35. M

    Fortran Solving FORTRAN 90 2D Arrays Program Pr2

    program pr2 implicit none integer:: i,j real, dimension(21,80) :: istat open(7,file='sens.dat',status='old',action='read') read(7,*)((istat(i,j),i=1,21),j=1,80) write(*,*)istat end Where is the problem?Input file has 1680 values.But I get...
  36. W

    Fortran Help with declaring arrays in Fortran 90/95

    I have an assignment to calculate the least squares fit line to a set of points, and I have to read in an arbitrary number of points from the user So my plan was to have the user enter how many elements they have, and then create an array with that many elements. So let's say I read the...
  37. J

    Mathematica Mathematica and large data arrays

    Hi, I have imported a data set from EXCEL that is 18 columns wide and 25 rows long. Each row of data appears within it own set of brackets as expected. I am able to pull out individual elements of the array. However, I want to plot column 2 vs column 4. How might I extract those two columns...
  38. T

    Beginner VBA Help Using Arrays to find the lowest value from a list

    Hi, I have this text file. "3 4 7.21 -5.7 0.01 9.0 5.6 0.11 -.123 14. 2.11 4.11 0.0001 -2. " I am trying to create a VBA program to find the Minimum value, but I keep getting an error. Could someone help me? I am trying to get some practice for a test. Here is what I have so far...
  39. mnb96

    Distance on arrays of unit-quaternions

    Hello, let's take the algebra of quaternions \mathcal{C}\ell_{3,0}^+ and consider only the sub-algebra of unit-quaternions. When we wanted to define a https://www.physicsforums.com/showpost.php?p=2911801&postcount=6" we used the fact that unit-quaternions lie on the \mathcal{S}^3 sphere...
  40. V

    Comp Sci Java: Solving the Arrays Dilemma

    hello all, I was given an assignment on arrays, here is the task: Write a program that inputs an array of 10 integers from the user, and removes the duplicate array elements. You may assume that all the integers are between 0 and 100, and you may input them from the user however you wish. The...
  41. C

    Writing Assembly LC2 Program to Calculate Dot Products of Two Arrays

    how to write an assembly program to calculate the dot products of two arrays ?? Thx Anyone know how to write an assembly program (source code) to calculate the dot products of two arrays with LC 2 ? Given: The size of each array is 15 (a[0],...,a[14] ; b[0],...,b[14]) that are stored in...
  42. V

    Fortran Memory storage of multidimensional arrays in fortran 90

    Hello, I think i heard somewhere that a multidimensional array in fortran 90 may be stored non-contiguously in memory. Is this true? Even if it the size was known at compile time? If your answer is it depends on a compiler, what about ifort and gfortran?
  43. D

    MATLAB First time with matlab, inputting cell arrays into function?

    Hi I am currently trying to program something that will accept a vector as input for one my function. However, this is my first time programming, and I am relying completely on the internet and the Chapra textbook for help. This is what I have so far: %Re=reynolds number %p = density of...
  44. J

    Creating & Populating String Arrays in C

    I'm new to C, so this is probably a dumb question, but I'd appreciate help. If I create (or think I create, anyway) an array of strings with: char *array_name[10] and then try to populate an element of the array with: gets(array_name[0]) everything compiles ok, but I get a runtime...
  45. 4

    How to randomize arrangement/order of output in C? (arrays)

    1. Homework Statement Hi I'm using C and I need to use arrays on this one, but I need to somehow randomize the output.2. Homework Equations for example an output "abcde" could also have an output "bcade" possible 3. The Attempt at a Solution #include <stdio.h> main() { char word[27]...
  46. Y

    Mathematica Declaring/filling arrays of arbitrary size in Mathematica

    edit: Forgot to add Mathematica in the title. Sorry! Hi everyone. I mined a lot of data and want to analyze it in Mathematica. The data is of the form {{x11, y11, x12, y11, x13, y13},{x21, y21, x22, y22}...} meaning that each set of x,y pairs is not necessarily the same size...
  47. E

    How Does a Pointer Behave Like an Array in C Programming?

    So I'm learning C, and I think I'm doing pretty well so far. Anyway, I'm up to Arrays, and some code that was posted in the tutorial is this: #include <stdlib.h> int main() { int* myArray = malloc( sizeof(int) * 20 ); // could write int myArray[20]; instead. myArray[5] =...
  48. D

    MATLAB Comparing multi-dimensional arrays- matlab

    Comparing multi-dimensional arrays-- matlab So I need to be able to tell if these multi dimensional arrays have the same numbers using the all function and one logical operator: A = [ 5 6 8; 8 0 0]; B = [ 5 7 8; 8 0 0]; C = [ 5 7 8; 8 0 0]; I am stuck and can't figure out a way...
  49. M

    MATLAB MATLAB: cell arrays of function handles

    Hello I am trying to store function handles in an array. First attempt was to do something like the following: for i = 1:5 r(i) = @(x) [grid(i) - x(1)*(x(2) + value(i))]; end So I would store 5 function handles, each one using the <5x1> vectors "grid" and "value". Result: Nonscalar...
  50. A

    Pointers and multidimensional arrays in C

    /* Demonstrates passing a pointer to a multidimensional */ /* array to a function. */ #include <stdio.h> void printarray_1(int (*ptr)[4]); void printarray_2(int (*ptr)[4], int n); main() { int multi[3][4] = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }...
Back
Top