Hi,
can someone help me with this one?
I'm trying to merge several 1d-arrays into one 2d-array. Is there any intrinsic routine/function in fortran 90/95 to do so?
I also thought of pointers. Can I assign a 2d-pointer to more than one object so I have
a pointer array whose columns point to...
#include <stdio.h>
#define K 10
int array1[K], array2[K];
int *ptr;
int addarrays(int x[],int y[]);
main()
{
int count;
for (count = 0;count < K; count++)
{
puts("Enter numbers into array1");
scanf("%d", array1[count]);
}...
I was wondering if was possible to create a constant array in php so it doesn't have to be reinitialized each time you enter a function. I guess one solution is to make it global but from a code maintenance perspective it makes since to put the array in with the function that uses it.
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.
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...
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?
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,
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...
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...
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...
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...
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...
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...
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...
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)...
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...
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]...
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...
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...
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...
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')...
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...
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...
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...
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...
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...
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.
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...
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"...
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...
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...
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...
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...
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...
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...
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...
I'm tring to plot a nuclear decay curve in Maple. I need to calculate the activity at regular time intervals which I'm doing by using a repetition statement to create an array something like:
> for time from 1 by interval to 600 do... etc.
It's working the arrays out fine, but when I...
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...
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...
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...
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...
Hi,
I have recently stumbled across Halbach arrays while searching for ideas on creating a uniform magnetic field. The suggested configuration for the halbach array can be seen here:
http://www.matchrockets.com/ether/halbach.html
(First diagram at the top of the page, Magnetic flux of a...
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;"...
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...
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...
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...