Help! I need urgent help in creating a Makefile for 2 c source codes which are gen3D.c and KalmanTrack.c which i wish to link together and don't understand the correct syntax to create a makefile.
Help would be much appreciated.
User Profile
Collapse
Profile Sidebar
Collapse
Chris Winton
Last Activity: Sep 24 '17, 12:07 PM
Joined: Jan 6 '11
Location:
-
How to create a Makefile?
-
Still not sure exactly what you mean.
Also i have used malloc data for pointers as the vectors i'm creating have to be of a set size. -
Oh yeh so all i'm actully doing is assigning 3 to start_position[0].
Position is a pointer and &position is the address of pointer position.Leave a comment:
-
How to read data from a file and read into a vector?
Hi I am trying to read data in from a testdata.txt file which has the following data in;
Code:2 1 7 4 5
Any idea what I am doing wrong?
Code:#include <stdio.h> #include
-
Chris Winton replied to How do i enter values into a one dimension array and use them in another function?in Csorry doesn't really help much, gives me more errors than before.Leave a comment:
-
Chris Winton started a topic How do i enter values into a one dimension array and use them in another function?in CHow do i enter values into a one dimension array and use them in another function?
Hello in the code below, i am trying to input numbers into the start_position[3] and start_velocity[3] and use these values in generate3D function however the values i get when i debug and place a breakpoint at generate3D are 0 and 3 for start_position[3] and start_velocity[3] instead of 2, 1, 3 and 2, 1, 3 respectively.
Any ideas why this is and how i can solve this? Thanks for your help.
Code:#include <stdio.h>
-
Ah that would explain alot, also it was indexes for z and o that were causing the issues. Thanks for your help.Leave a comment:
-
How do i use the random number function?
Hello I'm using the random number function to try to multiply the values in the array O by a random number but receive the error - invalid operands to binary error*. Thanks for any help.
Code:#include <stdio.h> #include <stdlib.h> double O[1][6] = {{1, 1, 1, 1, 1, 1}}; /*********** random number generator *******************/ double srandom() { return 2*((rand()/(double)RAND_MAX)
-
okay i understand what you mean about the first prroblem but not sure on;
In StateEstimate, line 50, your program should start printing garbage in the second pass through the i loop (i = 1).
Ta.Leave a comment:
-
How to return the correct value of M2 in the Matrix Multiply function?
Hello my code below is returning the wrong value when the MatrixMult function is called in StateEstimate for the value M2. When the code is debugged, with a break point at void MatrixMult() and i step through, M2 returns only the first line of A {1, 0, 0, T, 0, 0} where it should return the complete array which i believe is the reason why x gives out garbage and segmentation error at the end instead of {0,0,0,5,10,5}?
Any help would...Last edited by Niheel; Feb 10 '11, 01:08 PM. -
Thanks also what is the conversion type four a double to output the value for a printf statement,as I would like to show what the value of M3 is;
printf(" the array of M3 is ...",M3[6][6])
Thanks for your help.Leave a comment:
-
So I should put
1. int MatrixAdd(doubl e M1[6][6], double M2[6][6])
2. /* Addition of Matrix*/
3. {
4. double M3[6][6];
5. int m = 6, n = 6; //Define m and n
6. int i,j,k;
7.
8. for(i=0;i<m;i++ ) // Use m without initialization
9. {
10. for(j=0;j<n;j++ ) // Use n without initialization
11. M3[i][j]=M1[i][j]+ M2[i][j];
12. }
...Leave a comment:
-
Right okay, then what should I intialise m and n as if they are supposed to equal the rows and columns of te matrix?Leave a comment:
-
How to call functions from main section of program?
Hello I'm having difficulty calling functions from the main section of my program here. What I am trying to do is call the addition function below and add the two arrays Q and R together. When the code runs using a.out I receive segmentation fault error. Any help would be grately appreciated.
Code:#include <stdio.h> #include <stdlib.h> #include <math.h> #define DELTA_T 0.5 #define DATA 2
-
-
cheers vivek if you could send me the matrix code that would be great!!Leave a comment:
-
-
How to use pointers in this example?
Hi im not sure to how to use a pointer for this script, i am trying to call the value from the previous from the previous function and use it in the main function as shown;
Code:void prioriestimate () { int T = 1; int i = 0; int j = 0; int k = 0; double A[6][6] = {{1, 0, 0, T, 0, 0}, {0, 1, 0, 0, T, 0}, {0, 0, 1, 0, 0, T}, {0, 0, 0, 1, 0, 0}, {0,
Last edited by Niheel; Jan 17 '11, 01:30 AM. -
So instead of the line a[6][6] += A[6][6] * A_k[6][6];
I can just put P_temp[i][j] = P_k[i][j] + A_t[i][k] * A[k][j]?Leave a comment:
-
How to multiply 3 arrays?
I am trying to multiply three arrays together;
P_temp = A * A_t * P_k
Where the size or each array is [6][6].
Having difficulty in getting the correct answer. The method i am doing is;
A * A_t = a then using the result in a to use again in
P_temp = P_k * a
Any ideas how i could simplify this at all? Any help would be greatly appreciated!!
Code:void prioriestimate (int a1[][3], int a2[][4],
No activity results to display
Show More
Leave a comment: