Contour plot with 3 independent variables

1 次查看(过去 30 天)
Hey,
I have a 10x10 matrix and two 1x10 vectors.
vector 1: [0 200 300 400 500 600 700 800 900 1000]
Vector 2 [0 2000 3000 4000 5000 6000 7000 8000 9000 10000]
Vectors are simulink inputs and the matrix is the simulink output. For example: when vector 1 is 0 and vector 2 is 2000 I get 3.1793. Below is the matrix
I am trying to create a 2d contour plot but I get straight lines. I have tried ndgrid, meshgrid, griddata etc. It did not help.
Please help!
Thanks,

采纳的回答

Star Strider
Star Strider 2021-5-28
It would help to have the matrix.
Try something like this —
figure
contour(Vector_1, Vector_2, Matrix)
.
  8 个评论
Walter Roberson
Walter Roberson 2021-5-29
Look at the first column of your data. It is strictly increasing.
Look at the last row of your data. It is strictly decreasing.
Look at your desired plot. Are there edges that are possibly strictly increasing? Yes -- the left and right edges just might be strictly increasing. However, in your desired plot, there is no situation in which two adjacent edges are both strictly increasing. Your top and bottom both increase and then decrease (or decrease and then increase).
Therefore the data you posted cannot possibly be used to create the kind of plot you expect -- not unless you have non-uniform coordinate systems.
MATLAB does not have a bug in the plotting: your data is not of the form that would be needed to get that kind of plot.
Feyza Boyun
Feyza Boyun 2021-5-29
That is correct, I see it now. Thank you all for helping me spot the issue. Cheers!

请先登录,再进行评论。

更多回答(0 个)

类别

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

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by