f



How to get values?

Hello
If I have a function y=f(x), is there any way to find x values for
known y??
For example I have
x=0:1:20;
y=x;
plot(t,x)

I am taking x values from 0 to 20. Is it possible to find value for x
if y=2.1??

Thanks in advance
Kota.
0
3/4/2005 11:18:40 PM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

3 Replies
428 Views

Similar Articles

[PageSpeed] 25

S Kota wrote:
>
>
> Hello
> If I have a function y=f(x), is there any way to find x values for
> known y??
> For example I have
> x=0:1:20;
> y=x;
> plot(t,x)
>
> I am taking x values from 0 to 20. Is it possible to find value for
> x
> if y=2.1??
>
> Thanks in advance
> Kota.

HELP FUNCTION
HELP INLINE
HELP SOLVE
HELP FZERO
HELP FMIN
0
3/5/2005 4:04:40 AM
Michael Robbins wrote:
>
>
> S Kota wrote:
>>
>>
>> Hello
>> If I have a function y=f(x), is there any way to find x values
> for
>> known y??
>> For example I have
>> x=0:1:20;
>> y=x;
>> plot(t,x)
>>
>> I am taking x values from 0 to 20. Is it possible to find value
> for
>> x
>> if y=2.1??
>>
>> Thanks in advance
>> Kota.
>
> HELP FUNCTION
> HELP INLINE
> HELP SOLVE
> HELP FZERO
> HELP FMIN

Hi,
Use interp1 in the inverse sense:
x1=interp1(y,x,y1);

Example:
>> x=0:20;
>> y=sqrt(x);
>> x1=interp(y,x,3.1)
x1 =

    9.6162
Joe Sababa

The new BSTeX - Equation viewer for Matlab7
 <http://www.geocities.com/bstex2001/>
0
joesababa (190)
3/5/2005 4:34:15 PM
Thanks Joe and Michael.

Joe Sababa wrote:
>
>
> Michael Robbins wrote:
>>
>>
>> S Kota wrote:
>>>
>>>
>>> Hello
>>> If I have a function y=f(x), is there any way to find x
> values
>> for
>>> known y??
>>> For example I have
>>> x=0:1:20;
>>> y=x;
>>> plot(t,x)
>>>
>>> I am taking x values from 0 to 20. Is it possible to find
> value
>> for
>>> x
>>> if y=2.1??
>>>
>>> Thanks in advance
>>> Kota.
>>
>> HELP FUNCTION
>> HELP INLINE
>> HELP SOLVE
>> HELP FZERO
>> HELP FMIN
>
> Hi,
> Use interp1 in the inverse sense:
> x1=interp1(y,x,y1);
>
> Example:
>>> x=0:20;
>>> y=sqrt(x);
>>> x1=interp(y,x,3.1)
> x1 =
>
> 9.6162
> Joe Sababa
>
> The new BSTeX - Equation viewer for Matlab7
> <http://www.geocities.com/bstex2001/>
0
3/5/2005 9:32:45 PM
Reply: