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

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline wb.c  
#1 Posted : 05 March 2021 17:27:05(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 78
United States

Was thanked: 11 time(s) in 11 post(s)
Working with Smath Viewer here, so that might have limitations of its own.

I'm trying to figure out how to have a matrix or vector input of variable size.

This should allow a user to input vectors with a different number of elements.

So one time the user might enter the values:

5,10,20,30 (4 elements)

and the next time, the user might need to enter:

5,10,20,30,40,50 (6 elements)

These values will be used to perform a series of calculations and produce results like this:

User Input:
V1=(5,10,20)
V2=(100,200,300)

Calculation:
R1=V1*V2 = (500,2000,6000)

The limitation really seems to be SMath Viewer, as it is limited on data input.
I'm aware of using external data files (.txt, etc) to handle data input, but it would be nice of we could avoid it as I am trying to have a standalone .exe.

It seems like the Viewer has a hard time with variable inputs. Maybe a vector can be constructed with str2var? Not sure if that is even possible, but it might allow a vector of N elements to be inoput into a single input box.

Any input into this would be appreciated. Thanks,

Edited by user 17 March 2021 22:00:59(UTC)  | Reason: Not specified

Offline fedeghi  
#2 Posted : 05 March 2021 17:39:09(UTC)
fedeghi


Rank: Advanced Member

Groups: Registered
Joined: 14/09/2013(UTC)
Posts: 63
Italy

Was thanked: 17 time(s) in 12 post(s)
I regularly prepare some small .sm calculation templates, and distribute them to colleagues in .exe format.
I agree, it would be really nice to be able to handle variable length inputs (arrays or matrix of data) as described by you but... as far as I know, this cannot be done with one single .exe file (yet?).
I think that today's best approach is still to read an external input file (xlsx or txt).
Offline wb.c  
#3 Posted : 05 March 2021 21:01:06(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 78
United States

Was thanked: 11 time(s) in 11 post(s)
This seems to work for worksheet (.sm) form, but no luck with "SMath Viewer".

It basically builds a multi-element vector from a single string entry.

2021-03-05 12_55_24.png

It works in the viewer, but you can't change the input string in any way.
Maybe the str2num is not supported by the Viewer?

Variable Vector Length Data Input.sm (14kb) downloaded 22 time(s).
Offline wb.c  
#4 Posted : 06 March 2021 00:01:24(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 78
United States

Was thanked: 11 time(s) in 11 post(s)
So after doing some digging on the forum I have found that in older versions (97.5737) the modification of text strings was fully functional. For some reason it was disabled, I really can't see why this was done as it solves the major issue of standalone data entry that Smath Viewer has.

Related Topic


Some feedback form the SMath Gods would be nice...

I made an exe that does the same as my previous post, and it works as I intended, not all the same features are available in 97.5737, but as a proof of concept it worked. I was able to enter data into one input box a string with comma separators and then use that data in operations within the exe. I was then able to change the data by editing the input into the input box.

Variable Vector Input Test (97.5737).exe.zip (379kb) downloaded 12 time(s).

You can enter two vectors containing equal number of elements, change the length, numbers, and if works just fine!
No table region in 97.5737, so just deal with the string output, but you get the point.
Why can't we do this with the latest version?
Offline uni  
#5 Posted : 07 March 2021 18:20:19(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Jean, I will have to delete messages that prevent the author of the post from discussing his problem. If he asks me about it.
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
Offline wb.c  
#6 Posted : 07 March 2021 18:29:38(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 78
United States

Was thanked: 11 time(s) in 11 post(s)
Uni, please delete the posts that have nothing to do with the topic. I will delete mine to clean up the discussion.

P.S. some feedback from you pros about this topic would be appreciated too.

Спасибо
Offline uni  
#7 Posted : 08 March 2021 07:56:20(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Originally Posted by: wb.c Go to Quoted Post
It works in the viewer, but you can't change the input string in any way.
Maybe the str2num is not supported by the Viewer?

This is strange behavior. Better to ask Andrey about it.

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
Offline wb.c  
#8 Posted : 08 March 2021 15:51:19(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 78
United States

Was thanked: 11 time(s) in 11 post(s)
Andrey Ivashov Offline , can you give any feedback as to why string modification within the Viewer is not working in recent versions? Note that it was working in 97.5737.
Thanks so much!
Offline uni  
#9 Posted : 09 March 2021 16:02:04(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,155
Man
Russian Federation

Was thanked: 1005 time(s) in 582 post(s)
Andrey made corrections. The update will be available today or tomorrow.
Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
Offline wb.c  
#10 Posted : 09 March 2021 16:53:28(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 78
United States

Was thanked: 11 time(s) in 11 post(s)
Great to hear. I was certain that it was a minor bug, seemed very trivial.
Thanks so much!
Offline Andrey Ivashov  
#11 Posted : 11 March 2021 09:03:51(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,566
Man
Russian Federation

Was thanked: 1855 time(s) in 631 post(s)
Fixed in yesterdays nightly build.

Thank you!
Offline wb.c  
#12 Posted : 11 March 2021 21:39:17(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 78
United States

Was thanked: 11 time(s) in 11 post(s)
Andrey, Thanks for the fix. I have tested it and it is working perfectly.
Take care.
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.