About 56,700 results
Open links in new tab
  1. repmat - MathWorks

    B = repmat(A,n) returns an array containing n copies of A in the row and column dimensions. The size of B is size(A)*n when A is a matrix. B = repmat(A,r1,...,rN) specifies a list of scalars, r1,..,rN, that describes how copies of A are arranged in each dimension. When A has N dimensions, the size of B is size(A).*[r1...rN].

  2. repelem - MathWorks

    B = repelem(A,r1,...,rN) returns an array with each element of A repeated according to r1,...,rN. Each r1,...,rN must either be a scalar or a vector with the same length as A in the corresponding dimension.

  3. How to create an array with repeating values of a vector

    Apr 7, 2020 · Learn more about matrix array MATLAB how can I create a matrix based on the vector v = [12.56, 65.23, 5.67], which is repeated 20 times? So that the matrix M look like: M = [12.56 65.23 5.67 ; 12.56 65.23 5.67 ; 12.56 65.23...

  4. How to repeat a character multiple times as a MATLAB array?

    Mar 7, 2014 · Given a single string value in a MATLAB character array: ['12 N'] How can I repeat this value X times in a new character array? For example: X = 5 ['12 N'; '12 N'; '12 N'; '12 N'; '12 N']

  5. Repmat Matlab | What is Repmat and How Is It Used?

    Feb 27, 2024 · You can use the repmat command to repeat the elements of an array in the output. Repetition is based on the parameters you specify in the bracket after repmat—multiple ways to write the repmat function, depending on your parameter list.

  6. Repeat copies of array elements: Run-length decoding in MATLAB

    I'm trying to insert multiple values into an array using a 'values' array and a 'counter' array. For example, if: a=[1,3,2,5] b=[2,2,1,3] I want the output of some function. c=somefunction(a,b) to be. c=[1,1,3,3,2,5,5,5] Where a(1) recurs b(1) number of times, a(2) recurs b(2) times, etc... Is there a built-in function in MATLAB that does this?

  7. matlab - Create an array with repeating numbers - Stack Overflow

    Sep 16, 2017 · From the documentation for repelem: repelem Replicate elements of an array. U = repelem (V,N), where V is a vector, returns a vector of repeated elements of V. So what you want is: Find the answer to your question by asking. See similar questions with these tags.

  8. Finding the indices of duplicate values in one array

    Apr 21, 2017 · In MATLAB, you can find the indices of duplicate values in an array using the `find` function along with the `unique` function. Here's how you can do it: A = [1 1 2 3 5 6 7];

  9. repmat - MathWorks

    B = repmat(A,n) returns an array containing n copies of A in the row and column dimensions. The size of B is size(A)*n when A is a matrix. B = repmat(A,r1,...,rN) specifies a list of scalars, r1,..,rN, that describes how copies of A are arranged in each dimension. When A has N dimensions, the size of B is size(A).*[r1...rN].

  10. Programming with MATLAB: Repeating With Loops

    Oct 18, 2023 · There’s a better approach: This improved version uses a for loop to repeat an operation—in this case, printing to the screen—once for each element in an array. The general form of a for loop is: {: .source} The for loop executes the commands in the loop body for every value in the array collection.

  11. Some results have been removed
Refresh