question about 2D graph

question about 2D graph - Messages

#1 Posted: 6/14/2020 2:46:33 PM
churichuro

churichuro

28 likes in 79 posts.

Group: 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) downloaded 216 time(s).
#2 Posted: 6/14/2020 6:04:22 PM
Martin Kraska

Martin Kraska

1,260 likes in 2,186 posts.

Group: 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) downloaded 228 time(s).
Martin KraskaPre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 6/14/2020 7:48:13 PM
Jean Giraud

Jean Giraud

983 likes in 6,866 posts.

Group: User

Wrote

is there another solution?


Transit the 'gg' matrices via file, plot.

stack-of-rec.sm (31.93 KiB) downloaded 212 time(s).
#4 Posted: 6/14/2020 8:56:33 PM
churichuro

churichuro

28 likes in 79 posts.

Group: 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) downloaded 231 time(s).
#5 Posted: 6/14/2020 9:04:19 PM
Jean Giraud

Jean Giraud

983 likes in 6,866 posts.

Group: User

Much simpler Amigo ...
Isolate 'gg' gg:= gg ...or rectangles:= gg
#6 Posted: 6/14/2020 9:44:58 PM
churichuro

churichuro

28 likes in 79 posts.

Group: User

Wrote

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



Hahaha yes! this work too.
#7 Posted: 6/15/2020 11:39:52 AM
Jean Giraud

Jean Giraud

983 likes in 6,866 posts.

Group: User

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

Utilities XY [Draw Truss].sm (22.85 KiB) downloaded 199 time(s).
stack-of-rec.sm (37.11 KiB) downloaded 233 time(s).
1 users liked this post
churichuro 5/12/2021 1:36:00 PM
#8 Posted: 6/15/2020 1:55:02 PM
Jean Giraud

Jean Giraud

983 likes in 6,866 posts.

Group: User

Your H beam, you can have it SVG style.

Spline De Casteljau SVG Hbeam.sm (41.36 KiB) downloaded 257 time(s).
#9 Posted: 6/15/2020 2:26:17 PM
Martin Kraska

Martin Kraska

1,260 likes in 2,186 posts.

Group: 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) downloaded 229 time(s).
Martin KraskaPre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 users liked this post
Davide Carpi 6/15/2020 3:08:00 PM, frapuano 6/16/2020 2:45:00 AM
  • New Posts
  • No New Posts