How to create contour plot with xyz data?

6 ビュー (過去 30 日間)
Kenneth
Kenneth 2020 年 6 月 6 日
回答済み: Star Strider 2020 年 6 月 6 日
How I can create contour plot like figure above with data below
x=[53
59
62
68]
y=[9.9
9.5
9.8
10.2]
z=[1
3
5
10]
xv = linspace(min(39), max(62), numel(4));
yv = linspace(min(29), max(52), numel(4));
[Xm,Ym] = ndgrid(xv, yv);
Zm = griddata(x, y, z, Xm, Ym);
figure
contourf(Xm, Ym, Zm)
grid
I am using this code but it does not work. error:x must not be scaler
Anyone can help?
  6 件のコメント
Kenneth
Kenneth 2020 年 6 月 6 日
z is length, x is DIBL and y is gate voltage.
I dont have any formula.
KSSV
KSSV 2020 年 6 月 6 日
LEt (x,y,z) be your 4*3 data.
[X,Y] = meshgrid(x,y) ;
Now you see, do you have data for each (X,Y) ??

サインインしてコメントする。

回答 (1 件)

Star Strider
Star Strider 2020 年 6 月 6 日
The original vectors do not provide much information.
This is likely the best you can do:
x=[53
59
62
68];
y=[9.9
9.5
9.8
10.2];
z=[1
3
5
10];
xv = linspace(min(x), max(x), 125);
yv = linspace(min(y), max(y), 125);
[Xm,Ym] = ndgrid(xv, yv);
Zm = griddata(x, y, z, Xm, Ym);
figure
contourf(Xm, Ym, Zm)
grid
Experiment to get different results.
.

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by