Build Matrix A for Cross Product Multiplication of 2 Vectors

In summary, you want to build a matrix that can solve cross product multiplication of 2 vectors. The code you would use is different than the built in cross product in MATLAB, and you would need to define symbols for the vectors and use these in the matrix.
  • #1
Dell
590
0
i want to build a matrix that can solve cross product multiplication of 2 vectors, building a matrix A so that

detA=PxS

A=

[tex]\hat{i}[/tex] [tex]\hat{j}[/tex] [tex]\hat{k}[/tex]
P1 P2 P3
S1 S2 S3


how do i build a code so that my det will give me a vector answer?
 
Physics news on Phys.org
  • #2
Why wouldn't you just use MATLAB's built in cross-product?

Doing what you're asking (in MATLAB) is a somewhat complicated problem. It's easy to do this by hand, but MATLAB is a bit different. Think about how you would do this by hand - what are [tex]\hat{i}[/tex], [tex]\hat{j}[/tex], and [tex]\hat{k}[/tex]?

Since each of these is a vector (three components in 3-space), MATLAB won't let you create a matrix containing these vectors - you'll get a dimension mismatch error. What you might be able to do is define symbols (do you have the symbolic math toolbox?) for i, j, and k, and use these in your matrix. This will give you an answer, but it won't be very useful, because you won't be able to operate on your result.

-Kerry
 
  • #3
thanks, its one of the homework problems i have, using the cross function is much simpler but i am meant to doo it this way.

another problem i need to do is make a table containing
names and ages

name1 48
name2 33
name4 90
...
namen 22

totally randomly, at least 15 names, and then perform a number of tasks on them, is there a way i can tell MATLAB to make the random table or do i need to plug in all the names and ages, can i make a nx2 matrix where the 1st colomn is made up of words not numbers? also can i tell MATLAB to make name(n) where n runs from 1->15
 
  • #4
Look into the sprintf function - that should do what you need. You can use it in conjuction with randn.

-Kerry
 
  • #5
thanks a lot, btw i managed the det using
syms i j k
 
  • #6
still haven't managed to build the names matrix
name1 48
name2 33
name4 90
...
namen 22

could you please help, or if possible write the code i need, i didnt really understand the ssprintf function.

even if i try making the matrix it doesn't work, ie
a=['name1' 48; 'name2'...] i am only managing to make matrices of numbers
 
  • #7
Can you show me how you're trying to use the sprintf function? I don't understand what problems you're having if you don't show your work. Tell me what you don't understand, what errors your getting, what behavior you want vs. what behavior you're getting.

-Kerry
 
  • #8
i just don't know what it actually does, what to type to use it, the help fiile didnt really mae sense to me, i am pretty much a MATLAB novice, only had a couple of lessons so far
 
  • #9
Scroll to the bottom of the help entry - there are examples there. Try them out. If you still have questions, I will be happy to help. You can cite specific parts of the examples that you don't understand. MATLAB does a very good job with their documentation, and I don't want to just repeat it here. I can give you my own examples, and my own explanation of what it is doing, but if you don't tell me what it is that you don't understand, my explanation will be very similar to what you will find in the MATLAB documentation.

-Kerry
 

Related to Build Matrix A for Cross Product Multiplication of 2 Vectors

1. What is a build matrix for cross product multiplication?

A build matrix for cross product multiplication is a 3x3 matrix that is used to compute the cross product of two vectors. It is used to find the vector that is perpendicular to both of the input vectors.

2. How do you create a build matrix for cross product multiplication?

To create a build matrix for cross product multiplication, you first need to write down the two input vectors in the form of a 3x1 matrix. Then, you can use the following formula to calculate the elements of the build matrix:

A = [i j k; a1 a2 a3; b1 b2 b3]

where i, j, and k are the unit vectors in the x, y, and z directions respectively, and a1, a2, a3 and b1, b2, b3 are the elements of the two input vectors.

3. What is the purpose of a build matrix for cross product multiplication?

The main purpose of a build matrix for cross product multiplication is to simplify the calculation of the cross product of two vectors. It allows for a more efficient and accurate way to find the vector that is perpendicular to both input vectors.

4. Can a build matrix for cross product multiplication be used for vectors of any dimension?

No, a build matrix for cross product multiplication is only used for vectors in three-dimensional space. It cannot be used for vectors of any other dimension.

5. What are some common applications of cross product multiplication?

Cross product multiplication is commonly used in physics, engineering, and computer graphics. It can be used to calculate torque, angular momentum, and magnetic fields, among other things. It is also used in 3D graphics to determine the orientation of objects and to create realistic lighting effects.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
927
  • Precalculus Mathematics Homework Help
Replies
14
Views
479
  • Engineering and Comp Sci Homework Help
Replies
2
Views
5K
Replies
6
Views
754
  • Set Theory, Logic, Probability, Statistics
Replies
11
Views
2K
  • Linear and Abstract Algebra
Replies
4
Views
2K
Replies
14
Views
1K
Replies
9
Views
1K
  • Mechanical Engineering
Replies
2
Views
743
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
815
Back
Top