Creating stack of arbitrary size?

Creating stack of arbitrary size? - i.e. stack(1,2,3,4,...,n) - 消息

#1 已发布: 2022/8/3 19:16:39
Daniel Jackson

Daniel Jackson

1个赞,共17个帖子。

组: User

Anyone know what functions I should combine to produce the custom function I need? I need it to output the following: f(g(x),x,1,n)=stack(g(1),g(2),g(3),g(4),...,g(n-1),g(n)) for any given n value, but I can't seem to find the proper combination of functions and operators to do it.
#2 已发布: 2022/8/4 03:10:16
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

The first idea is to use a loop.

One also could use a loop to design the string representation of a multi-argument stack command and then convert it to an expression with str2num().
Yet I guess this would not make the thing more comprehensible.

Blatt6.sm (3.72 KiB)已下载 1292 次。
Blatt6.png

Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#3 已发布: 2022/8/4 03:24:10
Martin_B

Martin_B

22个赞,共84个帖子。

组: User

There are a some possibilities to do so:
(g(1): the 1 defines the number of arguments of g)

function.png
#4 已发布: 2022/8/4 07:54:16
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

Anyone know what functions I should combine to produce the custom function I need ?


The all thing is in there: create the data set you need.
NestRow(data,s,r,k) will stack pairwise for plotting the project.
Cheers ... Jean.

Page15 ConnectNest.sm (29.06 KiB)已下载 1492 次。


  • 有新帖
  • 无新帖