I don't believe copy the libraries was important, but obviusly I was using them in my code. Here is with everything else; the segmentation fault disappear, but there is nothing in my console: the...
Type: Posts; User: Isolda_
I don't believe copy the libraries was important, but obviusly I was using them in my code. Here is with everything else; the segmentation fault disappear, but there is nothing in my console: the...
This is my latests code:
int main(){
double **a;
int i,j;
int nsteps, dim;
O_O
Each time I understand less about this code; when I execute it, appears the "egmentation fault (core dumped)" message. :(
It does't work. My data file, wrt.dat, has the first two lines with two numbers: the first is the number if rows, and the second, the number of colums. My code is like this:
int main(){
...
Hello again; I revive this topic.
This is the problem: I create a data file, with NSTEPS rows and DIM columns, but I cannot read it using fscanf.
My code is as follows:
for(i = 0; i <...
YEs!!!
I had done this
for( i = 0; i < DIM; i++){
for( j = 0; j < DIM; j++){
for ( k = 1; k <= cont; k++){
p=0;
if( i == s_c1[k][0] && j == s_c1[k][1] ) {
Hi again!
This is my code.
for( i = 0; i < DIM; i++){
for( j = 0; j < DIM; j++){
for ( k = 1; k <= cont; k++){
Yes, I corrected it in my edition of the post. Thanks!
Sorry, no.
I changed my code:
int **prob;
prob=malloc (DIMENSION * DIMENSION*sizeof ( int* ));
¿Do you say, instead of use the limits
(j-DIM/2)/25.0, etc., asing each of this limits to a local variable and then ask?
inf_x=(i-DIMENSION/2)/25.0;
sup_x=(i+1-DIMENSION/2)/25.0;...
This is embarrassing, but i have no idea of what is happening.
I'm using numerical integration to solve a ODE, and I asked my program where the final point is. I devided the phase space in little...
I'm trying with this, and at the moment it seems to work fine.
int **prob=(int **)malloc(DIMENSION*DIMENSION*sizeof (int*));
for(i=0;i<DIMENSION*DIMENSION;i++){
...
Ok; thanks a lot. :) (I love C xD)
Perfect! I solved the problem! Actually I got more problems if a don't create the multiple data files, so I did this:
FILE *fp[101]; //number of files I need
char fname[25];
for...
¿There is a way to define the array dynamically? ¿Can I declare it like
int *prob, without giving the size it will have?
ok. I don't see how to write in another way my code. Here is what I'm triyng to do.
I divided and x-y plane in little cell, each of 0.04*0.04. In each cell I started an initial condition of a...
I'm writing a code which implementes the cell-to-cell mapping method.
Finally I know why my compiler is saying me there is a segmentation fault. Apparently it's because I defined a matrix of...
And if my data file are numbers in a "matrix form", i.e., organiced in several rows and columns, when a called fscanf the function will save each data of the file in a compoment of a two dimensional...
This is stupid. I put the last element I was forgotten, and I defined in a correct way i and j.
The thing is that initially I tried to defined the matrix with decimal numbers, like
...
Sorry for post a lot :)
My problem is like this: I have to define an n+n matrix. Obviusly that is not a problem. The question is that in each element of the matrix, I have to define, say, k...
I found the way!!!
I need numbers between 0 and 0.04; next, between 0.04 and 0.08, and so on.
The algorithm should look like this:
r=drand48()/25+i, where i is 0, 0.04, 0.08, and so on.
...
Hi!
I know you are going to tell me to search in the faq. But my problem is not there.
The thing is this: I diveded the space between -2 and 2, both in x and in y axes, in little cells of...
Ok. The first problem is solved (I save of the data in an unique file.dat).
The second problem is just what dwks say: ¿how can i save the gnuplot's output in different files ITERATIVELY? I need...
I'm not sure I'm understanding you.
You say, put all the text in the same file? That's ok. And that work's fine without additional functions. But I still have the problem with the images files.
...
But rename doesn't work. At last I don't see how.
My problem is this:
1. I solve an numerical integration and I save the data in a file, "file1.dat"
2. I call Gnuplot, and gnuplot uses...