How to Extract X,Y,Z vectors from grid data?

5 次查看(过去 30 天)
I have the below data from contour grid, but I am not sure how to deal with it, the data are more than 3000 rows. I have two questions regarding this data:
1- How can I generate a contour plot from them?
2- How can I extract the X,Y,Z vectors for the data points sets from these data?
100 141 23.53579 33.28464
1.90671627E-03 1.94953856E-03 2.08172624E-03 2.31407308E-03 2.66342701E-03
3.15125294E-03 3.80188984E-03 4.64025445E-03 5.68824462E-03 6.95894936E-03
8.44838407E-03 1.01259534E-02 1.19266327E-02 1.37488209E-02 1.54609569E-02
1.69172529E-02 1.79795640E-02 1.85401754E-02 1.85401754E-02 1.79795640E-02
1.69172529E-02 1.54609569E-02 1.37488209E-02 1.19266327E-02 1.01259534E-02
8.44838407E-03 6.95894936E-03 5.68824462E-03 4.64025445E-03 3.80188984E-03
3.15125294E-03 2.66342701E-03 2.31407308E-03 2.08172624E-03 1.94953856E-03
1.90671627E-03 1.94953856E-03 2.08172624E-03 2.31407308E-03 2.66342701E-03
3.15125294E-03 3.80188984E-03 4.64025445E-03 5.68824462E-03 6.95894936E-03
8.44838407E-03 1.01259534E-02 1.19266327E-02 1.37488209E-02 1.54609569E-02
1.69172529E-02 1.79795640E-02 1.85401754E-02 1.85401754E-02 1.79795640E-02
....
(dpb formatted data as code...)
  3 个评论
Star Strider
Star Strider 2023-1-21
If that matrix is the result of a calculation on the ‘X’, ‘Y’, and‘Z’ vectors, it likely cannot be done.
Doing that would be the mathematical equivalent of un-frying an egg.
Adam Danz
Adam Danz 2023-1-21
Is the matrix of data you shared the input to contour(z)?
Is your question how to extract the (x,y,z) coordinates of lines produced by a contour plot with the input matrix you shared?

请先登录,再进行评论。

回答(1 个)

Sulaymon Eshkabilov
If you data as given n-by-5, then you can just use surf(z), e.g.:
data = rand(5,50);
surf(data)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by