3D Ploting with a column having the same value

hi, i'm currently having a little trouble or misunderstanding. I want to plot a Matrix using countourf.
Matrix =
L C P
1 1 953.2606
1 2 752.0167
1 3 1
1 4 1.2286e+03
1 5 1
1 6 2.1819e+03
1 7 720.2413
1 8 1.0804e+03
1 9 1.6523e+03
but as you can see the first column is the same value, i tried:
xi=linspace(min(L1),max(L1),30);
yi=linspace(min(C),max(C),30);
[XI YI]=meshgrid(xi,yi);
ZI = griddata(L1,C,P,XI,YI);
figure
contourf(XI,YI,ZI);
L1 beeing the L broken down into 9 to fit:
0,111111111111111
0,222222222222222
0,333333333333333
0,444444444444444
0,555555555555556
0,666666666666667
0,777777777777778
0,888888888888889
1,00000000000000
but still nothing shows. and the same could be true for something like that:
L C P
1 1 953.2606
2 1 1.6523e+03
3 1 1.0804e+03
4 1 953.2606
5 1 1.6523e+03
The thing is i would like a something other than a line when i plot in 3d, i would like a cartography, thus why i use contourf.
Thank you

 採用された回答

KSSV
KSSV 2016 年 8 月 9 日

0 投票

data = [1 1 953.2606
1 2 752.0167
1 3 1
1 4 1.2286e+03
1 5 1
1 6 2.1819e+03
1 7 720.2413
1 8 1.0804e+03
1 9 1.6523e+03];
L = data(:,1) ;
C = data(:,2) ;
P = data(:,3) ;
X = reshape(L,[3 3]) ;
Y = reshape(C,[3 3]) ;
Z = reshape(P,[3 3]) ;
figure
contour(X,Y,Z) ;
title('It gives a line')
figure
contourf(Z)
title('If you dont consider X and Y')

1 件のコメント

Samuel Cloutier Landry
Samuel Cloutier Landry 2016 年 8 月 9 日
Thank you, and let's say i have something like that
1 1 953.2606

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSpline Postprocessing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by