INSERTROWS Matlab script

SPONSORED LINKS

    Specification

  • Version:
  • File size: 0 KB
  • File name: insertrows.m
  • Last update:
  • Platform: Windows / Linux / Mac OS / BSD / Solaris
  • Language: Matlab
  • Price:Freeware
  • Company: Josh (View more)

INSERTROWS script description:




Publisher review:
INSERTROWS - Insert rows into a matrix at specific locations C = INSERTROWS(A,B,IND) inserts the rows of matrix B into the matrix A at the positions IND. Row k of matrix B will be inserted after position IND(k)in the matrix A. If A is a N-by-X matrix and B is a M-by-X matrix, C will be a (N M)-by-X matrix. IND can contain non-integers.If B is a 1-by-N matrix, B will be inserted for each insertion position specified by IND. If IND is a single value, the whole matrix B will be inserted at that position. If B is a single value, B is expanded to a row vector. In all other cases, the number of elements in IND should be equal to the number of rows in B, and the number of columns, planes etc should be the same for both matrices A and B. If any of the inputs are empty, C will return A.Examples:% the size of A,B, and IND all matchC = insertrows(rand(5,2),zeros(2,2),[1.5 3]) % the row vector B is inserted twiceC = insertrows(ones(4,3),1:3,[1 Inf]) % matrix B is expanded to a row vector and inserted twice (as in 2)C = insertrows(ones(5,3),999,[2 4])% the whole matrix B is inserted onceC = insertrows(ones(5,3),zeros(2,3),2)[C, RA, RB] = INSERTROWS(...) will return the row indices RA and RB for which Ccorresponds to the rows of either A and B.[c,ra,rb] = insertrows([1:4].',99,[0 3]) ;c.' % -> [99 1 2 3 99 4] ;c(ra).' % -> [1 2 3 4] ;c(rb).' % -> [99 99] ;To insert columns, planes, etc., you can permute the inputs and ipermute the result.A = ones(4,3) ; B = zeros(4,1) ; C = insertrows(permute(A,[2 1]), permute(B,[2 1]),1) ;C = ipermute(C,[2 1]) ;See also PERMUTE, IPERMUTE, RESHAPE, CAT Requirements: ยท MATLAB Release: R13
INSERTROWS is a Matlab script for Mathematics scripts design by Josh. It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.

Operating system:
Windows / Linux / Mac OS / BSD / Solaris

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5