Recent content by Joon

  1. J

    Forward kinematics model using DH parameters in MATLAB

    Below is my code. I have all the DH parameters that will allow me to calculate the end effector position. I'm not sure where to input the values of thetas 1 ~5 shown at the bottom. Please help. function [T] = getTransformMatrix(theta, d, a, alpha) T = [cosd(theta) -sind(theta) * cosd(alpha)...
  2. J

    Forward kinematics model using DH parameters in MATLAB

    5 links (thus 6 frames) and corresponding theta, alpha, d and a values are all given. However, I'm not sure how to start coding the DH parameters to derive a forward kinematics model. I know that I'll have to use matrix operators, but do I just put in the values of the 4 factors mentioned above...
  3. J

    How to calculate n with its uncertainty in the equation Q= kL(h^n)?

    The process is a bit complicated, I am uploading everything I have, please have a look. I'm attaching the excel file as well where the example calculation was done.
  4. J

    How to calculate n with its uncertainty in the equation Q= kL(h^n)?

    I am thinking of doing the same thing (summing up all the uncertainties that contribute to U(E) in the example) for the task, so summing up all the fractional uncertainties that contribute to U(Q). But the problem is unlike energy in the example, I'm not sure what's the contributors that lead to...
  5. J

    Statistics: How to differentiate Type A and B uncertainty?

    Thank you for your reply. An example calculation was provided and I was told to use the same method for this task. The example given was a crater created when a ball strikes sand from a vertical height h. A table of results and additional information was provided- please refer to the attached...
  6. J

    Statistics: How to differentiate Type A and B uncertainty?

    I tried to find examples on the internet but I am still confused.
  7. J

    Comp Sci How do you read two files in the same program in C++?

    Now I have the correct code. It is shown below. I want to use another for loop to read the matrix and the vector though, without declaring the size of the matrix and vector as [3][3] or [3]. Should I use something like count to do this? #include <iostream> #include <fstream> #include <string>...
  8. J

    Comp Sci How do you read two files in the same program in C++?

    Below is the edited code. But the result seems wrong. What can I do to make the code read only until data runs out? So I've first set the matrices to 10 x 10 as shown below, but I want this code to work also for any size matrices. For example, if it's a 4x4 matrix out of 10x10 matrix times 4x4...
  9. J

    Comp Sci How do you read two files in the same program in C++?

    Text files are arranged just normally I would say, without any headers. They contain pure integer values only, please refer to the file attached. For matrix B, I think it might be replaced with a new one (when the code is tested) where the column number is not 1. Sorry for the confusion, since...
  10. J

    Comp Sci How do you read two files in the same program in C++?

    Yes I've covered getline and used it to read and discard the first line of a text file before (the header). But I haven't learned any C-style input methods. I've covered eof as well for the end of file. Instead of storing each value (if it goes up to 10 x 10, the code will be too long), is...
  11. J

    Comp Sci How do you read two files in the same program in C++?

    Right. Below is the fixed code. #include <iostream> #include <fstream> #include <string> using namespace std; int main() { int i, j; int A[10][10], B[10][10], C[10][10]; ifstream inFile1("matrix(1).txt"); ifstream inFile2("vector(1).txt"); for (int i = 0; i < 10; i++)...
  12. J

    Comp Sci How do you read two files in the same program in C++?

    The data files are given to me. As mentioned the two files given contain a 3x3 square matrix and a 3x1 vector respectively, but when the code gets tested they'll give another file that can go up to 1x1 to 10x10 square matrix and the corresponding vector (1x1 to 10x1). I cannot edit the file as...
  13. J

    Comp Sci How do you read two files in the same program in C++?

    Sorry for the late reply. Actually the task is reading two text files (one with a square matrix and the other with a vector) and multiplying them. It is not two square matrices, it is one square matrix and one vector. The text files are given as the matrix having 3 x 3 and the vector having 3 x...
  14. J

    Comp Sci How do you read two files in the same program in C++?

    Alright, thank you. I've tried to write the code to read the matrices but I don't think using xcoordinates[count], ycoordinates and zcoordinates is correct because I don't know what size the matrices are going to be. If it is 4 x 4 matrix, x y z is not enough since there's one more to take into...
Back
Top