Prev: GUIDE and prgrammaticaly create GUI
Next: how to use neural network to tell true or false of a realtime input?
From: IAV Michel on 19 Jul 2010 14:44 Hi, I want to extrapolate a point using interp2. When I use the synthax ZI= interp2[X,Y, Z, XI,YI,'method',extrapval], it returns undefined variable or function extrapval. Can somebody help me please? Sincerely
From: Steven_Lord on 19 Jul 2010 15:18 "IAV Michel" <martcoul70(a)yahoo.fr> wrote in message news:i226dk$jbm$1(a)fred.mathworks.com... > Hi, > I want to extrapolate a point using interp2. When I use the synthax ZI= > interp2[X,Y, Z, XI,YI,'method',extrapval], it returns undefined variable > or function extrapval. > Can somebody help me please? > Sincerely First of all, you need to use the correct syntax. Function calls in MATLAB use parentheses, not square brackets. Secondly, for that syntax you need to specify the interpolation method by replacing the word 'method' by the name of the interpolation method to use (like 'linear') and the extrapolation value by replacing the identifier extrapval with the value you want used for extrapolation. So if you wanted to perform linear interpolation and return 0.5 outside the region where the function has enough information to interpolate: zi = interp2(x, y, z, xi, yi, 'linear', 0.5) Note that I'm assuming x, y, z, xi, and yi are all defined when you execute that command. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: IAV Michel on 19 Jul 2010 15:33 "Steven_Lord" <slord(a)mathworks.com> wrote in message <i228dj$s33$1(a)fred.mathworks.com>... > > > "IAV Michel" <martcoul70(a)yahoo.fr> wrote in message > news:i226dk$jbm$1(a)fred.mathworks.com... > > Hi, > > I want to extrapolate a point using interp2. When I use the synthax ZI= > > interp2[X,Y, Z, XI,YI,'method',extrapval], it returns undefined variable > > or function extrapval. > > Can somebody help me please? > > Sincerely > > First of all, you need to use the correct syntax. Function calls in MATLAB > use parentheses, not square brackets. > > Secondly, for that syntax you need to specify the interpolation method by > replacing the word 'method' by the name of the interpolation method to use > (like 'linear') and the extrapolation value by replacing the identifier > extrapval with the value you want used for extrapolation. So if you wanted > to perform linear interpolation and return 0.5 outside the region where the > function has enough information to interpolate: > > zi = interp2(x, y, z, xi, yi, 'linear', 0.5) > > Note that I'm assuming x, y, z, xi, and yi are all defined when you execute > that command. > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > To contact Technical Support use the Contact Us link on > http://www.mathworks.com Sorry, it was a mistake in the synthax. When i supply a value for extrapval, it returns error using interp2 too many input arguments
From: Steven_Lord on 19 Jul 2010 15:36 "IAV Michel" <martcoul70(a)yahoo.fr> wrote in message news:i2299t$pl3$1(a)fred.mathworks.com... > "Steven_Lord" <slord(a)mathworks.com> wrote in message > <i228dj$s33$1(a)fred.mathworks.com>... *snip* > Sorry, it was a mistake in the synthax. When i supply a value for > extrapval, it returns error using interp2 too many input arguments What version of MATLAB are you using? If you look at the help for INTERP2 _in your version of MATLAB_ (rather than the documentation on the website, which is for the most recent version) does it show the extrapval option? It's possible, if you're using an old version of MATLAB, that your version predates the introduction of the extrapval feature. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: IAV Michel on 19 Jul 2010 15:43 "Steven_Lord" <slord(a)mathworks.com> wrote in message <i229g7$8st$1(a)fred.mathworks.com>... > > > "IAV Michel" <martcoul70(a)yahoo.fr> wrote in message > news:i2299t$pl3$1(a)fred.mathworks.com... > > "Steven_Lord" <slord(a)mathworks.com> wrote in message > > <i228dj$s33$1(a)fred.mathworks.com>... > > *snip* > > > Sorry, it was a mistake in the synthax. When i supply a value for > > extrapval, it returns error using interp2 too many input arguments > > What version of MATLAB are you using? > > If you look at the help for INTERP2 _in your version of MATLAB_ (rather than > the documentation on the website, which is for the most recent version) does > it show the extrapval option? > > It's possible, if you're using an old version of MATLAB, that your version > predates the introduction of the extrapval feature. > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > To contact Technical Support use the Contact Us link on > http://www.mathworks.com The help in my Matlab version (Matlab 6.5) for interp2 dosen't show the extrapval version but for interp1, this option is available.
|
Next
|
Last
Pages: 1 2 Prev: GUIDE and prgrammaticaly create GUI Next: how to use neural network to tell true or false of a realtime input? |