Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. Create a 3-by-3 matrix. Resize the columns to a length of 2 by removing one element from each column. Resize the rows to a length of 9 by reflecting the data in each row until the row contains nine elements. Pattern applies only to the dimension for which resize adds elements.

  2. Find Array Elements That Meet Conditions. This example shows how to filter the elements of an array by applying conditions to the array. For instance, you can examine the even elements in a matrix, find the location of all 0s in a multidimensional array, or replace NaN values in data.

  3. You can also use square brackets to append existing matrices. This way of creating a matrix is called concatenation. For example, concatenate two row vectors to make an even longer row vector.

  4. A common task in linear algebra is to work with the transpose of a matrix, which turns the rows into columns and the columns into rows. To do this, use the transpose function or the .' operator. Create a 3-by-3 matrix and compute its transpose.

  5. 23 mar 2013 · function [ x ]=create_matrix(b,l) n = length(b); m = n-l+1; x = zeros(m,l); for i=1:m x(i,:)=b(i:i+l-1); end; end Example:

  6. MATLAB provides efficient functions to create some commonly used matrices. Create a 3 by 5 matrix with all elements equal to zero. The command zeros(m,n) creates an m by n array (matrix) of zeros.

  7. sz = size(A) returns a row vector whose elements are the lengths of the corresponding dimensions of A. For example, if A is a 3-by-4 matrix, then size(A) returns the vector [3 4].