필터 지우기
필터 지우기

how to find y value from the 3d graph with a known x and z values

조회 수: 11 (최근 30일)
I have a question, and I hope you can answer it
I have plot 3d graph ( as i have attached in image 1 ) between
x=[2.6,5.2,14,23.3,28.3,2.6,5.2,14,23.3,28.3,2.6,5.2,14,23.3,28.3]
y=[3.5,6.9,17.7,29.1,35.2,3.5,6.8,17.5,28.7,34.8,3.4,6.6,16.9,27.6,33.5]
z=[450,450,450,450,450,350,350,350,350,350,250,250,250,250,250]
after that
I have 20 patient
and each patient have associated with different z , x and y values
and for each patient i have z and x values , but i dont have y
And I want to know y value for each patient
so that why i have collect data ( as you can see above )( and all this data i have collect it are in the range of my patient ) and i have plot a 3d graph to estimate the y for each patent from this data ( lookup table )
For example
Patient number 4
Z = 367
x = 20
Y = ???
As you can see from the 3d image i have attached ( image 2 and 3) I can estimate what is the y for patient 4, But it will be very difficult and not accurate
so I am looking for stander fit to estimate y for each z and x values I have for 20 patient
I am looking for a function to estimate y for each z and x values I have for 20 patient

채택된 답변

Guillaume
Guillaume 2020년 3월 5일
편집: Guillaume 2020년 3월 5일
Seems fairly simply, just build a scattered interpolant and use that to interpolate your query points.
x=[2.6,5.2,14,23.3,28.3,2.6,5.2,14,23.3,28.3,2.6,5.2,14,23.3,28.3];
y=[3.5,6.9,17.7,29.1,35.2,3.5,6.8,17.5,28.7,34.8,3.4,6.6,16.9,27.6,33.5];
z=[450,450,450,450,450,350,350,350,350,350,250,250,250,250,250];
YfromXZ = scatteredInterpolant(x(:), z(:), y(:)); %interpolant that lets you calculate y knowing x and z
queryx = 20; %can be a vector/matrix
queryz = 367; %can be a vector/matrix as long as it's the same size as queryx
matchingy = YfromXZ(queryx, queryz);
%for visualisation
figure; scatter3(x, y, z); hold('on'); plot3(queryx, matchingy, queryz, 'r*');
  댓글 수: 2
ahmad albngali
ahmad albngali 2020년 3월 5일
this was very good
thank you for help
ahmad albngali
ahmad albngali 2020년 4월 21일
hi
after i have plot between x y and z
x=[2.6,5.2,14,23.3,28.3,2.6,5.2,14,23.3,28.3,2.6,5.2,14,23.3,28.3];
y=[3.5,6.9,17.7,29.1,35.2,3.5,6.8,17.5,28.7,34.8,3.4,6.6,16.9,27.6,33.5];
z=[450,450,450,450,450,350,350,350,350,350,250,250,250,250,250];
i want to make error bar for y in the same graph
and i have the stander division for y
which is ( 0.047140452, 0.047140452, 0.047140452, 0.124721913, 0.047140452, 0.047140452, 0.047140452, 0.047140452, 0.124721913, 0.124721913, 0.047140452, 0.047140452, 0.047140452, 0.124721913, 0.124721913)
so culd you tell me what is the code for that

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by