Match matrix values with mesh nodes
I’ve obtained mesh on an image, and I have a color intensity matrix of the same image. Matrix values I want to multiply with Modulus of Elasticity value and then match them with the numbers of mesh nodes/elements according to their position, and import the result into ANSYS. The matrix and the mesh are attached below.
Mesh is obtained using im2mesh by JieXian Ma. It’s represented as a n-by-2 array of nodes (x and y positions), m-by-3 array of triangles (positions of 3 nodes forming a triangle) and m-by-1 array of grayscale phases (phases are initially selected to generate a mesh according to an intensity of gray color)
As I understand, there should be a loop which:
checks the position of a mesh node (x and y)
checks the position of a value in the matrix (row and column)
assigns the value of a matrix to the node (a new array with these values)
Or does the same, but with an element instead of a node (with averaged coordinate between nodes)
But I may be wrong, as I’m new in Matlab
And I don’t know how to make this loop properly, because the matrix is a square with many values equal to 0 (it initially was 255 and represented air, I just inversed the values so the air is represented as pure black color), while mesh is made differently and doesn’t include empty region (which is air)
I hope I explained it well. If you don’t understand something, please tell meI’ve obtained mesh on an image, and I have a color intensity matrix of the same image. Matrix values I want to multiply with Modulus of Elasticity value and then match them with the numbers of mesh nodes/elements according to their position, and import the result into ANSYS. The matrix and the mesh are attached below.
Mesh is obtained using im2mesh by JieXian Ma. It’s represented as a n-by-2 array of nodes (x and y positions), m-by-3 array of triangles (positions of 3 nodes forming a triangle) and m-by-1 array of grayscale phases (phases are initially selected to generate a mesh according to an intensity of gray color)
As I understand, there should be a loop which:
checks the position of a mesh node (x and y)
checks the position of a value in the matrix (row and column)
assigns the value of a matrix to the node (a new array with these values)
Or does the same, but with an element instead of a node (with averaged coordinate between nodes)
But I may be wrong, as I’m new in Matlab
And I don’t know how to make this loop properly, because the matrix is a square with many values equal to 0 (it initially was 255 and represented air, I just inversed the values so the air is represented as pure black color), while mesh is made differently and doesn’t include empty region (which is air)
I hope I explained it well. If you don’t understand something, please tell me I’ve obtained mesh on an image, and I have a color intensity matrix of the same image. Matrix values I want to multiply with Modulus of Elasticity value and then match them with the numbers of mesh nodes/elements according to their position, and import the result into ANSYS. The matrix and the mesh are attached below.
Mesh is obtained using im2mesh by JieXian Ma. It’s represented as a n-by-2 array of nodes (x and y positions), m-by-3 array of triangles (positions of 3 nodes forming a triangle) and m-by-1 array of grayscale phases (phases are initially selected to generate a mesh according to an intensity of gray color)
As I understand, there should be a loop which:
checks the position of a mesh node (x and y)
checks the position of a value in the matrix (row and column)
assigns the value of a matrix to the node (a new array with these values)
Or does the same, but with an element instead of a node (with averaged coordinate between nodes)
But I may be wrong, as I’m new in Matlab
And I don’t know how to make this loop properly, because the matrix is a square with many values equal to 0 (it initially was 255 and represented air, I just inversed the values so the air is represented as pure black color), while mesh is made differently and doesn’t include empty region (which is air)
I hope I explained it well. If you don’t understand something, please tell me image processing, fea, mesh MATLAB Answers — New Questions