How can I get the X value of the red stars on my graph after interpolation? And could I have the values be put on the graph?

2 views (last 30 days)
x=[4.75,2,.85,.389,.15,.075,0];
y=[92.09,40.61,17.2,4.78,1.29,.72,0];
plot(x,y);
grid on;
semilogx(x,y);
xlabel('Particle Size (mm)');
ylabel('Percent Passing (%)');
y60=60;
xi=interp1(y,x,y60);
hold on
semilogy(xi,y60,'*r');
y30=30;
xi=interp1(y,x,y30);
hold on
semilogy(xi,y30,'*r');
y10=10;
xi=interp1(y,x,y10);
hold on
semilogy(xi,y10,'*r');
  1 Comment
Walter Roberson
Walter Roberson on 14 Sep 2018
? The x values associated with the red stars are the three xi vectors that you calculate: just make sure you do not overwrite them as you proceed.

Sign in to comment.

Answers (1)

KSSV
KSSV on 14 Sep 2018
x=[4.75,2,.85,.389,.15,.075,0];
y=[92.09,40.61,17.2,4.78,1.29,.72,0];
plot(x,y); grid on;
semilogx(x,y); xlabel('Particle Size (mm)'); ylabel('Percent Passing (%)');
y60=60;
xi=interp1(y,x,y60); hold on
semilogy(xi,y60,'*r');
y30=30; xi=interp1(y,x,y30); hold on
semilogy(xi,y30,'*r');
y10=10; xi=interp1(y,x,y10); hold on
semilogy(xi,y10,'*r');
The code is fine......just flush the_semilogy_ next to hold on to next line.

Categories

Find more on Interpolation in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!