Array Definition and 501 Threads

  1. J

    Programable array logic (PAL) design

    Hi Im having some difficulty with one of my coursework questions on programable array logic (PAL) design. If anyone could help with this it would be very much appreciated! The question is- Decoding logic is to be used to generate a logic 1 when the counter output indicates the number...
  2. T

    Can a Portable Biochemical Testing Device Revolutionize Disease Management?

    Hi all, I was thinking recently about insulin testing, and whether the convenience could be extended to other hormones and biochemicals in the body. For instance the thyroid molecules T3 and T4. It seems like a device capable of testing for the level of these molecules on the fly would be...
  3. A

    Fortran Fortran 90 & elements array comparaison

    Dear all, I'm trying to figure about an efficient way to to get the redundant element in my array. For instance, let's take the array [0,2,3,0]. I'd like to get out [2,0,3] (or 3,0,2 it doesn't matter). So it find out which element is duplicated, an puts its value in between the 2 other...
  4. A

    Fortran Fortran, complex array with rank one

    I'm using the MATMUL command to multiplicate two arrays: array A is of rank one and has three complex elements, while array B is a 3x3 matrix with complex elements. However, the compilation is aborted because "the shapes of the array expressions do not conform". I'm pretty sure that the...
  5. A

    MATLAB Extracting a Column from a 4D Double Array in MATLAB using Squeeze

    Hello, I'd like to access a column of values from the 4th dimension of a 4D Double array in MATLAB and then save them to a new matrix. For example: A = rand(3,3,3,3); A(1,1,1,:) gives me: ans(:,:,1,1) = 0.7077 ans(:,:,1,2) = 0.0669 ans(:,:,1,3) = 0.7794 I...
  6. A

    MATLAB Creating an Array of X Values for Plotting a Function

    I want to create a plot of a given function for all x values between negative infinite to negative R (for some given R value). How do I create an array for x so that my plot will include all the x values?
  7. Saladsamurai

    Excel VBAWriting a .txt file to an Array or Wrksht

    Go To Post #7 for new Question :smile: So let's that I have a .txt file called input.txt that simply contains the following: abc+123 I want to load input.txt using VBA into a 1-dim array called MyArray. I want each character to be an element of the array. That is a is MyArray(1), c...
  8. W

    Learn How to Dim an LED Array with a Simple Circuit - No Switch Required!

    Hi. I've got a LED dimmer circuit. When the dc power turns on, the LED will slowly lights up. There is a switch in the circuit that if I "open" the switch, the LED will slowly turns off. The million dollar question is how do I remove the switch and the LED will slowly turns off when the...
  9. F

    Keplerian scattering through an array of mass lumps

    Hey guys, Hit a bit of a snag in something I'm working on and need some help. I've attached an image so hopefully that will help a bit. Basically I'm trying to model a mass m moving through a potential that is, currently, a grid of point masses and seeing how the overall distance traveled in a...
  10. S

    Counting on a Rectangular Array

    Homework Statement Suppose you have an a x b rectangular array of distinct integers (think of it as a matrix if you would like). Now suppose we first move across the columns and take a permutation of the entries in each column. Informally, we can imagine the integers in the array as cards, and...
  11. H

    MATLAB How can I use the find function to replace missing values in a 4D array?

    Hi all- I have a question regarding using the find function as opposed to if statements in finding values in a 4D array. These are climate variables, such as temperature (in Kelvin). Missing values are represented as 10^15, and I want to change them to NaN which plots much nicer. I have...
  12. H

    MATLAB MATLAB char array with variable names

    Hello all. I am having troubles reading in data(from a .hdf file) and giving it my own variable names. I have created a character array var_names with the names I wish to use. The .hdf variables are 3D and 4D (they are climate parameters). What I am trying to do is loop through the...
  13. R

    Debugging C Program for Outputting Array Elements

    C programme ? Homework Statement /* Program-8.4 */ #include <stdio.h> int main() { int marks[5]= {89, 45, 73, 98, 39}; printf("%d\n", marks); //memory addres pointed by pointer printf("%d\n", &marks[0]); //memory address of 1st element printf("%d\n", *marks)...
  14. M

    Fortran Loading 2D array files to Fortran variables

    Hi, I have created data files by compiling and running a c++ code. Now I need to open and store the contents of these files in Fortran 77 variables. But I am not able to do this. The read command does not return the values stored in the file. The files are having some 2003 lines and 53...
  15. N

    Understanding Photon Journeys in Light Clocks: A Thought Experiment

    I asked this question in an earlier thread, but I have thought a bit more about it and would like to add to it, hopefully focussing more successfully on the bit the bothers me. First some preparation: At first, I was thinking of two light clocks set in motion relative to an observer A but at...
  16. R

    Designing an LED Array Circuit for Real-Time Feedback on Exercise Equipment

    I've modified a piece of exercise equipment so that it generates 12v dc. Max current is almost certainly less than 1 amp (more than that, and the subject (exerciser) poops out fast). Standard (car lighter) plug allows any appropriate device to be powered. Current generation is being...
  17. D

    Perl. Locate position of maximum value in an array

    Hi guys. I need to locate the maximum value in an array in Perl. So let's say it looks as follows: # Define array my @a; # Define inputs in array a[1]=11; a[2]=12; a[3]=13; a[4]=14; a[5]=15; a[6]=13; a[7]=12; a[8]=14; Then I would like to do something like max[@a] given the result "15" and...
  18. F

    Merge sort with array of structs

    Homework Statement I need to be able to copy full structs in a temporary array based on a value in that struct (an integer), but I'm not sure exactly how to go about it. I have commented where I need to copy over structs. Also in the other code block, what is the problem here? It doesn't...
  19. A

    Calculating the RMS of an array

    Right, this may be really simple but I am seriously struggling with it! I have an array of data which shows a map of Sweden (the sea is masked out so all the values over the sea are set to 0). I need to calculate the root mean square of only the values not equal to 0 in my array, but I...
  20. T

    Mathematica - turning two lists into an array

    Hi I need to turn two lists in the form {a1,a2,a3...} {b1,b2,b3...} into {{a1,b1},{a2,b2},{a3,b3}..} I've looked everywhere on the Wolfram website and the best i found was: Riffle[{list1},{list2}] which gives me {a1,b1,a2,b2,a3,b3} does anyone know the function to use? Thanks
  21. clope023

    Bubble sort 2D int array with c

    hi, I'm not sure if there is a homework forum for programming but I thought I'd post my problem here; I'm supposed to bubble sort a 2d integer array with elements 15 and 2; this is what my code looks like so far: #include <stdio.h> #include <stdlib.h> #include <time.h> #define cards 15 #define...
  22. H

    Finding an object in an array

    Finding an "object" in an array Say I have a vector of 64 cells. Each cell can have a value of 0-7 (each represents a color). Inside this vector I may have an "object" which would be defined as a set of consecutive non-zero (zero=black) cells with the same value. The object is no longer than 45...
  23. Z

    C/C++ Inputting an array in to a function or returning an array? (C++)

    I recently came up with a bit of a mathematical problem for myself and decided I needed a bit of code to help me. My understanding of C++ is pretty basic and I seem to have found myself stuck mixing arrays and functions. I wrote the function: int worko (int c[], int tri) { //turns...
  24. J

    How to Write a 2D Array to a File in Fortran for 3D Graph Creation?

    Hello, i have a problem and i was wondering whether anyone in here can give me a hand. I want to write a 2D array to a file in format that can be read from another program in order to make a 3D graph. I'm using fortran. In few words i want to place the data in columns and rows in the file...
  25. V

    A for loop to set a 2D array in C

    Is there anything wrong with this code? I am trying to make each set of [i] read like this: 0,200,0,200,0,200,0,200... ect. for some reason the numbers are not being set correctly. for (i = 0; i < loopCount1; i++) { for (j = 0; j < loopCount2; j++) {...
  26. T

    How to Extract Atomic Numbers from a Text File into an Array in C?

    Hi, I need help taking the atomic numbers from a list of elements and putting them in an array. I have my data in a text file in the form: Ac 227 Actinium 89 Al 26.981539 Aluminium 13 Am 243 Americium 95 etc. This is what I am have so far: FILE *fp; char myStr[1000]; char...
  27. L

    Magnetism and Reentry: Could a Halbach Array Reduce Heat?

    I was just wondering; What would happen if a Halbach array of magnets were placed just beneath the heat shield on a reentry vehicle? The plasma produced by reentry is, essentially, charged particles moving at high speed. Would a Halbach array magnetically levitate the reentry vehicle away...
  28. J

    In C how would i write an array to a file

    In C how would i create, open and write an array to a text file The array is EeV[i], does it make a difference if I am using ubuntu or windows
  29. R

    Directivity of array of antennas

    Homework Statement I am trying to understand how the total directivity of an array of antennas is calculated. Homework Equations 1. A_e = (D * lambda^2)/(4 * pi) where: A_e = effective aperature (or area of antenna) D = Directivity of one antenna lambda = wavelength 2. D_t =...
  30. E

    Printing an array of char to a string in MIPS

    I am trying to mimic the function below in MIPS: extern void print_int(int x); extern void print_string(char x[]); char y[1]; void main(void) { char y[1]; y[0] = 'a'; y[1] = '\0'; print_string(y); } and my MIPS code for the above C code is below can someone tell me...
  31. 3

    Passing a 2d array to a function in C

    I am currently writing a simulation of the game of life in C. I can create a dynamically sizes 2d array in C. However I then want to pass this array to a function. I have tried to do this however I cannot pass the array if at least one of the dimension sizes and not defined at compile time...
  32. C

    RC4 Stream Cipher: Investigating Permutations of the Initial Array

    hi, I had a question regarding the rc4 stream cipher. I understand it is a bunch of permutations to the initial Array that goes from 0 to 255 with respect to the key. However is there such a key such that after the permutation S is still the same? (ie still goes from 0 to 255)? Any help...
  33. T

    Is it Correct to Replace '\0' with a Website Address in a Char Array?

    in this code i got a chat type pointer which is an array who consists out of 4 char cells in order that each pointer cell of this array will point to some place we need to give it an address some thing like &chr "Monday morning" is not an address and its not a single char this...
  34. T

    Arrays in C: Pointers vs Structures

    printf("%p\n", array); i know that unlike other variables when we want to do some operation on an array it uses the physical address of the array but there are many cells in the array does it prints every one of them?? does the array always defined as pointer ?? even if we make...
  35. A

    MATLAB Embedded Matlab Array Bounds Error

    Hi, I keep running into the same problem using the embedded MATLAB blocks of simulink. Once the equations to be solved in my blocks reach a certain length I get an array out of bounds error. I know Simulink can handle this size of calculation in a timestep as I have much larger equations...
  36. F

    Changing kinetic E of charged particle in magnetic field - Halbach array

    changing kinetic E of charged particle in magnetic field -- Halbach array hi, I read somewhere that you can't change a charged particle's (we'll say electron) kinetic energy with a strong magnetic field, that you only change the electron's direction. I'm assuming a frictionless environment...
  37. A

    How can I control an LED array for creating patterns and designs?

    Hello all, I recently became interested in building an LED lamp as a gift for a friend. I have a good understanding of technology, but I have only a small understanding of electrical engineering. I have researched and understand how to build an actual LED lamp where I would have all the LEDs...
  38. S

    Troubleshooting: Array Values Stored as 0.10000001

    I am allocating a value of 0.1 to a position in an array and it seems to be storing itself as 0.10000001. The problem is that once all the values in the array have reached 0.1 the average should be 0.1 and the loop stops, but as it is being stored as 0.1000001 the average is > 0.1 and the loop...
  39. S

    C/C++ C++, Laplace Equation in a 20*20 array

    The code should solve laplace equation through an iterative technique until values change less than the specified tollerence, in this case maxdiff. I've used 3 arrays. one to store all values including initial and boundary conditions, and 2 more to store the new values and differences between...
  40. F

    What Is the Maximum of the Minimum Values in a 5x5 Array Transversal?

    Homework Statement Hey guys, I have a problem here which I can't seem to tackle. I hope someone knows how to go about this. Here it is: "Their are 5!= 120 different ways of choosing a set of 5 numbers from the array (below) so that a number is takenn from each row and each column. In each...
  41. H

    MATLAB MATLAB: Sum & Remove Array Entries (0, 1 & >1)

    Hi, How can I find the following from an array with entries of 0, 1, and >1: Find the sum of all the entries in the matrix that are not equal to 0. Find the sum of all the entries in the matrix. Find the sum of all the zero and 1 entries in the matrix. How to remove the entries in the...
  42. P

    How to search for duplicate values in an array of integers?

    I'm trying to search for duplicate values in a array of integers in Java. The array of intergers is sorted. Could anyone give me an idea on how to get started. :confused:
  43. G

    Array inside a class having problems

    An exercise I am trying to complete is to create a base class pointType which has functions to get two coordinates, store and print them; then to create another class derived from pointType that will find the radius, centre, area of a circle, and print these; then to create another class...
  44. G

    Char array initialisation problem

    I'm currently playing around with strings and char arrays and having problems initialising a char array properly. Basically I've got a text file whose length I want to check before putting the contents into a char array I define my ifstream variable as in_data and a string as str1. Then...
  45. H

    MATLAB MATLAB Array Pre-allocation help

    Hi everyone. I'm working on a piece of code and I'm having a bit of trouble with array pre-allocation. Here it is: function [react_in1 react_in2 react_out1 react_out2]=oneVtwoXone(masses,prec); prec = 1e-4; N=length(masses); masses=[0;masses]; % adding dummy metabolite with zero mass...
  46. L

    What Are the Key Equations for a Phased Antenna Array?

    What are the equations for a phased antenna array due to: 1. Individual element gain and the number of elements 2. Aperture of the array I have been googling these for god knows how long and can't find the slightest hint, except the site Microwaves 101 (http://www.microwaves101.com/)...
  47. A

    How Can I Take the Inverse of an Image Matrix in MATLAB?

    I'm trying to take the inverse of an image matrix by doing the following: >> A=imread ('noise.jpg'); >> inv(A) But I'm getting the following error: ? Undefined function or method 'inv' for input arguments of type 'uint8'. How can I change the image matrix so that I can take the...
  48. rohanprabhu

    Problem with Array of Pointers in Linked List?

    Mentor note: Long-time member who hasn't been around for a couple years. This is a problem worth investigating, though, IMO. There was a problem in an assignment I was solving, which asked me to break up the elements of a linked list into 3 different linked lists. Rather than creating 3 linked...
  49. C

    C/C++ Solving C++ Complex Array with Time-Dependent Schrodinger Equation

    Hi, I've been trying to write a program to solve a propagation of a wave packet using the time dependent schrodinger equation. and I noticed I would need to use complex numbers. I know that I need to use #include<complex> I declare my array, and I started with a simple 1-d array...
  50. D

    How can I tell when I've reached the end of an array?

    Ok, for my first post, here goes: I'm working on an assignment for school that states: Write a function that receives two one-dinemsional arrays that correspond to the flight-path angles and the corresponding coefficients of lift. The function should sort the flight-path angles into...
Back
Top