Array Definition and 501 Threads

  1. A

    How Do You Calculate the Memory Address of Temp[40,30,20] in a 3D Array?

    Homework Statement The problem is finding the memory location of a three-dimentional array Temp. Each index of temp goes from 1 to 100 and each element stores 4 bytes. The array is setup such that the last index varies fastest, aka: Temp[1,1,1], Temp[1,1,2], ... Temp[1,1,100]...
  2. P

    MATLAB - forming an array of sums?

    Hi, Homework Statement I am asked to evaluate the following sum S=Sigma(n=0 to N) x^n/n! (namely, e^x as n->Inf) for N=10:10:100 and x=10, so that every element S(i) is a partial sum which approximates function e^x with different accuracy. Below is my code, which doesn't work. Homework...
  3. B

    C linked list with an array inside

    I have pasted my code here : http://pastebin.com/nMNarH9i It is in language C. Basically, I am reading in 5 numbers at a time. Putting these numbers in array one_vote_array. Then I need to put this array in a structure vote_node. I also then change my next pointer in the structure to head...
  4. C

    [C] Errors passing bidimensional array to a funcion

    Hi I have these functions: void posicaoIfElse (int e [][n], int i, int j, int k, int m, int n) { ... ... } void posicaoFormula (int e [][n], int i, int j, int k, int m, int n) { ... ... } that I calls through posicaoFormula (e,i,j,k,m,n); printf ("\n"); posicaoIfElse...
  5. T

    MATLAB Passing 3D Array from Fortran to Matlab

    Hello! I'm working in a programm which has a 3D array with a DIMENSION(16,221,900). When I use the debugger option and I print out the value of the matrix I don't know how to read the info. I already know Fortran uses column-major order, storing the columns in sequence. My doubt is...
  6. marellasunny

    Store equilibrium points of a 3D system in a (x,y,z) array

    I have a complicated 3d nonlinear differential system which I solve algebraically using maple's solve command. I aim to find the equilibrium points of the system using MAPLE and then plot these equilibrium points as a function of the 3 parameters alpha,beta,gamma(a.k.a.bifurcation diagram). The...
  7. B

    Fortran Fortran, passing an array to multiple subroutines

    Hi guys, I am kind of a newbie to fortran and I'd like to ask a simple question. In the code below, I have a main program with one subroutine. It's a simple one. In the main code I am filling an array with elements from 1 to 10. Then I am passing this array to a subroutine "sub", where...
  8. L

    Matlab - What does an array definition mean

    I'm trying to make a MATLAB plot with two types of data, i.e. temperature and air flow rate. Since the temperature and air flow rate are on different scales I wanted two y-scales and since there are quite some data sets, I wanted to make the two air flow rates bold. I tried this, but it doesn't...
  9. P

    MATLAB Organizing & Extracting Data from a Large Array

    Hello there, Let's say I have the following array: (what interests me in the array is the first column) 1 5 9 1 4 9 1 8 9 1 9 6 2 5 6 2 4 8 2 4 7 2 6 9 2 3 0 2 0 4 3 5 8 3 4 8 3 9 8 4 8 5 4 8 9 4 8 5 4 3 9 4 8 7 5 8 9 5 8 9 5 4 8 5 7 8 5 6 2 ... and so on...
  10. J

    C/C++ [C/C++] Using a double pointer to create a multidimensional array

    Tomorrow I'm taking a programing assessment for a potential job. I was wondering whether, if I ever have to create a 2-D array for one of the challenge problems, I should use the method here: http://stackoverflow.com/questions/13974001/two-dimensional-array-implementation-using-double-pointer...
  11. C

    Why Does My LED Array Convergence Fail in Falstad's Circuit Simulator?

    im using falstad and my knowledge on circuits is poor or extremely basic.. $ 1 5.0E-6 34.14951009862697 50 5.0 50 162 512 288 816 288 1 2.1024259 1.0 0.0 0.0 162 544 288 896 288 1 2.1024259 1.0 0.0 0.0 162 576 288 960 288 1 2.1024259 1.0 0.0 0.0 w 896 288 816 288 0 g 960 288 960 240 0...
  12. Vorde

    C/C++ Solving C++ Array Issue in Matrix Program

    Hello all, I'm not really a programmer at all, but I learned c++ for a while so I can do basic stuff. Having just finished my linear algebra class I suddenly had an urge to write myself a simple matrix solver. I knew it wouldn't be easy (especially because of my lack of skill) but I was...
  13. S

    Advice on building very primitive phased array radar

    Hi, I am interested in building a very primitive phased array radar for short ranges(1m to 100m). I thought it's possible to use a simple 2.4GHz RF ASK transmitter, and by just sending a single '1' bit I could generate a pulse and then use a simple RF receiver for that frequency and analyze the...
  14. iamjon.smith

    Comp Sci Java Array Problem: Wizard/Elf Character with Random Health and Gold Points

    Ok, I have a java app that allows you to choose a class (wizard/elf) and is supposed to give a random amount of health (an array with 10 values) and 25 points of health. When I run the program it gives me the memory location from the array and not the value. I know I am missing something simple...
  15. B

    A problem when calculating the average of an array (c programming )?

    hi , I need to do the following Write a program that asks the user to enter a number. Then create an array of this size. Fill the array with random numbers between 0 and 10. Calculate the average value. I did the program but there is a problem in calculating the average . can some one tell me...
  16. C

    Allocating Array of Pointers to Struct Nodes Causing Crash?

    I need some help with this piece of code I wrote earlier, it is compiling correctly but when I try to use my tester program it crashes. I am trying to create an array of pointers to struct Nodes typedef struct Node *NodeP; struct Node { NodeP next; EmployeeP info; }...
  17. E

    C/C++ How to Pass a 2D Array in C and C++ for Numerical Computing

    Hi I have this small doubt. i am not good in C . i like to bring i,j,pi values to subroutine and bring back Asi to main program. how to write ! Plz help.. #include <stdlib.h> #include <math.h> double A_operate(int i,int j) void main() { double Ai, pi[10][10],r[10][10]; int i,j,n,m; n=6...
  18. S

    Fortran Multi-Dimensional array multiplication in fortran

    Hi; Is there anyone who knows multi-dimensional array multiplication in fortan ? such as; A(5,5,3,3) * B(5,5,3,3) thanks
  19. S

    How can I fix my program to properly delete elements from an array?

    Homework Statement Hey all. I have code that is supposed to delete the offset determined by the user and shift the elements after that offset to the left. My code works fine except for one problem: if the index is zero it terminates. I will post my code, and if anyone can see why it is giving...
  20. T

    Comp Sci Sorting array into ascending order in C++

    Homework Statement a. Define an array with a maximum of 20 integers values, and fill the array with numbers input from the keyboard or assigned by the program. Then write a function named split() that reads the array and places all zeros or positive...
  21. S

    C/C++ Boolean array to identify prime numbers - C++

    Hey guys, just looking for an explanation for the following algorithm. It is in my textbook, and there isn't really an explanation. I don't really see how the algorithm works, but I will add what I do know, and hopefully one of you can help. Thanks. //this initial declarations produces an...
  22. S

    How is this array of capacitors connected: Serie or parallel?

    Homework Statement The figure shows three capacitors with capacitances C1, C2, and C3. How are they connected: in parallel or in series? |------| |------| |.....| (middle dots don't mean any thing. they help keep lines in place) |---| |---| |---|Homework Equations Serie...
  23. trollcast

    Find most common value in an array

    Homework Statement Find the mode from a list of numbers or find the most common string in a list of names. Homework Equations The Attempt at a Solution def most_common_element(lst): lst.sort() mostcommon = [] mostcommonfreq = 0 prev = 0 count = 0 for e in lst...
  24. J

    Taking a slice of a two dimensional array

    The source of this question is an unanswered question at stackoverflow but I believe is more mathematical than computational. My question arising from this is. You have a two dimensional array of numbers, each element of the array is represented by a square box. The boxes arranged into a...
  25. R

    MATLAB How to determine if a row appears more than once in an array in MATLAB

    I'm working on a project for myself that I started some time ago. This question only covers a small part of what I am doing. In my program I have vertices that I read in from a text file. They are read and stored in a matrix where each row of the matrix is a facet (triangle) created by the 2...
  26. G

    Phased Array Radar: Scanning Volumes of Space Accurately Per Second

    Let's say I want to use a phased array detector on a satellite to detect other objects in space. The radar would need to be able to detect objects .5cm or larger, and would have to get an accurate read on their position (within 10-15 m). From there, the goal would be to maximize the volume of...
  27. M

    MATLAB MATLAB help: Interpolating an array of data to create a function

    Hi, As the title suggests, I have a 2D array of data. Essentially, I solved a DE using MATLAB and it gave me the array of x against t. I want MATLAB to create a function for me by interpolation so I can use it again (to solve another different set of DEs). I've been stuck on this for a while...
  28. H

    Fortran Array reading error when opening multiple files in Fortran

    Guys. I really need help. I have been working in this little problem for hours. I had a problem in array reading when I opened more than 1 files, it seems like an array with different names mixed each other. Here is my code integer, parameter::size=11 real, dimension(101) :: cldata...
  29. S

    Fortran [fortran90] have problem in real array index

    hi all...i have problem in understanding in array index. my codes are as below subroutine tmz2d implicit none double precision :: phi double precision :: cosphi,sinphi double precision :: d,dp,dpp,d1,d2 integer...
  30. O

    Programming project. blackjack, String array issue

    Not sure what's going one, as soon as I remove the line with String[] arraySuit... all errors go away. With that statement in I get errors on several lines. Cannot figure out what's wrong. /* * Semester Project * Blackjack Class */ package project; import java.util.*; /** *...
  31. J

    C#: Changing Values In an Array

    1.Before I start it is important to say that I only have two months programming experience so my capabilities are limited. I have been working on a C# code to solve general case verbal arithmetic problems, but I ran into some trouble with one part of the algorithm. If you are not familiar with...
  32. caffeinemachine

    MHB Array of numbers. Olympiad problem.

    The numbers $1,2,\ldots,100$ are arranged in the squares of a $10\times 10$ table in the following way: The numbers $1,2,\ldots,10$ are in the bottom row in increasing order. The numbers $11,12,\ldots,20$ are in the second last row in increasing order, and so on. One can choose any number and...
  33. T

    Fortran Can Fortran 90 Arrays Be Dynamically Allocated Based on a Variable?

    Hello forum, I was wondering if there is a way to declare/define arrays depending on some previously defined variable. example: if a=2, then declare/define 2 arrays if a=3, then declare/define 3 arrays If doable, how does one assign names to these arrays?
  34. V

    Fortran Interpolating & Integrating Data from File to 2D Array

    I have this code that i have been working on that will interpolate and integrate some data. I need to read this data from a file with unknown rows and columns to a two dimensional array/matrix so that the data can be broken down further into one dimensional arrays from the parent 2D array's...
  35. Fb.Researcher

    [C] multi-dimensional array allocation and using them in functions

    I am a beginer in C programming,so I have just became familiar with pointers.The problem I am writing a program to solve requires me to allocate a multidimensional array, reallocate it and use it in some functions.The simplest problem would be:allocating a two dimensional array, ask a function...
  36. V

    Programming in C, creating an Array user gets to input

    Homework Statement Alright, so for my engineering programming class I have an assignment where I have to create a program with an array, and then do things with the array, such as create a search function for it, and list how many numbers fall within a certain range, ect, ect. So I...
  37. T

    Comp Sci [Java] Generating a Time Array Problem

    Homework Statement I'm given a maximum time, a time step (or interval) and I'm supposed to form an array from 0 to the maximum time going up by timestep each time. double tMax; //maximum time double tStep; //time interval to go up by Homework Equations Our teacher told us to use the...
  38. twoski

    [nasm] Simple Array Reading Program

    Homework Statement Write a program in nasm which will read through a 5x5 matrix and print the largest value.The Attempt at a Solution I ran this through a debugger and for some reason $edi reaches 19 and sets $esi to 0. Which is weird since the value at [eax + edi * 4] should be 4, not 0. My...
  39. K

    MATLAB Matlab class array / other array

    Okay so what does this line of code mean: snleg = strtrim(cellstr(num2str(alf_deg.'))); I did some research and it is ultimately removing whitespace (comma's, spaces etc) from a file scanned in, but I don't understand the argument of the function. I don't understand what cellstr is or...
  40. S

    Implementation low pass filter on array

    hi guys: if i have signal(YT) consist of two frequencies(30 and 300 Hz),as the following: t=0:1/1000:1; Y30=sin(2*pi*t*30); Y300=sin(2*pi*t*300); YT=Y30+Y300; i want remove the frequency of 300 Hz from(YT) by using low pass filter so how can i do that(by using MATLAB command)?
  41. 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) =...
  42. T

    Java Returning a Correctly Sized Array for Dive Moves

    If I have a program where I need to return an array, is it possible that I only return the array with the length of what was added to it? What I mean is I have an array that gets filled up with letters but it doesn't always get completely filled up. Is there a way I can only return the...
  43. D

    Fortran Divide an Array into a Scalar in FORTRAN: Get Help Here!

    How can i divide elements of an array into a scalar. I mean, i have read my data file into a matrix in FORTRAN which this matrix is 1*3414. Then, I want that each elements of this matrix is divided to (24480*2). I will be so grateful if you guide me the appropriate function. Thanks a lot
  44. C

    Help with flipping tokens in 2d array othello/reversi.

    Homework Statement I am trying to flip tokens in my reverse code and I'm a little stuck so far I have a function that checks directions but I don't know how to implement it my code is below. Homework Equations The Attempt at a Solution /reversi.c //Samuel Gilbert...
  45. R

    Simple Proof for A-H Array Puzzle

    I was doing a brain treaser where the letters A-H had to be put into an array 2 by 4 such that no letter is adjacent or diagonal to a letter one unit different. That is a C can't be above, below, to one side of, or diagonal from a B or D. I solved the problem but the thought...
  46. C

    Update Array Elements from User Input | How-To Guide for Homework Assignments

    Homework Statement I have a simple 8X8 array with initial conditions. how would I go about updating the an element of this array from user input? Homework Equations The Attempt at a Solution for(i=0;i<MAX_SIZE;i++){ 24 putchar(i+'1'); 25 putchar('|'); 26...
  47. U

    Fortran Automatic array allocation in Fortran 95?

    The following code seems to run ok under fortran 95 (g95 compiler), but I was unsure about the exact nature of the array assignment. As you can see it is a variable sized array, without any explicit "allocate" command. The code works even when the array size could not be known at compile time...
  48. T

    Comp Sci How to Search and Replace Values in Fortran Arrays?

    hi i have two data sets one(data1) containing 3 8 2 1 5 7 9 9 2 2 5 7 7 10 3 6 6 6 6 and other(data2) containing 5 1 10 5 20 7 30 6 40 9 50 now i want my program to search the values 1 5 7 9 from (data1) in data 2 column 1 and then take the average of the...
  49. Dembadon

    Comp Sci Programming in C++: 3D array string copy

    Homework Statement I am making a Klondike style solitaire game, and I am trying to load a string into a 3D array. I am representing the "Tableau" with a 3D array (we haven't gone over structs yet). I want to represent the spaces which don't have cards with the word "empty". I'm not...
  50. CFDFEAGURU

    C/C++ Passing a VBA array to a C++ dll - Example Needed

    Hi all, In the book "Financial Applications Using Excel add-in Development in C/C++" 2nd edition by Steve Dalton in Section 3.7.2 Passing arrays and ranges from Excel to VBA to C/C++ and in that section a description of how this can be done is given. No example of how to do this is given and...
Back
Top