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

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

AVectorrow1&comma;2&comma;3&comma;4&comma;5

A12345

(1)

BVectorrow6&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

PVectorcolumn0.803716108032327&comma;0.356056399933928&comma;0.933528218742667&comma;0.0114341122580131&comma;0.554152583724131&comma;datatype=float8

P0.803716108032327−0.3560563999339280.9335282187426670.01143411225801310.554152583724131

(6)

QVectorrow0.0882886912893828&comma;0.561179894580472&comma;0.588474727401137&comma;0.926146043843513&comma;0.821206761885317&comma;datatype=float8

Q−0.08828869128938280.5611798945804720.5884747274011370.9261460438435130.821206761885317

(7)

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

P=P

P=0.803716108032327−0.08828869128938280.5611798945804720.5884747274011370.9261460438435130.821206761885317−0.3560563999339280.9335282187426670.01143411225801310.554152583724131

(8)

Example 3

G1&comma;23I&comma;5+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&colon;

XGenerateSignalsin4t+5&comma;t=0..2π&comma;n&comma;includefinishtime=false&colon;

YGenerateSignal110sin40t+5&comma;t=0..2π&comma;n&comma;includefinishtime=false&colon;

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

SignalPlotZ&comma;view=DEFAULT&comma;0..10&comma;color=blue

Example 5

m105

m100000

(12)

nfloor23m

n66666

(13)

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

A−0.0917383737863284+2.13912325874864I−3.39854682246889+3.49786418049004I−2.595648231851601.78383585689513I3.24486104632469+0.895908298152884I−0.362935391020486+2.31720737051418I−2.09070685601688+0.815907533479054I−0.693638170304207+0.315918805455907I4.57091864654335+2.61722374093498I−3.68294960599541+3.20691408998534I−1.227884363113402.39044573657899I100000 element Vector[column]

(14)

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

B−4.142677422324423.51051319815677I−0.476582854156399+3.13480576149592I3.93630307721684+3.71363640103653I1.789448209326991.58190977422684I0.801823487528903+2.04706019479377I1.818497872050732.31204470134407I−3.08889695735301+3.45093746504436I1.968746589444173.49513013073011I0.920907021678026+2.13975559787115I−3.101313451039754.42719506129223I66666 element Vector[column]

(15)

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

−0.0917383737863284+2.13912325874864I−3.39854682246889+3.49786418049004I−2.595648231851601.78383585689513I3.24486104632469+0.895908298152884I−0.362935391020486+2.31720737051418I−2.09070685601688+0.815907533479054I−0.693638170304207+0.315918805455907I4.57091864654335+2.61722374093498I−3.68294960599541+3.20691408998534I−1.227884363113402.39044573657899I166666 element Vector[column]

(16)

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