Create mesh from matrix
Ältere Kommentare anzeigen
I have two matrix a and b, which have dimension of 241 x 360. The values from the a and b gives a mesh. How do I plot the mesh?
8 Kommentare
Walter Roberson
am 11 Okt. 2023
Could you give an example of what you are hoping the output might look like?
Kiran
am 11 Okt. 2023
the cyclist
am 12 Okt. 2023
Bearbeitet: the cyclist
am 12 Okt. 2023
OK, so for your small example, what would the output actually be? Don't worry how to calculate it. Just tell us the output result.
a = [0 2;
0 2];
b = [ 0 23;
50 50];
ab_mesh = ????
Walter Roberson
am 12 Okt. 2023
Are you trying to create a solid? Where the bottom is given by one of the matrices and the top is given by the other matrix, and they are assumed to be some set distance apart? If so then how do you want to handle the situation where they have different number of vertices?
Kiran
am 12 Okt. 2023
Walter Roberson
am 12 Okt. 2023
But you asked for a mesh, and what you show is not a mesh.
Kiran
am 12 Okt. 2023
Image Analyst
am 12 Okt. 2023
@Kiran did you even see my answer from yesterday below (scroll down)?
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 12 Okt. 2023
Not sure what you mean by "plot" but to view a and b as 2-D images and 2.5-D surface plots:
subplot(2, 2, 1);
imshow(a, []);
subplot(2, 2, 2);
imshow(b, []);
subplot(2, 2, 3);
surf(a);
subplot(2, 2, 4);
surf(b);
Or you could simply double click on a and b in the workspace panel to bring them up in the variable editor panel in MATLAB.
1 Kommentar
Kiran
am 12 Okt. 2023
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



