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]...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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;
}...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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.*;
/**
*...
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...
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...
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?
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...
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...
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...
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...
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...
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...
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)?
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) =...
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...
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
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...
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...
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...
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...
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...
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...
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...