Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline churichuro  
#1 Posted : 14 June 2020 20:46:33(UTC)
churichuro


Rank: Member

Groups: Registered
Joined: 27/03/2019(UTC)
Posts: 11
Mexico
Location: coah



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 (30kb) downloaded 3 time(s).

Edited by user 14 June 2020 20:57:35(UTC)  | Reason: Not specified

Offline mkraska  
#2 Posted : 15 June 2020 00:04:22(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,583
Germany

Was thanked: 858 time(s) in 546 post(s)
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 (8kb) downloaded 1 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline Jean Giraud  
#3 Posted : 15 June 2020 01:48:13(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,658
Canada

Was thanked: 791 time(s) in 627 post(s)
Originally Posted by: churichuro Go to Quoted Post
is there another solution?

Transit the 'gg' matrices via file, plot.

stack-of-rec.sm (32kb) downloaded 2 time(s).
Offline churichuro  
#4 Posted : 15 June 2020 02:56:33(UTC)
churichuro


Rank: Member

Groups: Registered
Joined: 27/03/2019(UTC)
Posts: 11
Mexico
Location: coah

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 (24kb) downloaded 6 time(s).
Offline Jean Giraud  
#5 Posted : 15 June 2020 03:04:19(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,658
Canada

Was thanked: 791 time(s) in 627 post(s)
Much simpler Amigo ...
Isolate 'gg' gg:= gg ...or rectangles:= gg
Offline churichuro  
#6 Posted : 15 June 2020 03:44:58(UTC)
churichuro


Rank: Member

Groups: Registered
Joined: 27/03/2019(UTC)
Posts: 11
Mexico
Location: coah

Originally Posted by: Jean Giraud Go to Quoted Post
Much simpler Amigo ...
Isolate 'gg' gg:= gg ...or rectangles:= gg


Hahaha yes! this work too. Clap
Offline Jean Giraud  
#7 Posted : 15 June 2020 17:39:52(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,658
Canada

Was thanked: 791 time(s) in 627 post(s)
If you want unicolor plot and rotation,
you may have to reconsider your construction.

Utilities XY [Draw Truss].sm (23kb) downloaded 9 time(s).
stack-of-rec.sm (38kb) downloaded 9 time(s).
Offline Jean Giraud  
#8 Posted : 15 June 2020 19:55:02(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,658
Canada

Was thanked: 791 time(s) in 627 post(s)
Your H beam, you can have it SVG style.

Spline De Casteljau SVG Hbeam.sm (42kb) downloaded 9 time(s).
Offline mkraska  
#9 Posted : 15 June 2020 20:26:17(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,583
Germany

Was thanked: 858 time(s) in 546 post(s)
Originally Posted by: mkraska Go to Quoted Post
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 (7kb) downloaded 7 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
thanks 2 users thanked mkraska for this useful post.
on 15/06/2020(UTC),  on 16/06/2020(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.