Insert - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


SignalProcessing

  

Insert

  

insert 1-D rtable into another 1-D rtable

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Insert( A, k, B, options )

Parameters

A, B

-

1-D rtables or lists with entries of type complexcons

k

-

integer; specifies the index of A where B is to be inserted

inplace

-

(optional) Either true or false, specifies if the insertion of B into A at k is to be performed in-place.

Description

• 

The Insert command inserts 1-D rtable or list B into 1-D rtable or list A at index k, and returns the combined container.

• 

When A is an rtable, the rtable order and subtype of the output are the same as for A. When A is a list, on the other hand, the output is an Array having Fortran order.

• 

Any passed rtables must have no indexing function, and use rectangular storage.

• 

Suppose m=numelemsA, n=numelemsB, and A has dimensions α..β. The result of InsertA&comma;k&comma;B contains m+n elements, with B inserted to the left of element Ak. When A is an Array with initial index different than 1, the insertion index k must satisfy αk and kβ+1. When A is a Vector or an Array with initial index 1, on the other hand, the insertion index must satisfy k0 and km+1, with k<0 corresponding to element m+1k.

• 

The extreme case k=α corresponds to inserting B before A, and k=β+1 corresponds to inserting B after A.

• 

Internally, A and B will both be converted to float[8] Vectors, if possible. If this is not possible, they will both be converted to complex[8] Vectors, if possible. For this reason, it is more efficient for the passed containers A and B to both be 1-D rtables of the same double precision hardware float datatype (float[8] or complex[8]).

• 

Suppose inplace=true. The container A must have either float[8] or complex[8] datatype, and the container B must be coercible to the same datatype. Moreover, if B is an alias of A, or A and B are both aliases of the same rtable, then a copy of B is created in order to avoid complications during insertion.

• 

The Insert command is not thread safe.

Examples

withSignalProcessing&colon;

Example 1

AVector&apos;row&apos;1&comma;2&comma;3&comma;4&comma;5

A12345

(1)

BVector&apos;row&apos;6&comma;7

B67

(2)

UInsertA&comma;1&comma;B

U6.7.1.2.3.4.5.

(3)

VInsertA&comma;4&comma;B

V1.2.3.6.7.4.5.

(4)

WInsertA&comma;6&comma;B

W1.2.3.4.5.6.7.

(5)

Example 2

PVector&apos;column&apos;0.803716108032327&comma;0.356056399933928&comma;0.933528218742667&comma;0.0114341122580131&comma;0.554152583724131&comma;&apos;datatype&apos;&equals;&apos;float8&apos;

P0.803716108032327−0.3560563999339280.9335282187426670.01143411225801310.554152583724131

(6)

QVector&apos;row&apos;0.0882886912893828&comma;0.561179894580472&comma;0.588474727401137&comma;0.926146043843513&comma;0.821206761885317&comma;&apos;datatype&apos;&equals;&apos;float8&apos;

Q−0.08828869128938280.5611798945804720.5884747274011370.9261460438435130.821206761885317

(7)

InsertP&comma;2&comma;Q&comma;&apos;inplace&apos;&colon;

&apos;P&apos;&equals;P

P=0.803716108032327−0.08828869128938280.5611798945804720.5884747274011370.9261460438435130.821206761885317−0.3560563999339280.9335282187426670.01143411225801310.554152583724131

(8)

Example 3

G1&comma;23I&comma;5&plus;6I

G1&comma;23I&comma;5+6I

(9)

H4

H4

(10)

InsertG&comma;3&comma;H

1.+0.I2.3.I4.+0.I5.+6.I

(11)

Example 4

n210

n1024

(12)

XGenerateSignalsin4t&plus;5&comma;t&equals;0..2Pi&comma;n&comma;&apos;includefinishtime&apos;&equals;&apos;false&apos;&colon;

YGenerateSignal1sin40t10&plus;5&comma;t&equals;0..2Pi&comma;n&comma;&apos;includefinishtime&apos;&equals;&apos;false&apos;&colon;

ZInsertX&comma;floorn2&plus;1&comma;Y&colon;

SignalPlotZ&comma;&apos;view&apos;&equals;&apos;DEFAULT&apos;&comma;0..10&comma;&apos;color&apos;&equals;&apos;blue&apos;

Example 5

m105

m100000

(13)

nfloor2m3

n66666

(14)

ALinearAlgebra:-RandomVectorm&comma;&apos;generator&apos;&equals;5.0..5.0&comma;&apos;datatype&apos;&equals;&apos;complex8&apos;

BLinearAlgebra:-RandomVectorn&comma;&apos;generator&apos;&equals;5.0..5.0&comma;&apos;datatype&apos;&equals;&apos;complex8&apos;

CodeTools:-UsageInsertA&comma;floorn2&comma;B

memory used=2.57MiB, alloc change=2.55MiB, cpu time=2.00ms, real time=2.00ms, gc time=0ns

Compatibility

• 

The SignalProcessing[Insert] command was introduced in Maple 2022.

• 

For more information on Maple 2022 changes, see Updates in Maple 2022.

See Also

ArrayTools[Copy]

ArrayTools[Extend]

ArrayTools[Insert]

SignalProcessing