Custom Functions plugin

Custom Functions plugin - functions: extended Max and Min, Unit of Measurement, Order of Magnitude - Messages

#21 Posted: 2/10/2013 1:25:48 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

I guess the problem is that in the example the variable V is not just a system but an expression involving systems. There was a sys2mat version with just replacing the "sys" in the string representation (num2str) by "mat". In the given case, this approach would fail.

Perhaps the function sys2mat should internally apply eval() and then do the replacement.

Martin
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#22 Posted: 2/11/2013 6:11:20 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED

- fixed issue of sys2mat() involving sys() special features (many thanks to [userlink]mkraska[/userlink])


best regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Martin Kraska 2/12/2013 5:55:00 PM
#23 Posted: 2/17/2013 7:40:28 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

The mat2sys function seems to be limited to column matrices. This might be a feature rather than a bug. In the first case I would recommend to be more specific in the doc string ("Converts column matrices (vectors) to systems" ). Alternatively, the linear indexing feature could be used to flatten the matrix.
mat2sys.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Radovan Omorjan 2/17/2013 7:59:00 AM
#24 Posted: 2/17/2013 2:45:16 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Wrote

The mat2sys function seems to be limited to column matrices. This might be a feature rather than a bug. In the first case I would recommend to be more specific in the doc string ("Converts column matrices (vectors) to systems" ). Alternatively, the linear indexing feature could be used to flatten the matrix.



Hi Martin

Yes, actually mat2sys function is limited to column matrices (the function brutally changes "sys(" to "mat(", without checks).

An improvement will be available ASAP.


best regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Martin Kraska 2/18/2013 5:58:00 AM
#25 Posted: 2/20/2013 11:56:19 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED

- mat2sys() now can handle also non-column matrices (nested or not)
- sys2mat() symbolical enhancements


regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
sergio 2/21/2013 6:44:00 AM
#26 Posted: 3/15/2013 7:05:31 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED

  • added new texts functions:
    • strtolower(1): converts all characters in a string to lowercase;
    • strtoupper(1): converts all characters in a string to uppercase;
    • ucfirst(1): converts the first characters in a string to uppercase;
    • ucwords(1): converts the first characters of each word in a string to uppercase;
    all functions works both with texts or texts nested in arrays/systems;

  • added norme(): unofficial patch of SMath Studio norme() function (BUG shown here);

  • sys2mat(): fixed unexpected influence on input arguments.


Plugin's Sources are moved to the SVN repository (I have added a link in the first post)


regards,

w3b5urf3r
SMath Studio - [customFunctions_examples.sm].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
3 users liked this post
Martin Kraska 3/16/2013 3:24:00 PM, sergio 3/15/2013 9:36:00 AM, Radovan Omorjan 3/16/2013 3:19:00 AM
#27 Posted: 3/16/2013 3:59:58 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Hi Davide,

thanks for the update. I added the functions to the function reference in the handbook and also added a section on string functions.

The norme replacement is highly welcome. I just had a small problem, see attachment.

Just in case you are looking for distraction from real stuff like unit and systems proof solvers:
I'd vote for unit-proof versions of int(), Re() and Im() and arg().

Martin
norme.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#28 Posted: 3/16/2013 4:17:55 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Thank you Martin;

the issue is related with some SMath bug involving transpose and the linear indexing feature ... Tomorrow I'll look in the bug section to see if it has already been reported and I'll update the plugin with your formula
SMath Studio - [bug.sm].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#29 Posted: 3/17/2013 7:40:20 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED

- fixed norme() issue involving transpose and the linear indexing feature;
- enhancements of ucwords(): now accept all Unicode white spaces as separator of words.


best regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Martin Kraska 3/17/2013 7:50:00 PM
#30 Posted: 4/16/2013 9:58:33 AM
sublim21

sublim21

3 likes in 36 posts.

Group: User

Great job websurfer!

Would it be possible to change mat2sys such that it doesn't collapse nested matrices?

Please see attached
sys2mat_suggestion.sm (5 KiB) downloaded 111 time(s).
#31 Posted: 4/16/2013 11:14:06 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote


Would it be possible to change sys2mat such that it doesn't collapse nested matrices?



That won't work as list nesting is not persistent:
[MATH lang=ENG]sys(sys(1,2,2,1),3,2,1)=sys(1,2,3,3,1)[/MATH]
mat2sys could, however, have an option to restrict the conversion to the outer level matrix and leave all entries as they are.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#32 Posted: 4/16/2013 11:35:06 AM
sublim21

sublim21

3 likes in 36 posts.

Group: User

mkraska, you're right. sys2mat was a typo. Thanks!
#33 Posted: 4/23/2013 4:31:11 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED

- fixed norme issue with 1x1 matrices
- UoM now get the units element-by-element from any matrix/system (nested or not)


best regards,

w3b5urf3r
SMath Studio - [UoM].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#34 Posted: 4/23/2013 10:54:12 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#35 Posted: 6/4/2013 2:46:56 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

A Nightly update for anyone are using SMath Studio 0.96.4902 (plugins -> online gallery)

- removed norme clone (not needed anymore)

- added not recursive [MATH eng]mat2sys.1(#)[/MATH]

- added not recursive [MATH eng]sys2mat.1(#)[/MATH]


best regards,

w3b5urf3r
customFunctions_examples.zip (4 KiB) downloaded 106 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Radovan Omorjan 6/4/2013 3:05:00 AM
#36 Posted: 12/27/2013 9:29:52 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

mat2sys requires the argument to be literal matrices. Matrix-valued expressions need to be evaluated first either by assigning them to a variable or by wrapping them in eval(). A similar issue has been reported for sys2mat and has been solved.

I propose to transfer the solution to mat2sys.
mat2sys.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Davide Carpi 12/27/2013 8:24:00 PM
#37 Posted: 3/1/2014 12:12:08 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

UPDATED

- new function: InterpBilinear()
- new function: GetType()
- mat2sys() improvements for 1x1 matrices

(examples attached in the first post)
2014-03-01 17_13_27-SMath Studio Desktop - [CustomFunctions_examples.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
ioan92 3/1/2014 3:59:00 PM, Mike Kaganski 3/1/2014 6:23:00 PM
#38 Posted: 6/22/2014 6:42:25 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED

- added strsplit("string","delimiter" )


Best regards,

Davide
Screenshot_1.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
ioan92 6/23/2014 6:21:00 AM
#39 Posted: 6/23/2014 4:17:53 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Davide, try string.Join().
Russia ☭ forever, Viacheslav N. Mezentsev
1 users liked this post
Davide Carpi 6/23/2014 4:57:00 AM
#40 Posted: 6/23/2014 5:37:48 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Thank you Viacheslav

Done: added strjoin(2)


Best regards,

Davide
Screenshot_3.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
ioan92 6/23/2014 6:20:00 AM, Вячеслав Мезенцев 6/23/2014 5:40:00 AM
  • New Posts New Posts
  • No New Posts No New Posts