Hallo Udo,
danke fÃŒr Deinen Hinweis.
Ich habe es mit der Antwort von Jens-Peer Kuska versucht.
Geht leider nicht.
Im Anhang findest Du ein Mathematica-Notebook mit einem einfachen Beispiel.
Es sind nur ein paar Zeilen.
Könntest Du mal darÌber schauen.
Was muss ich Àndern?
Schon mal Danke im voraus.
Herzliche Gr�e
Reinhard Schlosser
Am 23/03/2013 18:41, schrieb Udo und Susanne Krause:
Hallo Reinhard,
Gibt es eine Möglichkeit Listen mit einer von 0 beginnenden ZÀhlung
zu verwenden.
Z. B. durch Àndern von Voreinstellungen.
das wurde diskutiert in der DMUG diskutiert
http://www.mathematica.ch/dmug-archive/2006/msg00050.html
http://www.mathematica.ch/dmug-archive/2006/msg00057.html
und _die_ Antwort ist von Jens-Peer Kuska
http://www.mathematica.ch/dmug-archive/2006/msg00069.html
Gruss
Udo.
(************** Content-type: application/mathematica **************
CreatedBy='Mathematica 5.0'
Mathematica-Compatible Notebook
This notebook can be used with any Mathematica-compatible
application, such as Mathematica, MathReader or Publicon. The data
for the notebook starts with the line containing stars above.
To get the notebook into a Mathematica-compatible application, do
one of the following:
* Save the data starting with the line of stars above into a file
with a name ending in .nb, then open the file inside the
application;
* Copy the data starting with the line of stars above to the
clipboard, then use the Paste menu command inside the application.
Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode. Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).
NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing
the word CacheID, otherwise Mathematica-compatible applications may
try to use invalid cache data.
For more information on notebooks and Mathematica-compatible
applications, contact Wolfram Research:
web: http://www.wolfram.com
email: info@XXXXXXX.com
phone: +1-217-398-0700 (U.S.)
Notebook reader applications are available free of charge from
Wolfram Research.
*******************************************************************)
(*CacheID: 232*)
(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[ 4242, 142]*)
(*NotebookOutlinePosition[ 5019, 169]*)
(* CellTagsIndexPosition[ 4975, 165]*)
(*WindowFrame->Normal*)
Notebook[{
Cell[BoxData[
\(\(n = 3;\)\)], "Input"],
Cell["St\[UDoubleDot]tzstellen", "Text"],
Cell[BoxData[
\(x[0] = 0.0; x[1] = 1.5; x[2] = 2.5; x[3] = 4.5;\)], "Input"],
Cell["\<\
St\[UDoubleDot]tzkoeffizienten f\[UDoubleDot]r die baryzentrische Formel der \
Lagrange Interpolation\
\>", "Text"],
Cell[BoxData[
\(\[Lambda][0] = 1.0;
Do[s = 0.0;
Do[\[Lambda][i] = \[Lambda][i]/\((x[i] - x[k])\);
s = s + \[Lambda][i], {i, 0, k - 1}]; \[Lambda][k] = \(-s\), {k, 1,
n}]\)], "Input"],
Cell["St\[UDoubleDot]tzkoeffizienten ausgeben", "Text"],
Cell[CellGroupData[{
Cell[BoxData[
\(Table[\[Lambda][i], {i, 0, n}]\)], "Input"],
Cell[BoxData[
\({\(-0.059259259259259255`\),
0.2222222222222222`, \(-0.19999999999999998`\),
0.037037037037037035`}\)], "Output"]
}, Open ]],
Cell["Die St\[UDoubleDot]tzkoeffizienten wurden richtig berechnet.", "Text"],
Cell["\<\
Jetzt versuche ich es mit Tables, deren Indizierungen mit Null beginnen,
dazu habe ich Ihren (Udo Krause) Hinweis verwendet: \"d i e Antwort von \
Jens-Peer Kuska\".\
\>", "Text"],
Cell[CellGroupData[{
Cell[BoxData[{
\(Unprotect[Part]\), "\n",
\(\($hooked = False;\)\), "\n",
\(\(\(Verbatim[Part]\)[a_, seq___] /; Not[$hooked] :=
Block[{$hooked = True},
Part[a, Sequence @@ \((\(\((# + 1)\) &\) /@ {seq})\)]];\)\), "\n",
\(Protect[Part]\)}], "Input"],
Cell[BoxData[
\({"Part"}\)], "Output"],
Cell[BoxData[
\({"Part"}\)], "Output"]
}, Open ]],
Cell[BoxData[
\(\(n = 3;\)\)], "Input"],
Cell[BoxData[
\(\(x = {0.0, 1.5, 2.5, 4.5};\)\)], "Input"],
Cell[BoxData[
\(\(\[Lambda] = Table[0, {i, 0, n}];\)\)], "Input"],
Cell[BoxData[
\(\[Lambda]\[LeftDoubleBracket]0\[RightDoubleBracket] = 1.0;
Do[s = 0.0;
Do[\[Lambda]\[LeftDoubleBracket]
i\[RightDoubleBracket] = \[Lambda]\[LeftDoubleBracket]
i\[RightDoubleBracket]/\((x\[LeftDoubleBracket]
i\[RightDoubleBracket] -
x\[LeftDoubleBracket]k\[RightDoubleBracket])\);
s = s + \[Lambda]\[LeftDoubleBracket]i\[RightDoubleBracket], {i, 0,
k - 1}]; \[Lambda]\[LeftDoubleBracket]
k\[RightDoubleBracket] = \(-s\), {k, 1, n}]\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(\[Lambda]\)], "Input"],
Cell[BoxData[
\(0[0.`, 0, 0.`, 0]\)], "Output"]
}, Open ]],
Cell["Das ist nicht die erhoffte Antwort. K\[ODoubleDot]nnen Sie da helfen?", \
"Text"]
},
FrontEndVersion->"5.0 for Microsoft Windows",
ScreenRectangle->{{0, 1920}, {0, 1127}},
WindowToolbars->"RulerBar",
CellGrouping->Manual,
WindowSize->{1406, 816},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
PrintingCopies->1,
PrintingPageRange->{Automatic, Automatic},
Magnification->1.5
]
(*******************************************************************
Cached data follows. If you edit this Notebook file directly, not
using Mathematica, you must remove the line containing CacheID at
the top of the file. The cache data will then be recreated when
you save this file from within Mathematica.
*******************************************************************)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[1754, 51, 43, 1, 42, "Input"],
Cell[1800, 54, 40, 0, 47, "Text"],
Cell[1843, 56, 80, 1, 42, "Input"],
Cell[1926, 59, 125, 3, 47, "Text"],
Cell[2054, 64, 216, 5, 42, "Input"],
Cell[2273, 71, 55, 0, 47, "Text"],
Cell[CellGroupData[{
Cell[2353, 75, 63, 1, 42, "Input"],
Cell[2419, 78, 147, 3, 41, "Output"]
}, Open ]],
Cell[2581, 84, 76, 0, 47, "Text"],
Cell[2660, 86, 189, 4, 73, "Text"],
Cell[CellGroupData[{
Cell[2874, 94, 287, 6, 120, "Input"],
Cell[3164, 102, 42, 1, 41, "Output"],
Cell[3209, 105, 42, 1, 41, "Output"]
}, Open ]],
Cell[3266, 109, 43, 1, 42, "Input"],
Cell[3312, 112, 62, 1, 42, "Input"],
Cell[3377, 115, 69, 1, 42, "Input"],
Cell[3449, 118, 566, 10, 42, "Input"],
Cell[CellGroupData[{
Cell[4040, 132, 42, 1, 42, "Input"],
Cell[4085, 135, 51, 1, 41, "Output"]
}, Open ]],
Cell[4151, 139, 87, 1, 47, "Text"]
}
]
*)
(*******************************************************************
End of Mathematica Notebook file.
*******************************************************************)