This document provides an introduction and overview of key concepts for working with numeric, cell, and structure arrays in MATLAB for geoscientists. It discusses how to create vectors and matrices, perform element-by-element operations on arrays, do matrix multiplication and division, and work with special matrices like identity and zero matrices. It also covers generating regularly spaced vectors using colon notation, appending vectors, and creating logarithmically spaced arrays with logspace. Polynomial operations like multiplication, division, finding roots and coefficients are also summarized.
This document provides an outline and overview of topics related to arrays and matrices. It begins with an introduction to one-dimensional arrays, how they are represented in memory, and common operations on arrays. It then discusses the limitations of linear arrays and introduces multidimensional arrays. Specific types of multidimensional arrays covered include two-dimensional arrays and special matrices such as diagonal, tridiagonal, lower triangular, and upper triangular matrices. Memory mapping techniques for multidimensional arrays like row-major and column-major ordering are also summarized.
This document provides an overview of MATLAB, including:
- MATLAB is a software package for numerical computation, originally designed for linear algebra problems using matrices. It has since expanded to include other scientific computations.
- MATLAB treats all variables as matrices and supports various matrix operations like addition, multiplication, element-wise operations, and matrix manipulation functions.
- MATLAB allows plotting of 2D and 3D graphics, importing/exporting of data from files and Excel, and includes flow control statements like if/else, for loops, and while loops to structure code execution.
- Efficient MATLAB programming involves using built-in functions instead of custom functions, preallocating arrays, and avoiding nested loops where possible through matrix operations.
This document summarizes key concepts about determinants including:
1) The determinant function maps a square matrix to a real number and can be evaluated through cofactor expansion or row reduction.
2) Properties of the determinant include being zero if a row or column is zero and being the product of diagonals for triangular matrices.
3) Elementary row operations preserve the determinant up to a factor of -1 for row interchanges.
4) Cramer's rule uses determinants to solve systems of linear equations when the matrix is invertible.
This document discusses various polynomial functions in MATLAB. It covers defining and manipulating polynomials, including evaluation, finding roots, addition/subtraction, multiplication/division, derivatives, and curve fitting using polynomial regression. Polynomials in MATLAB are defined as row vectors of coefficients. Key functions include polyval for evaluation, roots for finding roots, conv for multiplication, deconv for division, and polyfit for curve fitting.
Introduction
Plotting basic 2-D plots.
The plot command
The fplot command
Plotting multiple graphs in the same plot
Formatting plots
USING THE plot() COMMAND TO PLOT
MULTIPLE GRAPHS IN THE SAME PLOT
MATLAB PROGRAM TO PLOT VI CHARACTERISTICS OF A DIODE
SUMMARY
This lesson discusses graphing functions. It begins with examples of graphing functions given a limited domain by finding ordered pairs that satisfy the function and plotting the points. It then covers graphing functions with a domain of all real numbers by choosing values of x, finding corresponding y-values, plotting points to see a pattern, and drawing a line with arrowheads. The lesson shows how to use graphs to find function values and solve real-world problems by limiting domains to non-negative values.
This document provides instructions for performing various operations on matrices using Microsoft Excel. It begins by stating the intended audience and objectives, which are to learn how to add and subtract matrices, multiply a matrix by a scalar, multiply two matrices, and find the determinant and inverse of a matrix using Excel. The document then provides definitions and examples of matrices. It proceeds to explain how to add and subtract matrices by adding the corresponding elements. It also explains how to multiply a matrix by a scalar and multiply two matrices according to the standard rules. The document demonstrates how to use Excel formulas like MMULT, MDETERM, and MINVERSE to calculate the product, determinant, and inverse of matrices. It concludes by providing some additional resources on the topic
The document is a lesson on calculating slope from various representations of lines, including two points, graphs, tables, and equations. It provides examples of finding the slope using different methods and interpreting what the slope represents in real-world contexts. Key methods covered are using the slope formula with two points, choosing points from graphs and tables, and finding the x- and y-intercepts of a line from its equation to then apply the slope formula.
This document provides an outline and overview of topics related to arrays and matrices. It begins with an introduction to one-dimensional arrays, how they are represented in memory, and common operations on arrays. It then discusses the limitations of linear arrays and introduces multidimensional arrays. Specific types of multidimensional arrays covered include two-dimensional arrays and special matrices such as diagonal, tridiagonal, lower triangular, and upper triangular matrices. Memory mapping techniques for multidimensional arrays like row-major and column-major ordering are also summarized.
This document provides an overview of MATLAB, including:
- MATLAB is a software package for numerical computation, originally designed for linear algebra problems using matrices. It has since expanded to include other scientific computations.
- MATLAB treats all variables as matrices and supports various matrix operations like addition, multiplication, element-wise operations, and matrix manipulation functions.
- MATLAB allows plotting of 2D and 3D graphics, importing/exporting of data from files and Excel, and includes flow control statements like if/else, for loops, and while loops to structure code execution.
- Efficient MATLAB programming involves using built-in functions instead of custom functions, preallocating arrays, and avoiding nested loops where possible through matrix operations.
This document summarizes key concepts about determinants including:
1) The determinant function maps a square matrix to a real number and can be evaluated through cofactor expansion or row reduction.
2) Properties of the determinant include being zero if a row or column is zero and being the product of diagonals for triangular matrices.
3) Elementary row operations preserve the determinant up to a factor of -1 for row interchanges.
4) Cramer's rule uses determinants to solve systems of linear equations when the matrix is invertible.
This document discusses various polynomial functions in MATLAB. It covers defining and manipulating polynomials, including evaluation, finding roots, addition/subtraction, multiplication/division, derivatives, and curve fitting using polynomial regression. Polynomials in MATLAB are defined as row vectors of coefficients. Key functions include polyval for evaluation, roots for finding roots, conv for multiplication, deconv for division, and polyfit for curve fitting.
Introduction
Plotting basic 2-D plots.
The plot command
The fplot command
Plotting multiple graphs in the same plot
Formatting plots
USING THE plot() COMMAND TO PLOT
MULTIPLE GRAPHS IN THE SAME PLOT
MATLAB PROGRAM TO PLOT VI CHARACTERISTICS OF A DIODE
SUMMARY
This lesson discusses graphing functions. It begins with examples of graphing functions given a limited domain by finding ordered pairs that satisfy the function and plotting the points. It then covers graphing functions with a domain of all real numbers by choosing values of x, finding corresponding y-values, plotting points to see a pattern, and drawing a line with arrowheads. The lesson shows how to use graphs to find function values and solve real-world problems by limiting domains to non-negative values.
This document provides instructions for performing various operations on matrices using Microsoft Excel. It begins by stating the intended audience and objectives, which are to learn how to add and subtract matrices, multiply a matrix by a scalar, multiply two matrices, and find the determinant and inverse of a matrix using Excel. The document then provides definitions and examples of matrices. It proceeds to explain how to add and subtract matrices by adding the corresponding elements. It also explains how to multiply a matrix by a scalar and multiply two matrices according to the standard rules. The document demonstrates how to use Excel formulas like MMULT, MDETERM, and MINVERSE to calculate the product, determinant, and inverse of matrices. It concludes by providing some additional resources on the topic
The document is a lesson on calculating slope from various representations of lines, including two points, graphs, tables, and equations. It provides examples of finding the slope using different methods and interpreting what the slope represents in real-world contexts. Key methods covered are using the slope formula with two points, choosing points from graphs and tables, and finding the x- and y-intercepts of a line from its equation to then apply the slope formula.
This document provides information about writing equations of lines in point-slope form and discusses key concepts like:
- Point-slope form uses the slope (m) and a point (x1, y1) on the line to write the equation.
- It gives examples of writing equations of lines where the slope and point are given.
- It also covers writing equations of lines given two points by first calculating the slope and then using point-slope form.
- Finally, it discusses writing equations of lines parallel or perpendicular to given lines.
The document discusses multi-dimensional and two-dimensional lists. It explains that two-dimensional lists can represent tables of values arranged in rows and columns, with each element identified by two indices - the row and column. It provides examples of declaring and initializing two-dimensional lists, including nested list initializers. It also covers passing two-dimensional arrays as function parameters.
The document discusses multidimensional arrays and provides examples of declaring and using two-dimensional arrays in Java. It describes how to represent tables of data using two-dimensional arrays, initialize arrays, access elements, and perform common operations like summing elements. The document also introduces the concept of ragged arrays and declares a three-dimensional array could be used to store student exam scores with multiple parts.
Parametric equations describe the location of a point (x,y) on a graph or path as functions of a single independent variable t, often representing time. They allow complicated motions to be modeled more easily than a single function. Examples are given of using parametric equations to describe motions like a roller coaster path or interacting rabbit and fox populations. Key concepts covered include graphing parametric equations, combining separate horizontal and vertical motions into a single parametric description, and describing linked motions like a carnival ride.
This document provides information about determinants of square matrices:
- It defines the determinant of a matrix as a scalar value associated with the matrix. Determinants are computed using minors and cofactors.
- Properties of determinants are described, such as how determinants change with row/column operations or identical rows/columns.
- Examples are provided to demonstrate computing determinants by expanding along rows or columns and using cofactors and minors.
- Applications of determinants include finding the area of triangles and solving systems of linear equations.
This document discusses Pandas DataFrames. DataFrames can be created from various data sources and support operations on rows and columns like selecting, adding, deleting, and renaming. Indexing using labels or positions allows accessing specific data elements. Functions like head, tail, max, min provide convenient summaries of DataFrames.
1. The document discusses various types of plots that can be created using matplotlib in Python, including line plots, bar graphs, histograms, pie charts, frequency polygons, box plots, and scatter plots.
2. It describes how to customize plots by changing colors, styles, widths, and adding labels, titles, and legends.
3. Examples are provided for creating different plot types like line charts, bar graphs, histograms, and customizing aspects of the plots.
This document provides an overview of essential data wrangling tasks in R, including importing, exploring, indexing/subsetting, reshaping, merging, aggregating, and repeating/looping data. It discusses functions for reading different file types like CSV, Excel, and plain text. It also covers exploring data structure and summary statistics, subsetting vectors, data frames and matrices, reshaping between wide and long format, performing different types of joins to merge data, and using loops and sequences to repeat operations.
Arrays are data structures that store a collection of data elements of the same type using a single variable name to represent the entire collection. Structures group together data of different types under one name. Sparse matrices represent matrices with many zero elements by only storing the non-zero elements, using triples of row, column, and value to represent each non-zero term. Transposing a sparse matrix involves taking each non-zero term <i,j,value> and storing it as <j,i,value> in the transpose.
This document discusses different methods for finding the equation of a line, including:
1) Given the slope and y-intercept
2) Using a graph
3) Given a point and the slope
4) Given two points
It provides examples of how to write the line equation using each method.
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-VRai University
This document describes numerical integration and differentiation techniques taught in a B.Tech Engineering Mathematics course. It covers the Trapezoidal, Simpson's 1/3 and 3/8 rules for numerical integration of functions. For numerical differentiation, it discusses Euler's method, Picard's method, and Taylor series for solving ordinary differential equations. Examples are provided to illustrate the application of these numerical methods to evaluate integrals and solve initial value problems.
This document discusses polynomial functions in MATLAB. It covers:
- Defining polynomials as coefficient vectors and finding roots.
- Adding, subtracting, multiplying and dividing polynomials using functions like conv and deconv.
- Evaluating and differentiating polynomials with polyval and polyder.
- Using polyfit for polynomial curve fitting to minimize squared errors between a polynomial and data set.
- An example of fitting increasing degree polynomials from 2 to 8 to cosine wave data, showing better fitting with higher degrees.
The document provides an overview of pandas series including:
- Creation of series from arrays, dictionaries, scalar values
- Mathematical operations on series like addition, subtraction
- Functions to access series data like head(), tail(), indexing, slicing
- Examples of arithmetic operations on series using operators and methods
This document provides an introduction to using R and RStudio. It discusses installing R and RStudio, the four windows in RStudio (source editor, console, environment/history, and plots/files), and basic commands and functions for running code, saving scripts, clearing the screen, commenting lines, and getting help. It also covers creating and manipulating variables and vectors, importing and exporting data, generating basic plots like bar plots, pie charts and histograms, and importing/exporting data.
- The document discusses determinants of square matrices, including how to calculate the determinant of matrices of various orders, properties of determinants, and some applications of determinants.
- Key concepts covered include minors, cofactors, expanding determinants in terms of minors and cofactors, properties such as how determinants change with row/column operations, and using determinants to solve systems of linear equations.
- Examples are provided to demonstrate calculating determinants and using properties to simplify or prove identities about determinants.
- The document discusses graphs of linear and quadratic equations.
- Linear equations produce straight line graphs, while quadratic equations produce curved graphs called parabolas.
- To graph a parabola, one finds the vertex using the vertex formula, then makes a table of x and y values centered around the vertex to plot the points symmetrically.
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdfYasirMuhammadlawan
This document provides an introduction to numeric, cell, and structure arrays in MATLAB. It discusses how to create vectors and matrices, perform basic operations on arrays like addition and multiplication, and use functions to manipulate array elements. Key topics covered include row and column vectors, concatenating arrays, addressing array elements, and the difference between array and matrix multiplication.
This document provides an overview of mathematical functions and plotting in MATLAB. It discusses:
- The many predefined mathematical functions available in MATLAB, such as sin, cos, and exp.
- How to generate vectors and matrices for input.
- How to perform basic plotting of data and functions using commands like plot and linspace.
- How to customize plots by adding titles, labels, and changing colors.
- Matrix operations in MATLAB like transposes, inverses, concatenation and arithmetic operations.
The name MATLAB stands for MATrix LABoratory.MATLAB is a high-performance language for technical computing.
It integrates computation, visualization, and programming environment. Furthermore, MATLAB is a modern programming language environment: it has sophisticated data structures, contains built-in editing and debugging tools, and supports object-oriented programming.
These factor make MATLAB an excellent tool for teaching and research.
This document provides information about writing equations of lines in point-slope form and discusses key concepts like:
- Point-slope form uses the slope (m) and a point (x1, y1) on the line to write the equation.
- It gives examples of writing equations of lines where the slope and point are given.
- It also covers writing equations of lines given two points by first calculating the slope and then using point-slope form.
- Finally, it discusses writing equations of lines parallel or perpendicular to given lines.
The document discusses multi-dimensional and two-dimensional lists. It explains that two-dimensional lists can represent tables of values arranged in rows and columns, with each element identified by two indices - the row and column. It provides examples of declaring and initializing two-dimensional lists, including nested list initializers. It also covers passing two-dimensional arrays as function parameters.
The document discusses multidimensional arrays and provides examples of declaring and using two-dimensional arrays in Java. It describes how to represent tables of data using two-dimensional arrays, initialize arrays, access elements, and perform common operations like summing elements. The document also introduces the concept of ragged arrays and declares a three-dimensional array could be used to store student exam scores with multiple parts.
Parametric equations describe the location of a point (x,y) on a graph or path as functions of a single independent variable t, often representing time. They allow complicated motions to be modeled more easily than a single function. Examples are given of using parametric equations to describe motions like a roller coaster path or interacting rabbit and fox populations. Key concepts covered include graphing parametric equations, combining separate horizontal and vertical motions into a single parametric description, and describing linked motions like a carnival ride.
This document provides information about determinants of square matrices:
- It defines the determinant of a matrix as a scalar value associated with the matrix. Determinants are computed using minors and cofactors.
- Properties of determinants are described, such as how determinants change with row/column operations or identical rows/columns.
- Examples are provided to demonstrate computing determinants by expanding along rows or columns and using cofactors and minors.
- Applications of determinants include finding the area of triangles and solving systems of linear equations.
This document discusses Pandas DataFrames. DataFrames can be created from various data sources and support operations on rows and columns like selecting, adding, deleting, and renaming. Indexing using labels or positions allows accessing specific data elements. Functions like head, tail, max, min provide convenient summaries of DataFrames.
1. The document discusses various types of plots that can be created using matplotlib in Python, including line plots, bar graphs, histograms, pie charts, frequency polygons, box plots, and scatter plots.
2. It describes how to customize plots by changing colors, styles, widths, and adding labels, titles, and legends.
3. Examples are provided for creating different plot types like line charts, bar graphs, histograms, and customizing aspects of the plots.
This document provides an overview of essential data wrangling tasks in R, including importing, exploring, indexing/subsetting, reshaping, merging, aggregating, and repeating/looping data. It discusses functions for reading different file types like CSV, Excel, and plain text. It also covers exploring data structure and summary statistics, subsetting vectors, data frames and matrices, reshaping between wide and long format, performing different types of joins to merge data, and using loops and sequences to repeat operations.
Arrays are data structures that store a collection of data elements of the same type using a single variable name to represent the entire collection. Structures group together data of different types under one name. Sparse matrices represent matrices with many zero elements by only storing the non-zero elements, using triples of row, column, and value to represent each non-zero term. Transposing a sparse matrix involves taking each non-zero term <i,j,value> and storing it as <j,i,value> in the transpose.
This document discusses different methods for finding the equation of a line, including:
1) Given the slope and y-intercept
2) Using a graph
3) Given a point and the slope
4) Given two points
It provides examples of how to write the line equation using each method.
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-VRai University
This document describes numerical integration and differentiation techniques taught in a B.Tech Engineering Mathematics course. It covers the Trapezoidal, Simpson's 1/3 and 3/8 rules for numerical integration of functions. For numerical differentiation, it discusses Euler's method, Picard's method, and Taylor series for solving ordinary differential equations. Examples are provided to illustrate the application of these numerical methods to evaluate integrals and solve initial value problems.
This document discusses polynomial functions in MATLAB. It covers:
- Defining polynomials as coefficient vectors and finding roots.
- Adding, subtracting, multiplying and dividing polynomials using functions like conv and deconv.
- Evaluating and differentiating polynomials with polyval and polyder.
- Using polyfit for polynomial curve fitting to minimize squared errors between a polynomial and data set.
- An example of fitting increasing degree polynomials from 2 to 8 to cosine wave data, showing better fitting with higher degrees.
The document provides an overview of pandas series including:
- Creation of series from arrays, dictionaries, scalar values
- Mathematical operations on series like addition, subtraction
- Functions to access series data like head(), tail(), indexing, slicing
- Examples of arithmetic operations on series using operators and methods
This document provides an introduction to using R and RStudio. It discusses installing R and RStudio, the four windows in RStudio (source editor, console, environment/history, and plots/files), and basic commands and functions for running code, saving scripts, clearing the screen, commenting lines, and getting help. It also covers creating and manipulating variables and vectors, importing and exporting data, generating basic plots like bar plots, pie charts and histograms, and importing/exporting data.
- The document discusses determinants of square matrices, including how to calculate the determinant of matrices of various orders, properties of determinants, and some applications of determinants.
- Key concepts covered include minors, cofactors, expanding determinants in terms of minors and cofactors, properties such as how determinants change with row/column operations, and using determinants to solve systems of linear equations.
- Examples are provided to demonstrate calculating determinants and using properties to simplify or prove identities about determinants.
- The document discusses graphs of linear and quadratic equations.
- Linear equations produce straight line graphs, while quadratic equations produce curved graphs called parabolas.
- To graph a parabola, one finds the vertex using the vertex formula, then makes a table of x and y values centered around the vertex to plot the points symmetrically.
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdfYasirMuhammadlawan
This document provides an introduction to numeric, cell, and structure arrays in MATLAB. It discusses how to create vectors and matrices, perform basic operations on arrays like addition and multiplication, and use functions to manipulate array elements. Key topics covered include row and column vectors, concatenating arrays, addressing array elements, and the difference between array and matrix multiplication.
This document provides an overview of mathematical functions and plotting in MATLAB. It discusses:
- The many predefined mathematical functions available in MATLAB, such as sin, cos, and exp.
- How to generate vectors and matrices for input.
- How to perform basic plotting of data and functions using commands like plot and linspace.
- How to customize plots by adding titles, labels, and changing colors.
- Matrix operations in MATLAB like transposes, inverses, concatenation and arithmetic operations.
The name MATLAB stands for MATrix LABoratory.MATLAB is a high-performance language for technical computing.
It integrates computation, visualization, and programming environment. Furthermore, MATLAB is a modern programming language environment: it has sophisticated data structures, contains built-in editing and debugging tools, and supports object-oriented programming.
These factor make MATLAB an excellent tool for teaching and research.
MATLAB is an interactive development environment and programming language used by engineers and scientists for technical computing, data analysis, and algorithm development. It allows users to access data from files, web services, applications, hardware, and databases, and perform data analysis and visualization. MATLAB can be used for applications in areas like control systems, signal processing, communications, and more.
This document provides information on generating and manipulating matrices in MATLAB. It discusses how to explicitly enter small matrices by separating elements with blanks/commas and rows with semicolons. Large matrices can be entered over multiple lines using the return button. Individual elements can be accessed and altered using indices in parentheses. Columns and rows can be appended to matrices using various commands. A colon is used to extract submatrices. Logical operators compare matrices and return 1s and 0s. Functions like diag(), fliplr(), flipud() and rot90() manipulate matrices. Random matrices can be generated using commands like rand() and ones(). Vectors subtracted from matrices using broadcasting. Example problems demonstrate generating matrices from vectors and manipulating the matrices.
The document discusses MATLAB vectors and matrices. It describes that MATLAB has row and column vectors. Row vectors are lists of numbers separated by commas or spaces within square brackets. Column vectors are similar but have elements separated by semicolons. Matrices are rectangular arrays of numbers with rows and columns. The document provides examples of defining, manipulating, and performing operations on vectors and matrices in MATLAB.
Vector arithmetic operations are performed element-wise. When adding or subtracting vectors, the result is a vector with the sum or difference of the corresponding elements. When vectors have unequal lengths, the shorter vector is recycled to match the length of the longer vector. Elements in a vector can be accessed using indices inside square brackets. A matrix is a two-dimensional collection of data arranged in rows and columns. Matrix operations like addition, subtraction, multiplication and division are performed element-wise on corresponding elements of the matrices. Elements of a matrix can be accessed and subsets can be extracted using row and column indices inside square brackets. Contour plots show 3D data on a 2D surface using contour lines, and can visualize topographic maps and
This document contains lecture materials for digital communication lab experiments in MATLAB. It includes four experiments on topics like signals in MATLAB, digital modulation, and transfer functions. The first experiment discusses variables, arrays, vectors and matrices. It provides examples of creating and manipulating these data structures. The second experiment demonstrates different MATLAB functions for plotting signals like stem, plot and stairs. The third experiment covers digital convolution using the conv and subplot functions. The fourth experiment describes how to model a system transfer function and find its response to different inputs using MATLAB commands like tf, step and impulse.
This document provides an overview of NumPy arrays, including how to create and manipulate vectors (1D arrays) and matrices (2D arrays). It discusses NumPy data types and shapes, and how to index, slice, and perform common operations on arrays like summation, multiplication, and dot products. It also compares the performance of vectorized NumPy operations versus equivalent Python for loops.
This document provides an outline and overview of topics that will be covered in an introduction to MATLAB and Simulink course over 4 sections. Section I will cover background, basic syntax and commands, linear algebra, and loops. Section II will cover graphing/plots, scripts and functions. Section III will cover solving linear and systems of equations and solving ODEs. Section IV will cover Simulink. The document provides examples of content that will be covered within each section, such as plotting functions, solving systems of equations using matrices, and numerically and symbolically solving ODEs.
This document provides an introduction to MATLAB. It begins with an overview of the MATLAB environment and display windows. It then discusses getting help in MATLAB, variables, vectors, matrices, linear algebra, plotting, built-in functions, selection programming using if/else statements, M-files, user-defined functions, and specific topics. Key points covered include the MATLAB interface, basic programming constructs like variables and arrays, and tools for computation, visualization, and programming in MATLAB.
This document discusses matrices and arrays in MATLAB. It defines matrices and vectors, and notes that MATLAB treats all variables as matrices. It explains how to enter matrices in MATLAB by listing elements separated by commas and semicolons. It also discusses built-in functions to generate matrices filled with zeros, ones, random values, or an identity matrix. The document covers operations on matrices like addition, subtraction, and multiplication. It explains how to extract sub-matrices and elements using indexing and introduces the colon operator.
This document introduces basic commands and concepts in Matlab, including how to define matrices and their elements, perform operations on matrices, and save workspaces. It provides examples of defining row vectors, column vectors, and multi-dimensional matrices. It also demonstrates using semicolons to define matrices that span multiple lines, line continuation with ellipses, and accessing individual matrix elements. Finally, it lists 10 practice problems for the reader to define matrices in Matlab and check their results.
Arrays in Matlab can be rectangular arrangements of numbers or other objects. A key array concept is that entries are stored sequentially in memory. Common array operations include creating arrays using functions like ones(), zeros(), rand(), accessing/assigning elements using indexes, and reshaping arrays without changing the underlying data. Plotting functions like plot() allow visualizing relationships between data vectors.
Here are the steps to solve this problem numerically in MATLAB:
1. Define the 2nd order ODE for the pendulum as two first order equations:
y1' = y2
y2' = -sin(y1)
2. Create an M-file function pendulum.m that returns the right hand side:
function dy = pendulum(t,y)
dy = [y(2); -sin(y(1))];
end
3. Use an ODE solver like ode45 to integrate from t=0 to t=6pi with initial conditions y1(0)=pi, y2(0)=0:
[t,y] = ode45
This document discusses creating and manipulating arrays in Scilab. It covers how to create one-dimensional arrays (vectors), two-dimensional arrays (matrices), and perform basic mathematical operations on arrays like addition, multiplication, transpose, and determinant. It also discusses how to find the roots of a polynomial by specifying the coefficients as a vector and using the roots() function. The exercises provided are examples of how to implement these array concepts in Scilab code.
This document provides an introduction and overview of MATLAB. It defines MATLAB as an interactive system for technical computing with matrices as the basic data type. It describes how MATLAB is used in mathematics, industry, and research for numeric computation and visualization. The document outlines MATLAB's toolboxes for specialized applications and provides examples of using matrices, vectors, operators, and functions in MATLAB. It demonstrates how to perform operations like matrix addition and inversion, solve systems of linear equations, and analyze arrays with built-in functions.
Arrays allow storing multiple values of the same type under one common name. They come in one-dimensional and two-dimensional forms. One-dimensional arrays store elements indexed with a single subscript, while two-dimensional arrays represent matrices with rows and columns indexed by two subscripts. Arrays can be passed to functions by passing their name and size for numeric arrays, or just the name for character/string arrays since strings are null-terminated. Functions can operate on arrays to perform tasks like finding the highest/lowest element or reversing a string.
Here are the steps to solve this problem in MATLAB:
1. Create a matrix A with the marks data:
A = [24 44 36 36;
52 57 68 76;
66 53 69 73;
85 40 86 72;
15 47 25 28;
79 72 82 91];
2. Define the column labels:
subjects = {'Math','Programming','Thermodynamics','Mechanics'};
3. Find the total marks of each subject:
totals = sum(A)
4. Find the average marks of each subject:
averages = mean(A)
5. Find the highest marks scored in each subject:
maxMarks = max
Introductory session for basic matlab commands and a brief overview of K-mean clustering algorithm with image processing example.
NOTE: you can find code of k-mean clustering algorithm for image processing in notes.
Cyclone 1970 : The Deadliest Disaster in the WorldNazim Naeem
The 1970 Bhola cyclone that struck Bangladesh was the deadliest tropical cyclone on record, killing an estimated 300,000 to 500,000 people. The storm formed in the Bay of Bengal in early November and made landfall in Bangladesh on November 12th with winds of 185 km/h. The extremely high death toll was primarily due to a devastating storm surge that flooded much of the low-lying Ganges Delta region. The cyclone exacerbated political tensions in Bangladesh and helped trigger the country's war of independence from Pakistan.
This document provides information about earthquakes, including their causes, effects, measurement, and history. It discusses how earthquakes are caused by the sudden release of energy in the earth's crust along faults and fractures. It describes the different types of seismic waves generated and how the Richter scale is used to measure the strength of earthquakes. Examples are given of some of the worst earthquakes in history that caused massive loss of life. Safety procedures and precautions to take both during and after an earthquake are also outlined.
The document summarizes the seismic activity and earthquake risk in the Indian subcontinent region, with a focus on Bangladesh. It notes that the region experiences frequent earthquakes due to its location across several tectonic plates. Bangladesh specifically is divided into three earthquake zones based on expected magnitude. Several major fault lines have been identified near Bangladesh that have caused damaging earthquakes in the past. Dhaka is at high risk from earthquakes and a magnitude 7-8 quake could cause widespread building collapses and tens of thousands of deaths. Improving earthquake preparedness and building codes is needed to mitigate risks.
River bank erosion, its migration, causesNazim Naeem
Riverbank Erosion is an endemic natural hazard in our country.
When rivers enter the mature, they become sluggish and
meander or braid. These oscillations cause extreme riverbank
erosion. It is a perennial problem in our country.
• It has been estimated that tens of thousands of people are
displaced annually by river erosion in Bangladesh, possibly up to
100,000. Many households are forced to move away from their
homesteads due to riverbank erosion and flood.
• As per different sources, 500 kilometres of riverbank face
severe problems related to erosion. The northwest part of the
country is particularly prone to riverbank erosion, which has
turned the region into an economically depressed area.
An insight to petroleum generation of bangladeshNazim Naeem
The document summarizes the stratigraphy, depositional setting, source rocks, and reservoir rocks relevant to petroleum geology in Bangladesh. It describes the major geological periods and formations in the Bengal Basin, including the stable platform, geosyncline, and fold belt regions. Key source rocks identified include coals in the Gondwana formation and shales like the Kopili and Jenam formations. Important reservoir rocks are sandstones in the Bhuban and Boka Bil formations. The document evaluates Bangladesh's petroleum system and indicates the eastern region may have better potential for conventional hydrocarbon accumulations.
How to apply for spe student membership freeNazim Naeem
To apply for free SPE student membership, one must:
1) Enter www.spe.org and hover over the Membership option to click Join SPE twice for the student option.
2) Select Bangladesh as the country and choose the free membership option with Chevron sponsorship.
3) Fill out the application form with valid email, university address, reason for joining as local section membership, and create a password.
4) Provide educational details and select any additional resources to receive before completing the application.
Crystallography is the branch of science that studies crystals, their growth and structure. It deals with crystals' external form, internal arrangement of atoms, and physical properties. Crystals have a regularly repeating internal structure. Miller indices are a notation system used to describe crystal planes and directions within a crystal lattice by three integers h, k, l. The law of rational indices states that the intercepts made by a crystal plane with the unit cell axes are inversely proportional to integers that become the Miller indices. Determining Miller indices involves finding intercepts with axes, converting to fractional coordinates, and taking reciprocals.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise boosts blood flow, releases endorphins, and promotes changes in the brain which help regulate emotions and stress levels.
The document discusses various number systems including decimal, binary, octal and hexadecimal systems. It provides details on the concepts of natural numbers, integers, rational numbers and negative numbers. It explains how decimal, binary, octal and hexadecimal numbers are represented and how to convert between these different number bases. Techniques for addition, subtraction and arithmetic operations in binary numbers are also summarized.
This document provides an overview of MATLAB for geoscientists. It describes MATLAB as a high-level language and interactive environment for numerical computation, visualization, and programming. Key features of MATLAB include its high-level language for numerical analysis, interactive environment, built-in mathematical functions, graphics for data visualization, and tools for algorithm and application development. The document discusses matrices, variables, basic arithmetic and programming in MATLAB, and provides examples of using MATLAB for tasks like plotting functions, solving equations, and working with arrays.
The document discusses digital logic gates and their usage in computers. It describes that logic gates combine electrical pulses following logical rules and are the basic components used to move data and instructions through a computer. The three basic logic gates are AND, OR, and NOT. These gates can be combined to perform more complex logic functions and operations like addition. Adders are constructed using networks of half adders and full adders to add binary numbers.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...NelTorrente
In this research, it concludes that while the readiness of teachers in Caloocan City to implement the MATATAG Curriculum is generally positive, targeted efforts in professional development, resource distribution, support networks, and comprehensive preparation can address the existing gaps and ensure successful curriculum implementation.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
2. Specification of a position vector using Cartesian
coordinates.
Figure 2.1–1
2-22-2
The vector p can be
specified by three
components: x, y, and
z, and can be written
as:
p = [x, y, z].
However, MATLAB can
use vectors having
more than three
elements.
3. To create a row vector, separate the elements by
semicolons. For example,
>>p = [3,7,9]
p =
3 7 9
You can create a column vector by using the
transpose notation (').
>>p = [3,7,9]'
p =
3
7
9
2-3
4. You can also create a column vector by separating the
elements by semicolons. For example,
>>g = [3;7;9]
g =
3
7
9
2-42-4
5. 2-52-5
You can create vectors by ''appending'' one vector to
another.
For example, to create the row vector u whose first three
columns contain the values of r = [2,4,20] and
whose fourth, fifth, and sixth columns contain the values
of w = [9,-6,3], you type u = [r,w]. The result is
the vector u = [2,4,20,9,-6,3].
6. The colon operator (:) easily generates a large vector of
regularly spaced elements.
Typing
>>x = [m:q:n]
creates a vector x of values with a spacing q. The first
value is m. The last value is n if m - n is an integer
multiple of q. If not, the last value is less than n.
2-62-6
7. For example, typing x = [0:2:8] creates the
vector x = [0,2,4,6,8], whereas typing x =
[0:2:7] creates the vector x = [0,2,4,6].
To create a row vector z consisting of the values
from 5 to 8 in steps of 0.1, type z = [5:0.1:8].
If the increment q is omitted, it is presumed to be
1. Thus typing y = [-3:2] produces the vector
y = [-3,-2,-1,0,1,2].
2-7
8. The logspace command creates an array of
logarithmically spaced elements.
Its syntax is logspace(a,b,n), where n is
the number of points between 10a
and 10b
.
For example, x = logspace(-1,1,4)
produces the vector x = [0.1000,
0.4642, 2.1544, 10.000].
If n is omitted, the number of points defaults to
50.
2-9 More? See pages 71-73.
9. Matrices
A matrix has multiple rows and columns. For
example, the matrix
has four rows and three columns.
Vectors are special cases of matrices having
one row or one column.
M =
2 4 10
16 3 7
8 4 9
3 12 15
2-12 More? See page 73.
10. Creating Matrices
If the matrix is small you can type it row by row, separating
the elements in a given row with spaces or commas and
separating the rows with semicolons. For example, typing
>>A = [2,4,10;16,3,7];
creates the following matrix:
2 4 10
16 3 7
Remember, spaces or commas separate elements in
different columns, whereas semicolons separate elements
in different rows.
A =
2-132-13
11. Creating Matrices from Vectors
Suppose a = [1,3,5] and b = [7,9,11] (row
vectors). Note the difference between the results given
by [a b] and [a;b] in the following session:
>>c = [a b];
c =
1 3 5 7 9 11
>>D = [a;b]
D =
1 3 5
7 9 11
2-142-14
12. You need not use symbols to create a new array.
For example, you can type
>> D = [[1,3,5];[7,9,11]];
2-15
13. Array Addressing
The colon operator selects individual elements, rows,
columns, or ''subarrays'' of arrays. Here are some
examples:
v(:) represents all the row or column elements of
the vector v.
v(2:5) represents the second through fifth
elements; that is v(2), v(3), v(4), v(5).
A(:,3) denotes all the elements in the third column
of the matrix A.
A(:,2:5) denotes all the elements in the second
through fifth columns of A.
A(2:3,1:3) denotes all the elements in the second
and third rows that are also in the first through
third columns.
2-16
14. You can use array indices to extract a smaller array from
another array. For example, if you first create the array B
B =
2-172-17
C =
16 3 7
8 4 9
2 4 10 13
16 3 7 18
8 4 9 25
3 12 15 17
then type C = B(2:3,1:3), you can produce the
following array:
15. Element-by-element operations: Table 2.3–1
Symbol
+
-
+
-
.*
./
.
.^
Examples
[6,3]+2=[8,5]
[8,3]-5=[3,-2]
[6,5]+[4,8]=[10,13]
[6,5]-[4,8]=[2,-3]
[3,5].*[4,8]=[12,40]
[2,5]./[4,8]=[2/4,5/8]
[2,5].[4,8]=[24,58]
[3,5].^2=[3^2,5^2]
2.^[3,5]=[2^3,2^5]
[3,5].^[2,4]=[3^2,5^4]
Operation
Scalar-array addition
Scalar-array subtraction
Array addition
Array subtraction
Array multiplication
Array right division
Array left division
Array exponentiation
Form
A + b
A – b
A + B
A – B
A.*B
A./B
A.B
A.^B
2-322-32
16. Array or Element-by-element multiplication is defined only
for arrays having the same size. The definition of the
product x.*y, where x and y each have n elements, is
x.*y = [x(1)y(1), x(2)y(2), ... , x(n)y(n)]
if x and y are row vectors. For example, if
x = [2, 4, – 5], y = [– 7, 3, – 8] (2.3–
4)
then z = x.*y gives
z = [2(– 7), 4 (3), –5(–8)] = [–14, 12, 40]
2-332-33
17. If x and y are column vectors, the result of x.*y is a
column vector. For example z = (x’).*(y’) gives
Note that x’ is a column vector with size 3 × 1 and thus
does not have the same size as y, whose size is 1 × 3.
Thus for the vectors x and y the operations x’.*y and
y.*x’ are not defined in MATLAB and will generate an
error message.
2(–7)
4(3)
–5(–8)
–14
12
40
=z =
2-342-34
18. The array operations are performed between the
elements in corresponding locations in the arrays. For
example, the array multiplication operation A.*B results
in a matrix C that has the same size as A and B and has
the elements ci j = ai j bi j . For example, if
then C = A.*B gives this result:
A = 11 5
–9 4
B = –7 8
6 2
C = 11(–7) 5(8)
–9(6) 4(2)
= –77 40
–54 8
2-352-35 More? See pages 87-88.
19. The built-in MATLAB functions such as sqrt(x) and
exp(x) automatically operate on array arguments to
produce an array result the same size as the array
argument x.
Thus these functions are said to be vectorized functions.
For example, in the following session the result y has
the same size as the argument x.
>>x = [4, 16, 25];
>>y = sqrt(x)
y =
2 4 5
2-362-36
20. However, when multiplying or dividing these
functions, or when raising them to a power,
you must use element-by-element operations if
the arguments are arrays.
For example, to compute z = (ey
sin x) cos2
x,
you must type
z = exp(y).*sin(x).*(cos(x)).^2.
You will get an error message if the size of x is
not the same as the size of y. The result z will
have the same size as x and y.
2-37 More? See pages 89-90.
21. Array Division
The definition of array division is similar to the definition
of array multiplication except that the elements of one
array are divided by the elements of the other array.
Both arrays must have the same size. The symbol for
array right division is ./. For example, if
x = [8, 12, 15] y = [–2, 6, 5]
then z = x./y gives
z = [8/(–2), 12/6, 15/5] = [–4, 2, 3]
2-382-38
22. A = 24 20
– 9 4
B = –4 5
3 2
Also, if
then C = A./B gives
C = 24/(–4) 20/5
–9/3 4/2
= –6 4
–3 2
2-39 More? See pages 91-92.
23. Array Exponentiation
MATLAB enables us not only to raise arrays to powers
but also to raise scalars and arrays to array powers.
To perform exponentiation on an element-by-element
basis, we must use the .^ symbol.
For example, if x = [3, 5, 8], then typing x.^3
produces the array [33
, 53
, 83
] = [27, 125, 512].
2-402-40
24. We can raise a scalar to an array power. For example, if
p = [2, 4, 5], then typing 3.^p produces the array
[32
, 34
, 35
] = [9, 81, 243].
Remember that .^ is a single symbol. The dot in 3.^p
is not a decimal point associated with the number 3. The
following operations, with the value of p given here, are
equivalent and give the correct answer:
3.^p
3.0.^p
3..^p
(3).^p
3.^[2,4,5]
2-412-41 More? See pages 92-95.
25. Matrix-Matrix Multiplication
In the product of two matrices AB, the number of
columns in A must equal the number of rows in B. The
row-column multiplications form column vectors, and
these column vectors form the matrix result. The
product AB has the same number of rows as A and the
same number of columns as B. For example,
6 –2
10 3
4 7
9 8
–5 12
=
(6)(9) + (– 2)(– 5) (6)(8) + (– 2)(12)
(10)(9) + (3)(– 5) (10)(8) + (3)(12)
(4)(9) + (7)(– 5) (4)(8) + (7)(12)
64 24
75 116
1 116
= (2.4–4)
2-422-42
26. Use the operator * to perform matrix multiplication in
MATLAB. The following MATLAB session shows how to
perform the matrix multiplication shown in (2.4–4).
>>A = [6,-2;10,3;4,7];
>>B = [9,8;-5,12];
>>A*B
ans =
64 24
75 116
1 116
2-432-43
27. Matrix multiplication does not have the commutative
property; that is, in general, AB ≠ BA. A simple
example will demonstrate this fact:
AB = 6 –2
10 3
9 8
–12 14
= 78 20
54 122
(2.4–6)
BA = 9 8
–12 14
6 –2
10 3
= 134 6
68 65 (2.4–7)
whereas
Reversing the order of matrix multiplication is a
common and easily made mistake.
2-442-44 More? See pages 97-104.
28. Special Matrices
Two exceptions to the noncommutative property are
the null or zero matrix, denoted by 0 and the identity, or
unity, matrix, denoted by I.
The null matrix contains all zeros and is not the same
as the empty matrix [ ], which has no elements.
These matrices have the following properties:
0A = A0 = 0
IA = AI = A
2-452-45
29. The identity matrix is a square matrix whose diagonal
elements are all equal to one, with the remaining
elements equal to zero.
For example, the 2 × 2 identity matrix is
I = 1 0
0 1
The functions eye(n) and eye(size(A)) create an
n × n identity matrix and an identity matrix the same
size as the matrix A.
2-46 More? See page 105.
30. Sometimes we want to initialize a matrix to have all zero
elements. The zeros command creates a matrix of all
zeros.
Typing zeros(n) creates an n × n matrix of zeros,
whereas typing zeros(m,n) creates an m × n matrix of
zeros.
Typing zeros(size(A)) creates a matrix of all zeros
having the same dimension as the matrix A. This type
of matrix can be useful for applications in which we do
not know the required dimension ahead of time.
The syntax of the ones command is the same, except
that it creates arrays filled with ones.
2-472-47 More? See pages 105-106.
31. Polynomial Multiplication and Division
The function conv(a,b) computes the product of the two
polynomials described by the coefficient arrays a and b.
The two polynomials need not be the same degree. The
result is the coefficient array of the product polynomial.
The function [q,r] = deconv(num,den) computes the
result of dividing a numerator polynomial, whose
coefficient array is num, by a denominator polynomial
represented by the coefficient array den. The quotient
polynomial is given by the coefficient array q, and the
remainder polynomial is given by the coefficient array r.
2-48
33. Polynomial RootsPolynomial Roots
The functionThe function roots(a)computes the roots of a polynomial
specified by the coefficient array a. The result is a
column vector that contains the polynomial’s roots.
For example,
>>r = roots([2, 14, 20])
r =
-2
-7
2-50 More? See page 107.
34. Polynomial CoefficientsPolynomial Coefficients
The functionThe function poly(r)computes the coefficients of the
polynomial whose roots are specified by the vector r.
The result is a row vector that contains the polynomial’s
coefficients arranged in descending order of power.
For example,
>>c = poly([-2, -7])
c =
1 7 10
2-51 More? See page 107.
35. Plotting Polynomials
The function polyval(a,x)evaluates a polynomial at
specified values of its independent variable x, which can
be a matrix or a vector. The polynomial’s coefficients of
descending powers are stored in the array a. The result
is the same size as x.
2-52
36. Example of Plotting a Polynomial
To plot the polynomial f (x) = 9x3
– 5x2
+ 3x + 7 for –
2 ≤ x ≤ 5, you type
>>a = [9,-5,3,7];
>>x = [-2:0.01:5];
>>f = polyval(a,x);
>>plot(x,f),xlabel(’x’),ylabel(’f(x)’)
2-532-53
37. Function
C = cell(n)
C = cell(n,m)
celldisp(C)
cellplot(C)
C =
num2cell(A)
[X,Y, ...] =
deal(A,B, ...)
[X,Y, ...] =
deal(A)
iscell(C)
Description
Creates an n × n cell array C of empty matrices.
Creates an n × m cell array C of empty matrices.
Displays the contents of cell array C.
Displays a graphical representation of the cell array C.
Converts a numeric array A into a cell array C.
Matches up the input and output lists. Equivalent to
X = A, Y = B, . . . .
Matches up the input and output lists. Equivalent to
X = A, Y = A, . . . .
Returns a 1 if C is a cell array; otherwise, returns a 0.
Cell array functions. Table 2.6–1
2-542-54