Arrays Definition and 145 Threads
-
D
Writing down Mathematics with Arrays
I know how to do basic matrix operations, but sometimes I do calculations on computers and do array operations. How do I write down array operations on paper? For example, say I have two matrices, A and B, and I want to multiply them element by element.- dimensionless
- Thread
- Arrays Mathematics Writing
- Replies: 5
- Forum: General Math
-
S
Comp Sci How can I print integers as a string in C++ using character arrays?
Homework Statement I have a bunch of integers stored in a character array, and I am trying to print the integers as characters. I can print them as characters when I use %c in the print statement, but the problem is I need to print them as a string. My program crashes when I attempt to use...- sdoug041
- Thread
- Arrays C++ Printing
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
Anyone use VBA in Excel: eclaring Arrays as Public
Anyone use VBA in Excel::Declaring Arrays as Public Egads man...I have seen plenty of modules with arrays declared as Public. Clearly I am making some boneheaded error here and cannot locate it: Any Thoughts?- Saladsamurai
- Thread
- Arrays Excel
- Replies: 1
- Forum: Programming and Computer Science
-
K
MATLAB Matlab arrays with numbers and characters
So, I'm trying to create an array with both numbers and specific characters, like # and C. I want it to be displayed like a standard array of numbers. So the output would resemble. 7 7 7 7 7 7 7 6 6 6 6 6 6 6 5 # C 6 6 @ 6 Thanks,- kaos4
- Thread
- Arrays Matlab Numbers
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
S
Returning arrays from a function
hello. I am working on a c++ assignment right now, and my job is to write a sub-program that will fill two arrays with random numbers (1-10), then ask the student 10 arithmetic questions (either multiply or divide depending on a previous choice) and store the answers in a third arrray. I come...- sdoug041
- Thread
- Arrays Function
- Replies: 1
- Forum: Programming and Computer Science
-
A
Can arrays be combined into a matrix for more efficient coding?
Hello, Currently I have two single dimension arrays. I am interested to know if I can modify program by combining them to a matrix giving same result. E.g. A(X), B(Y) used for M=P*A(1)+Q*B(2) Proposed- A(X,Y) used for M=P*A(1,Y)+Q*B(X,2) Program should understand that it has to...- andykol
- Thread
- Arrays Matrix
- Replies: 1
- Forum: Programming and Computer Science
-
O
Creating Multi-Indexed Arrays & Functions w/ Array Inputs & Outputs
How do i create an array such that there is more than one index? the array declared here float array[i]; is like a vector but how do i create an array that is declared such as float array[i,j] which would be a matrix And how do i create a c function whose input is an array and the...- okkvlt
- Thread
- Arrays Functions
- Replies: 1
- Forum: Programming and Computer Science
-
S
MATLAB How Can I Store Loop Results in Arrays for Plotting in MATLAB?
Hello, I am trying to store the results in the form of an array every time the code goes through a loop. This is what my code looks like: for j = 1:100 for i= 1:100 if S(i)==0 if rand < T S(i)= 1; t_inf(i) = j; end...- spoonyluv
- Thread
- Arrays Loops Matlab Plotting
- Replies: 6
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
E
[Problem] C, Mingw32 - arrays impact each other (changing values)
About week ago I decided to make an attept to create multiplayer rpg game in j2me. The game needs server so I use c and mingw32 as compiler. I thought the biggest problem will be network programming as I never tried that before. But the j2me client is connecting nicely I have managed to get...- engri
- Thread
- Arrays Impact
- Replies: 2
- Forum: Programming and Computer Science
-
R
Fortran How can I read and write 3D arrays in Fortran?
Hi! I have a 3D array u(n,m,2), where n=2000, m=200 are the xy-coordinates, and u(n,m,1) and u(n,m,2) store values of variables a and b computed at the coordinates. (not very familiar with fortran I/O for arrays, when new lines are started, etc). I'd like to output this array into a...- rose2718
- Thread
- 3d Arrays Fortran
- Replies: 7
- Forum: Programming and Computer Science
-
J
How to Correct Recursive Methods for Array Manipulations?
Homework Statement Ok. I am supposed to write a recursive method for the following: 1) public static double computeSumAtOdd(double[] numbers, int startIndex, int endIndex) - finds the sum at all the odd indexes of the array 2) public static double computePositiveSum(double[] numbers...- jsmith0476
- Thread
- Arrays
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
How to Reverse Words in Strings Using Multidimensional Arrays in C?
Hi guys I just learned M-D arrays and was trying to execute this piece of code: //initial value of y printf("\nTime of initial displacement - y(t): t="); fflush(stdin); scanf("%lf", &IVP[1][1]); printf("\nInitial displacement - y(%.4lf)=",&IVP[1][1]); fflush(stdin)...- djeitnstine
- Thread
- Arrays Multidimensional
- Replies: 18
- Forum: Programming and Computer Science
-
C
MATLAB Combining 2 two-dimensional cell arrays in MATLAB
Hi I'm quite new to MATLAB and I'm stuck on a problem which I think is probably relatively simple. Any help much appreciated! Right, I have 2 cells, both of dimension 51x1 called n_cbc and n_load. Each of the 51 rows in the n_cbc cell contains a 5x1 matrix. Each of the 51 rows in the...- chendry2001
- Thread
- Arrays Cell Matlab
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
P
Java Why is My Java Code Not Rotating an Array 90 Degrees to the Left?
I am supposed to write code to rotate an array 90 degrees to the left... so my question is, why is this code not rotating my array 90 degrees to the left? thanks for any help! public static int[][] rotateLeft(int[][] source) { int[][] result = new int[source.length][source[0].length]...- physicsfun
- Thread
- Arrays Java Rotating
- Replies: 1
- Forum: Programming and Computer Science
-
P
Comp Sci Rotate Arrays in Java: Troubleshooting 90 Degree Left Rotation Code
Homework Statement Write code to rotate an array... Homework Equations why is this code not rotating my array 90 degrees to the left? thanks SO much in advance! The Attempt at a Solution public static int[][] rotateLeft(int[][] source) { int[][] result = new...- physicsfun
- Thread
- Arrays Java Rotating
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
I
Java Need help setting up arrays for Galton box simulation?
I'm new in java and I'm trying to come up with a program that stimulates the bean machine(also known as Galton box) Balls are dropped from the opening of the board. Everytime a ball hits, there is a 50% chance to fall to left and 50% chance to fall to the right. the piles of balls are...- irresistible
- Thread
- Arrays Java
- Replies: 1
- Forum: Programming and Computer Science
-
S
Comp Sci How can I initialize 2D arrays in C++ to avoid gibberish output?
I need to initialize the arrays of an object to zero, but when I compile it, it gives me gibberish. Here's my code:- subwaybusker
- Thread
- 2d Arrays
- Replies: 16
- Forum: Engineering and Comp Sci Homework Help
-
S
Fortran 90 (need to read in binary data files into arrays)
Hello, I am currently doing a 3rd year undergrad project on forward radio meteor scatter the problem involves the following: I have over 80Gbs worth of 10 second data blocks of recorded radio input. They are stored as date stamped .bin files in binary format, each of order 1700kb or...- sparkstermaes
- Thread
- Arrays Binary Data files Fortran
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
R
Working with char arrays - Solving Array Problems with Rui's Help
Hi there! I'm having problems with creating/using char arrays. My actual code is: (I reduced the options to make it smaller here..) int option; int i; fs=11025; %frequency %load wave files into MATLAB vectors [jose]=wavread('jose.wav'); [antonio]=wavread('antonio.wav')...- ruijorgemoren
- Thread
- Arrays
- Replies: 2
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
N
Comp Sci Depreciation Calculator in C++: Calculate Values & Validate Data Using Arrays
My Homework is write a program to show the depreciation of an item each year during 10 years, for a porcentage given. The prgram shoul include: 1- Data entry validation 2-Calculate all the values for each year,and tehn of calculate all the values should show de results. 3-If the final value...- Naldo6
- Thread
- Arrays C++
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
N
Comp Sci Depreciation Program in C++ with arrays
Hi, i have did my program ccorrectly, but my profesor ask me to do with arrays and i don't know how to do thisprogram wuth arrays. Can anyone helps please?... I talk with my profesor and see my prgram, and told me that it is all ok , but the only mistake is that i don't use arrays how the work...- Naldo6
- Thread
- Arrays C++ Program
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
C
Comparing Arrays Homework: Subsequence Function
Homework Statement OK, so in this CS project, we need to make functions for arrays. I need to implement a function that does the following: int subsequence(const string a1[], int n1, const string a2[], int n2); If all n2 elements of a2 appear in a1, consecutively and in the same order...- chiurox
- Thread
- Arrays
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
S
C Newbie Help: Strings, Arrays, Getline() & Sscanf() - Urgent (Due Monday)
I am required to use getline() and sscanf() somewhere in my function to read standard input and store it into arrays. I have input like this: 10/10/08 12:00 A1:2.31:1:P 2B:1.98:2:g 2b:1.82:3:b the first line is the time, which i used strcpy to copy it to an array called time[] the...- subwaybusker
- Thread
- Arrays Strings Urgent
- Replies: 10
- Forum: Engineering and Comp Sci Homework Help
-
T
C/C++ Need help soon with C++ program using pointers and arrays
Okay so I got the majority of my program complete, however when I try to run it it doesn't display the proper value of the average. I think I somehow messed up using my pointers and arrays, but I can't locate the problem and I've spent hours trying to fix it to no avail. see comments for better...- twotaileddemon
- Thread
- Arrays C++ Pointers Program
- Replies: 6
- Forum: Programming and Computer Science
-
R
Calculating Vibration in Water Flowing Pipes for Noise Comparison
Hi, Does anyone know how to calculate the vibration in a pipe with water flowing through it? I have no idea where to start or what formula to use. Any help would be appreciated. Thanks.- RagingSezz
- Thread
- Arrays Cylinder Vibration
- Replies: 5
- Forum: Mechanical Engineering
-
L
Can you explain the size difference between arrays and pointers in C?
int* a1 = malloc(4 * sizeof(int)); int* a2 = malloc(3 * sizeof(int)); int* a3 = malloc(5 * sizeof(int)); a1[0] = 1; a1[1] = 2; a1[2] = 3; a1[3] = 4; a2[0] = 9; a2[1] = 8; a2[3] = 7; a3[0] = -1; a3[1] = -2; a3[2] = -3; a3[3] = -4; a3[4] = -5; My question: Are a1, a2 and a3 arrays? I...- ladesidude
- Thread
- Arrays Pointers
- Replies: 10
- Forum: Programming and Computer Science
-
T
Help! Struggling to Grasp Arrays and Strings for Final Exam
My final exam is tuesday and I am having an extremely extremely hard time grasping arrays and strings. I just can't visualize how they work and I am stuck on how to get my printOwnedShares function to work properly in a project that will help me study for the final. This is what I have worked on...- twotaileddemon
- Thread
- Arrays Exam Final Strings
- Replies: 3
- Forum: Programming and Computer Science
-
M
Problem with string arrays in assembly
I have been working with assembly (TASM32) for a few months now and have ran into a problem which I cannot fix. Here's a working example written in C++ which needs to be converted to assembly. #include <windows.h> int main(){ char *name_list[5] = {"Micheal", "Stefan", "Judy", "William"...- maple23
- Thread
- Arrays Assembly String
- Replies: 14
- Forum: Programming and Computer Science
-
A
How to Assign Inputs as Addresses in C Programming?
Hi guys, ***I just started c programming, I've done some reading last week and i came up with a basic program.Ive got a problem trying to assign an input as an adress to a specified value.Basically i have 3 datas in my array and it will be called by inputting a number which points to the...- akueddy
- Thread
- Arrays Pointers
- Replies: 3
- Forum: Programming and Computer Science
-
S
Set Elements of Array to Same Value in C#
For some reason, I can't work out how to set every element of an array to the same value in a single line, in C#. For example, I can't do this: char[] array_of_chars = new char[limit]; array of chars[] = X or: char[] array_of_chars = new char[limit]; array of chars[0:limit] = X So...- Sojourner01
- Thread
- Arrays Stupid
- Replies: 3
- Forum: Programming and Computer Science
-
O
Java How to Count Rows and Columns in a Two-Dimensional Array in Java?
I just have a question about my "solution" to a problem. The question says to write a value returning method that returns the number of rows in a two-dimensional array of doubles. It should be simple enough and so I did it like this: public int countRows() { int x; x = 0; for (int...- OrbitalPower
- Thread
- Arrays Java
- Replies: 4
- Forum: Programming and Computer Science
-
C
C/C++ GCC & C++: Allocating Large Arrays in Windows
I'm having trouble allocating large arrays in C++ using gcc (using cygwin/MSYS in Windows). If I declare an array at the beginning of main as: unsigned int arr[1000][1000] there's no problem, but even something as small (8 MB) as unsigned int arr[1000][2000] will fail. This is...- CRGreathouse
- Thread
- Arrays Gcc
- Replies: 13
- Forum: Programming and Computer Science
-
R
Comparison(Phased arrays) your point of view required
Hi friends I need some very accurate and practical comparisons of Dipole constituted phased arrays OVER Loop antenna ,Folded Dipole Antenna constituted phased arrays. we normally use half wave dipole antenna arrays...why don't other not much in practice?? Plz reply...- Rf engineer
- Thread
- Arrays Point
- Replies: 1
- Forum: Electrical Engineering
-
D
Crops for Ethanol versus Solar Arrays
There has been much talk in the U.S. about growing corn and switch grass for the production of ethanol. The purpose being to use ethanol as a fuel additive. Would it not be possible to produce more energy by putting solar arrays in place of these crops? It would seem that ethanol...- dimensionless
- Thread
- Arrays Ethanol Solar
- Replies: 20
- Forum: General Discussion
-
M
Comp Sci How to Correctly Implement a 2D Array with Random Values in C++?
Homework Statement 1. Create a 2D array, A[10][10], of 100 integers. 2. Ask the user for two integers R and C where 0 < R ( 10 and 0 < C ( 10. 3. Using nested loops, fill every element A[i][j] (where 0 ( i < R and 0 ( j < C) with random numbers ranging in [0, 200]. I will describe how to...- mkienbau
- Thread
- Arrays C++
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
J
Fortran Arrays with parameter and data statements in fortran 77
Let's say you have an array A and a variable B (both reals). Apparently parameter (A = (/1.2, 3.4, .../) ) is illegal, so you have to do data A /1.2, 3.4, .../ instead. However, what if you have a statement afterwards like this? 1 parameter (A = (/1.2, 3.4, .../) ) ... 2...- JoAuSc
- Thread
- Arrays Data Fortran Parameter
- Replies: 1
- Forum: Programming and Computer Science
-
I
Could Capacitor Arrays in Space Harvest Free Electrons from the Sun's Corona?
Could Capacitor Arrays in Space be used to collect free Electrons in mean free orbit? If so, Could using Capacitors with open Space Dielectric constants between Plates be sufficient for building a Capacitor Space Array? all plates exposed to open Space and no casing.:bugeye: If you...- Intuitive
- Thread
- Arrays Capacitor Space
- Replies: 5
- Forum: Aerospace Engineering
-
K
How Can I Correctly Sort and Output Arrays from a Single File in C++?
The Problem (from the handout, word for word): Write a program that reads a list of integers from the file "numbers.in" into an array, which I will call numbers. Then sort the numbers into 3 groups, a group of odd numbers, a group of even numbers, and a group of negative numbers, use an array...- kahless2005
- Thread
- Arrays File Sorting
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
C
Could use some, no, a LOT of help on my arrays assignment (C)
Here's the project sheet. it's due tomorrow btw "Write a program to input, compute, and display various statistics for a list of test scores of up to 30 positive test scores of type double. You shall input an array with the following values as one of your test cases (use -1 as a sentinel...- clook
- Thread
- Arrays Assignment
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
N
C/C++ Does 'delete [] varname;' delete multiple arrays in C++?
Was wondering if the "delete [] varname;" deletes multiple arrays eg... I coded a 3-D array as follows: type ***name; name = new type**[n]; for i: name[i]= new type*[n]; for i,j: name[i][j]=new type[n]; and name[i][j][k] is and element in the array now does "delete [] varname;"...- neurocomp2003
- Thread
- Arrays
- Replies: 4
- Forum: Programming and Computer Science
-
B
Java Selection Sorting Arrays in Java
So, I have to create a program that makes a new array with 20 slots, then it asks you to enter a value into each index, which I have here: import java.io.*; class ArrayLoop { public static void main (String[] args) throws IOException { int[] array = new int[20]; for (int i...- blue_soda025
- Thread
- Arrays Java Sorting
- Replies: 4
- Forum: Programming and Computer Science
-
C
Java Checking if One Array is Contained in Another using Java Arrays
Hello all I am trying to write a program that checks whether one array is contained in another array. For example, A = {1,2,3} B= {1,2,3,4,5,6} A is contained in B, so we print out true, otherwise we print out false. Any advice or tips in writing this program would be greatly...- courtrigrad
- Thread
- Arrays Java
- Replies: 22
- Forum: Programming and Computer Science
-
J
Three-Way Arrays: Algebra Basics Explained
Can some describe to me the basic algebra of three-way arrays?- jcsd
- Thread
- Arrays
- Replies: 12
- Forum: Linear and Abstract Algebra
-
Passing pointers and arrays to a C function
This is the latest assignment I am struggling with: Write a program that contains a function void shift(char *) that looks at the first character of its argument and converts the other characters, to be the same case, that is, if the first character is uppercase, it shifts the rest to...- Math Is Hard
- Thread
- Arrays Function Pointers
- Replies: 36
- Forum: Introductory Physics Homework Help
-
C/C++ Dumb question about complex arrays in c++
In trying to learn C++ (I'm an old FORTRAN guy), I am unable to figure out how to define and initialize a complex array. Single complex numbers are straight forward, but going further has me perplexed some. Thanks in advance.- Dr Transport
- Thread
- Arrays C++ Complex
- Replies: 8
- Forum: Programming and Computer Science