how to connect interpolation and probability

조회 수: 3 (최근 30일)
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2021년 9월 18일
댓글: ELISABETTA BILLOTTA 2021년 9월 19일
starting from 3 distance values and 3 speed values I managed to create this grid by interpolating all the values (the colored points) and thus obtaining all the other speeds: new_speed = interp1 (distance, speed, new_distance, 'linear').
Now on each of these points I should add another information, that of probability. Also in this case I have only 3 information on probabilities, each relating to a speed and a distance. can anyone help me?
the code is:
prob_a=[10.48 23.31 23.46 18.20 11.50 6.99 2.77 1.02 0.32 0.05 10.48]; %55km-7m/s
prob_b=[6.76 14.58 15.19 12.47 8.20 5.12 2 0.75 0.24 0.03 6.76]; %500km-30m/s
prob_c=[0.36 0.54 0.36 0.15 0.06 0.01 0 0 0 0 0.36]; %667km-70m/s
z1 = calcola_dist
x = [0 55 500 667]; %distance
v = [0 7 30 70]; %velocity
xq = z1; %new distance
vq2 = interp1(x,v,xq,'linear');
plot(lonlatgrd(:,1),lonlatgrd(:,2),'.');
hold on
scatter(lonlatgrd(:,1),lonlatgrd(:,2),20,vq2,'filled');
colormap hsv
colorbar
title('new velocity m/s')
  댓글 수: 2
darova
darova 2021년 9월 19일
THe question is unclear. You are trying to visualize something?
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2021년 9월 19일
yes, I am trying to always display the probability values on the colored points. but also in this case, as for velocities, I only have 3 arrays of probability values. I tried to use the interp1 function in this case too but it doesn't work. Can anyone help me? is the question clearer?

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

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 9월 19일
Some of your data, used in your code, are not provided here. Moreover, it is not quite clear "connect"? What you are trying to do is to see how much your interpolated data correlates with the probability data or something else?
  댓글 수: 1
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2021년 9월 19일
in the code and therefore also in the image I was able to calculate all the speeds through interpolation even in the points where I did not have the speed value. I would like to do the same for the odds. then create another graph where through 3 arrays of probability values, I can get the result for all the other points as well.

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

카테고리

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