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 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