Contour plotting from given datapoints

1 回表示 (過去 30 日間)
Paras Choudhary
Paras Choudhary 2022 年 9 月 25 日
回答済み: Bala Tripura Bodapati 2022 年 9 月 28 日
I have certain values of L and corresponding to each L value there is a value of R and Q respectively
How to contour plot them
on X axix we should have Q, on Y axix R and contours of L.
Values are
L1 = 26
R = 16 ;17 ; 19 ;25 ;26 ; 27 ; 30 ; 31 ; 32
Q = 9.74 ; 11.047 ; 13.88 ;24.45 ; 26.49 ; 28.56 ; 35.44 ; 37.88 ; 40.41
L2 = 28
R = 15;16;17;19;21;22;29;30;31
Q = 7.82 ; 8.9492 ; 10.16 ;12.78 ; 15.7 ; 17.28 ; 30.55 ; 32.74 ; 34.94

回答 (1 件)

Bala Tripura Bodapati
Bala Tripura Bodapati 2022 年 9 月 28 日
Hi Paras
It is my understanding that you would like to know how to create a contour plot based on the data provided for X-axis, Y-axis, and Z-values.
The X, Y and Z values must be in the form of a matrix for creating a contour plot. The following code illustrates how to create a contour plot for the data provided:
R = [16 ;17 ; 19 ;25 ;26 ; 27 ; 30 ; 31 ; 32]'
Q = [9.74 ; 11.047 ; 13.88 ;24.45 ; 26.49 ; 28.56 ; 35.44 ; 37.88 ; 40.41]'
R = [R;[15;16;17;19;21;22;29;30;31]']
Q = [Q;[ 7.82 ; 8.9492 ; 10.16 ;12.78 ; 15.7 ; 17.28 ; 30.55 ; 32.74 ; 34.94]']
L1 = 26.*ones(9,1)'
L2 = 28.*ones(9,1)'
Z = [L1;L2]
contour(Q,R,Z)
Please refer the contour documentation for more information.

カテゴリ

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