question about 2D graph

question about 2D graph - 消息

#1 已发布: 2020/6/14 14:46:33
churichuro

churichuro

29个赞,共79个帖子。

组: User



hello again.

How can I get a graph from a variable? Example in graph 2 where nothing appears.

the content of the variable is pasted directly into graph 1 and
there it is working

I generate the matrices to draw a series of rectangles
but I don't know in advance how many rectangles will be drawn
that's why I require to use a variable that contains a system of several matrices

is there another solution?

stack-of-rec.sm (29.67 KiB)已下载 1243 次。
#2 已发布: 2020/6/14 18:04:22
Martin Kraska

Martin Kraska

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

组: Moderator

There might be other issues, but one of them could be the bug demonstrated here. Normally, no element assignment should alter the object type from list to matrix as it seems to happen in the line block definition. I think this is another regression, such stuff used to work in older versions (here 7251).

The original desparate workaround with str2num tries to handle the bug. Normally you should be able to reliably initialize a variable using any object of appropriate type.

Lists.png
Lists.sm (7.5 KiB)已下载 1233 次。
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#3 已发布: 2020/6/14 19:48:13
Jean Giraud

Jean Giraud

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

组: User

Wrote

is there another solution?


Transit the 'gg' matrices via file, plot.

stack-of-rec.sm (31.93 KiB)已下载 1221 次。
#4 已发布: 2020/6/14 20:56:33
churichuro

churichuro

29个赞,共79个帖子。

组: User

thank you very much Martin Kraska and also to you Jean Giraud

both options work well
I attach the file with Martin's suggestion, which I
It seems what I was looking for, and I take note of the solution
Jean who as always is very helpful and educational
since you learn a lot from these examples.

Thank you!

stack-of-rec.sm (23.12 KiB)已下载 1209 次。
#5 已发布: 2020/6/14 21:04:19
Jean Giraud

Jean Giraud

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

组: User

Much simpler Amigo ...
Isolate 'gg' gg:= gg ...or rectangles:= gg
#6 已发布: 2020/6/14 21:44:58
churichuro

churichuro

29个赞,共79个帖子。

组: User

Wrote

Much simpler Amigo ...
Isolate 'gg' gg:= gg ...or rectangles:= gg



Hahaha yes! this work too.
#7 已发布: 2020/6/15 11:39:52
Jean Giraud

Jean Giraud

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

组: User

If you want unicolor plot and rotation,
you may have to reconsider your construction.

Utilities XY [Draw Truss].sm (22.85 KiB)已下载 1049 次。
stack-of-rec.sm (37.11 KiB)已下载 1222 次。
1位用户喜欢此帖子
churichuro 2021/5/12 13:36:00
#8 已发布: 2020/6/15 13:55:02
Jean Giraud

Jean Giraud

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

组: User

Your H beam, you can have it SVG style.

Spline De Casteljau SVG Hbeam.sm (41.36 KiB)已下载 1309 次。
#9 已发布: 2020/6/15 14:26:17
Martin Kraska

Martin Kraska

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

组: Moderator

Wrote

There might be other issues, but one of them could be the bug demonstrated here. Normally, no element assignment should alter the object type from list to matrix as it seems to happen in the line block definition. I think this is another regression, such stuff used to work in older versions (here 7251).

The original desparate workaround with str2num tries to handle the bug. Normally you should be able to reliably initialize a variable using any object of appropriate type.



The issue demonstrated in the above post nails down to unexpected handling of single element lists used to initialize the data under numeric optimization.

lists2.png

lists2.sm (6.44 KiB)已下载 1209 次。
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
2位用户喜欢此帖子
Davide Carpi 2020/6/15 15:08:00, frapuano 2020/6/16 02:45:00
  • 有新帖
  • 无新帖