Array Definition and 481 Threads

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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; }...
  12. 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...
  13. 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
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...
  21. 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...
  22. 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...
  23. 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...
  24. 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...
  25. 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.*; /** *...
  26. 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...
  27. 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?
  28. 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...
  29. 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...
  30. 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...
  31. 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...
  32. 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...
  33. 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...
  34. 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)?
  35. 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) =...
  36. 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...
  37. 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
  38. 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...
  39. 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...
  40. 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...
  41. 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...
  42. 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...
  43. S

    Why Won't My C Program Compile for Finding the Smallest Integer in an Array?

    Homework Statement I am writing a program so that a user can input up to ten integers and then sought through and print the smallest from that input i.e. enter in up to ten integers: "7 5 6 19 4 8" the smallest number is 4 Homework Equations The Attempt at a Solution...
  44. C

    Comp Sci Finding the Location of Two Elements with a Sum of 100 in an Array of 3 Elements

    I have an array of 3 known elements.I know that 2 elements of them have the sum of 100 and I need to find the location of the two elements which have this sum ex. A[3] 5 25 75 the solution for this prob. is second & third location Thanks,
  45. M

    PCSPIM - declaring an array of strings

    Hey all, So declaring integers successively in memory (using .word) in an array is all well and understandable. Since an integer is 4 bytes in length, as is a memory word. For example: .data x: .word 2, -13, 24, 123 #initialization of elements 0 to 3 of array x However, how would...
  46. P

    Updating a JLabel with an integer array

    halfway through my code so its a bit of mess but this is simple what i need to do. I have a JLabel array of 6 labels. a random number is generated, its then split into its digits into a 6 element array of integers. now i need to update the Jlabels with the integer array of digits. my...
  47. T

    C/C++ [C++] Declaring an array within a loop

    The following code block is in C++ Everything is inside the first for loop. for( int i=0; i<=2; i++) { int a[3]={0}; for(int j=0; j<3; j++) a[i]=j; for( int i=0; i<=2; i++) cout<<a[i]; cout<<endl; } basically I am trying to get the screen to output...
  48. N

    What alternatives can be used instead of dynamic arrays in Verilog and Quartus?

    hello everyone I know that dynamic array is not supported in Verilog and Quartus. I want to know does anybody has an idea or algorithm to use instead of dynamic array. I mean I am searching for something that works instead of a dynamic array. thanks
  49. V

    Fortran [Fortran] Passing elements of array to subroutine

    I have one main program where I have calculated some array, say A(i,j) If I want ot use the values in subroutine, and calculate some more values and give back the result to main program, how my syntax should be? I tried this way. Its not working. program a...
  50. M

    Deleting an entry from an array in MATLAB

    I want a code in MATLAB that produces A\{4}, where A={3,6,1,-3,4,8}. I know for instance: A=[ 3 6 1 -3 4 8]; A(5)=[]; produces 3 6 1 -3 8 But what should I do if I don't know the index (in this case 5) for the entry '4'; and I want to get [ 3 6 1...
Back
Top