Saltar al contenido principal
LibreTexts Español

28.2: Arreglos

  • Page ID
    129620
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    A menudo ocurre que necesitamos representar una serie de números. Por ejemplo, imagina que has medido la posición de un objeto en función del tiempo. Las matrices son una manera conveniente de contener una serie de números que son todos iguales, por ejemplo, todos los valores de la posición y los valores de tiempo correspondientes para la trayectoria del objeto. En Python, podemos definir variables que mantengan matrices en lugar de un solo valor (las matrices se llaman “listas” en Python):

    código python\(\PageIndex{1}\)

    Matrices en python

    #define an array of values for the position of the object
    position = [0 ,1 ,4 ,9 ,16 ,25]
    #define an array of values for the corresponding times
    time = [0 ,1 ,2 ,3 ,4 ,5]
    

    This page titled 28.2: Arreglos is shared under a CC BY-SA license and was authored, remixed, and/or curated by Howard Martin revised by Alan Ng.