From: parul agrawal on
i have plotted a graph in matlab using table, but if i want to find Y value using corresponding X value , how can i get.

means suppose i have graph between X and y...........now if i give a particular value of X then how i can get Y value corresponding to that given X value.
From: Sean on
"parul agrawal" <parulagrawal18(a)gmail.com> wrote in message <hopks2$laa$1(a)fred.mathworks.com>...
> i have plotted a graph in matlab using table, but if i want to find Y value using corresponding X value , how can i get.
>
> means suppose i have graph between X and y...........now if i give a particular value of X then how i can get Y value corresponding to that given X value.

x = [0:1:10];
y = rand(size(x))*100;
xval = 7;
yval = y(x==7);
From: kinor on
"parul agrawal" <parulagrawal18(a)gmail.com> wrote in message <hopks2$laa$1(a)fred.mathworks.com>...
> i have plotted a graph in matlab using table, but if i want to find Y value using corresponding X value , how can i get.
>
> means suppose i have graph between X and y...........now if i give a particular value of X then how i can get Y value corresponding to that given X value.

Hi Parul

assuming you have the x and y-values in vectors X, Y and you are looking for the y-value y1 at x-position x1
this would be one of many solutions:

idx = find(X==x1);
y1 = Y(idx);

hth
kinor
From: parul agrawal on
"kinor " <kinor.removethiswithdot(a)gmx.de> wrote in message <hopmmf$if3$1(a)fred.mathworks.com>...
> "parul agrawal" <parulagrawal18(a)gmail.com> wrote in message <hopks2$laa$1(a)fred.mathworks.com>...
> > i have plotted a graph in matlab using table, but if i want to find Y value using corresponding X value , how can i get.
> >
> > means suppose i have graph between X and y...........now if i give a particular value of X then how i can get Y value corresponding to that given X value.
>
> Hi Parul
>
> assuming you have the x and y-values in vectors X, Y and you are looking for the y-value y1 at x-position x1
> this would be one of many solutions:
>
> idx = find(X==x1);
> y1 = Y(idx);
>
> hth
> kinor



Hi

thanks
its working , but suppose i have
x = [1 2 3 4];
y = [2 8 3 9];
plot(x,y);
now if i use
idx = find(x==3);
y1 = y(3);
it will give ans = 3

but if i want to use all values of curve (y verses x) then...
idx = find(x==2.5);
then?

means i have plotted curve using some values of x and y but now want to use any value of y on curve corresponding to x...what to do?
From: muhammadzeshan Ali on
"parul agrawal" <parulagrawal18(a)gmail.com> wrote in message <hopqe8$kun$1(a)fred.mathworks.com>...
> "kinor " <kinor.removethiswithdot(a)gmx.de> wrote in message <hopmmf$if3$1(a)fred.mathworks.com>...
> > "parul agrawal" <parulagrawal18(a)gmail.com> wrote in message <hopks2$laa$1(a)fred.mathworks.com>...
> > > i have plotted a graph in matlab using table, but if i want to find Y value using corresponding X value , how can i get.
> > >
> > > means suppose i have graph between X and y...........now if i give a particular value of X then how i can get Y value corresponding to that given X value.
> >
> > Hi Parul
> >
> > assuming you have the x and y-values in vectors X, Y and you are looking for the y-value y1 at x-position x1
> > this would be one of many solutions:
> >
> > idx = find(X==x1);
> > y1 = Y(idx);
> >
> > hth
> > kinor
>
>
>
> Hi
>
> thanks
> its working , but suppose i have
> x = [1 2 3 4];
> y = [2 8 3 9];
> plot(x,y);
> now if i use
> idx = find(x==3);
> y1 = y(3);
> it will give ans = 3
>
> but if i want to use all values of curve (y verses x) then...
> idx = find(x==2.5);
> then?
>
> means i have plotted curve using some values of x and y but now want to use any value of y on curve corresponding to x...what to do?




can this be done by docinterp1?
 |  Next  |  Last
Pages: 1 2
Prev: fingerprint core / singular point
Next: TD-SCDMA