Re:
- From: Muffin <aam47@xxxxxxxxxxx>
- Date: Tue, 12 Feb 2008 13:57:11 -0800 (PST)
On Feb 12, 4:50 pm, "Ian Clarkson" <ian.clark...@xxxxxxxxxxxxxx>
wrote:
Muffin <aa...@xxxxxxxxxxx> wrote in message <68c7fd7b-439e-
4f0f-9f73-45d3e809c...@xxxxxxxxxxxxxxxxxxxxxxxxxxx>...> On Feb 12, 4:36 pm, rober...@xxxxxxxxxxxxxxxxxx (Walter
Roberson)
wrote:
In article <46b5fd6c-5318-4335-b6c6-
87469613b...@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
want to find aMuffin <aa...@xxxxxxxxxxx> wrote:
I plotted data and then fitted it with a curve. Now I
the curve equalspoint between the data points where the area under
computer lastthe area over the curve. This was working on another
error:night with an older version of Matlab but now the
Subscript indices must either be real positive
integers or logicals.
keeps coming up.
Xdata = 0.1:.001:1.6;
plane = spline(X, Y, Xdata)
reason theIf you had a variable named 'spline', or if for some
would thinkroutine named 'spline' could not be found, then Matlab
withyou were trying to access a variable named 'spline'
indices that were not integers.
least inspline() does appear to be a part of basic matlab, at
information asR2007a. I glanced around but could not find any
Matlab 6.1)to when it was introduced as an independant function
(as an option to interp1 it goes back to at least
through--
"When a scientist is ahead of his times, it is often
of future truth.misunderstanding of current, rather than intuition
it won't one day,In science there is never any error so gross that
Rostandfrom some perspective, appear prophetic." -- Jean
spline is a routine here. I used help spline. Do youhave any other
ideas to fit the data points then so I can use thefunction fzero.
Apparently, that is where the error message: "Subscriptindices must
either be real positive integers or logicals." are
coming up
try putting a "clear spline" before you call the function,
just to make sure
Im pretty sure the spline isn't a problem:
%1.a)
%This plots the x-axis vs. the y-axis data points. I transposed it
into a
%column vector
X = [0.1:0.1:1.6]'
Y = [0.0, .1472, .34331, .5235, .6701, .7803, .8586, .9118, .9464, .
9683, .9817, .9897, .9943, .9969, .9983, 1.0]'
%Here, I fitted the data points using a cubicspline and plotted the
curve. Unfortunately, the fit
%option is on older versions of Matlab so it may not work on every
computer
%since I wrote the code in the Bard computer room where they were
older
%versions
Xdata = [0.1:.001:1.6]';
plane = spline(X, Y, Xdata)
plot(X, Y, 'ko', Xdata, plane, 'r-')
%This labelled the plot
xLabel(' x (cm)')
yLabel('Normalized Concentration Ca/Co')
clear spline
%This set to functions equal to y and the other to 1-y
f = @(X)plane(X)
g = @(X)1-plane(X)
%quad integrates the function and then matano finds the point where
the
%area under the curve is equal to the area above the curve
matano = @(X)quad(f, 0.1, X) - quad(g, X, 1.6);
fzero(matano, 0.1,1.6)
.
- References:
- "Subscript indices must either be real positive integers or logicals." What should I do
- From: Muffin
- Re: "Subscript indices must either be real positive integers or logicals." What should I do
- From: Muffin
- Re:
- From: Ian Clarkson
- "Subscript indices must either be real positive integers or logicals." What should I do
- Prev by Date: Sum a region within a matrix
- Next by Date: Re: "Subscript indices must either be real positive integers or logicals." What should I do
- Previous by thread: Re:
- Next by thread: Re: "Subscript indices must either be real positive integers or logicals." What should I do
- Index(es):
Relevant Pages
|