hello,
i have a problem for which i'm sure a solution exists already ..
i have an independent variable 'x' and its corresponding dependent
'y' ... is there anyway using matlab where i can get the corresponding
y-variable for whatever value of x i choose, and vice-versa.
thanks.
rush <rush3k@gmail.com> wrote in message <de304b45-bc9a-49ff-adce-
9e96a2bd7d14@n20g2000hsh.googlegroups.com>...
> hello,
> i have a problem for which i'm sure a solution exists already ..
> i have an independent variable 'x' and its corresponding dependent
> 'y' ... is there anyway using matlab where i can get the corresponding
> y-variable for whatever value of x i choose, and vice-versa.
> thanks.
This is a well studied problem, but one with many
answers. The general problem is called interpolation.
The issue is that you need to choose a method that
is appropriate to your specific problem.
Several reasonable methods will be found in the
function interp1, assuming that you have only one
independent variable.
rush <rush3k@gmail.com> wrote in message <de304b45-bc9a-
49ff-adce-9e96a2bd7d14@n20g2000hsh.googlegroups.com>...
> hello,
> i have a problem for which i'm sure a solution exists
already ..
> i have an independent variable 'x' and its corresponding
dependent
> 'y' ... is there anyway using matlab where i can get the
corresponding
> y-variable for whatever value of x i choose, and vice-
versa.
> thanks.
Are the variables x and y given as lists of numbers, or do
you have y as a function of x?
If it's the former, then the solution to your problem is
could be as simple as running a search on the lists.
If it's the latter, then there are issues that go beyond
just computing x given a y. Do you have a specific
function and can you post it? Or are you interested in
this problem for arbitrary functions?
On Jan 3, 9:54 am, "Charles Cuell" <cu...@math.usask.ca> wrote:
> rush <rus...@gmail.com> wrote in message <de304b45-bc9a-
>
> 49ff-adce-9e96a2bd7...@n20g2000hsh.googlegroups.com>...
>
> > hello,
> > i have a problem for which i'm sure a solution exists
> already ..
> > i have an independent variable 'x' and its corresponding
> dependent
> > 'y' ... is there anyway using matlab where i can get the
> corresponding
> > y-variable for whatever value of x i choose, and vice-
> versa.
> > thanks.
>
> Are the variables x and y given as lists of numbers, or do
> you have y as a function of x?
>
> If it's the former, then the solution to your problem is
> could be as simple as running a search on the lists.
>
> If it's the latter, then there are issues that go beyond
> just computing x given a y. Do you have a specific
> function and can you post it? Or are you interested in
> this problem for arbitrary functions?
>
> Charles.
Thanks for the information John and Charles. The problem was solved
using the interp1 as adviced by John. I dont have a function
representing y, that would made the problem easier. . It will be
interesting to know how to "search on the lists" as Charles has
suggested. Thank you.
Tags for this Thread
Add a New Tag:
Separated by commas
Ex.: root locus, bode
What are tags?
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Disclaimer prior to use.