SMath Viewer - Input Matrix/Vector of Variable size

SMath Viewer - Input Matrix/Vector of Variable size - Сообщения

#1 Опубликовано: 05.03.2021 11:27:05
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

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,
#2 Опубликовано: 05.03.2021 11:39:09
fedeghi

fedeghi

25 сообщений из 112 понравились пользователям.

Группа: User

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).
#3 Опубликовано: 05.03.2021 15:01:06
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

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 (13 КиБ) скачан 66 раз(а).
#4 Опубликовано: 05.03.2021 18:01:24
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

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 (378 КиБ) скачан 52 раз(а).

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?
#5 Опубликовано: 07.03.2021 12:20:19
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

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
#6 Опубликовано: 07.03.2021 12:29:38
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

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.

Спасибо
#7 Опубликовано: 08.03.2021 01:56:20
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Wrote

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
#8 Опубликовано: 08.03.2021 09:51:19
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

[USERLINK]Andrey Ivashov[/USERLINK], 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!
#9 Опубликовано: 09.03.2021 10:02:04
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Andrey made corrections. The update will be available today or tomorrow.
Russia ☭ forever, Viacheslav N. Mezentsev
#10 Опубликовано: 09.03.2021 10:53:28
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

Great to hear. I was certain that it was a minor bug, seemed very trivial.
Thanks so much!
#11 Опубликовано: 11.03.2021 03:03:51
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

Fixed in yesterdays nightly build.

Thank you!
#12 Опубликовано: 11.03.2021 15:39:17
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

Andrey, Thanks for the fix. I have tested it and it is working perfectly.
Take care.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений