Matlab Runtime Library

Matlab Runtime Library - Consists of approximately 400 Matlab math functions - Messages

#1 Posted: 8/18/2013 2:08:18 PM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Matlab Runtime Library

SMath Studio compatibility SMath Viewer compatibility mono compatibility Platform Extension page Sources


CorFlags will help you to use this plugin on 64-bit system. mw prefix means: Matlab Workspace or MathWorks.

Functions list (blue color - implemented):

General Purpose Commands

Show Spoiler


Operators and Special Functions

Show Spoiler


Elementary Matrices and Matrix Manipulation

Show Spoiler


Elementary Math Functions

Show Spoiler


Data Analysis and Fourier Transform Functions

Show Spoiler


Polynomial and Interpolation Functions

Show Spoiler


Function Functions and ODE Solvers

Show Spoiler


Character String Functions

Show Spoiler


File I/O Functions

Show Spoiler


Data Types

Show Spoiler


Time and Dates

Show Spoiler



Examples:

[albumimg]281[/albumimg] [albumimg]1576[/albumimg] [albumimg]1577[/albumimg] [albumimg]1578[/albumimg]


matlab.ode.kinetic1.sm (8 KiB) downloaded 232 time(s).
matlab.ode.kinetic2.sm (13 KiB) downloaded 166 time(s).
matlab.ode.kinetic3.sm (12 KiB) downloaded 159 time(s).
matlab.ode.test1.sm (19 KiB) downloaded 154 time(s).
matlab.ode.test2.sm (18 KiB) downloaded 150 time(s).
matlab.ode.Amplitude detector.sm (20 KiB) downloaded 184 time(s).

matlab.ode.kinetic1.pdf (77 KiB) downloaded 193 time(s).
matlab.ode.kinetic2.pdf (91 KiB) downloaded 137 time(s).
matlab.ode.kinetic3.pdf (87 KiB) downloaded 132 time(s).
matlab.ode.test1.pdf (110 KiB) downloaded 149 time(s).
matlab.ode.test2.pdf (110 KiB) downloaded 128 time(s).
matlab.ode.Amplitude detector.pdf (148 KiB) downloaded 166 time(s).
Matlab C++ Math Library. ODE solvers. Amplitude detector.sm (14 KiB) downloaded 631 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
3 users liked this post
Davide Carpi 8/20/2013 5:47:00 PM, ioan92 8/20/2013 5:35:00 AM, Radovan Omorjan 8/19/2013 11:37:00 AM
#2 Posted: 8/18/2013 6:41:11 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Works for me. Does that imply that any matlab function could be used by SMath? Any chance for interactive plots? Ok, I know: Not so fast...
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
#3 Posted: 8/18/2013 10:09:58 PM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Quote

Any chance for interactive plots?


Chapter 25. MATLAB C/C++ Graphics Library 2.1 Release Notes

Using this library, in conjunction with the MATLAB Compiler and the MATLAB C/C++ Math Library, you can create stand-alone applications from M-files that use lines, text, meshes, and polygons as well as interactive visual interface components such as menus, push buttons, and dialog boxes.

Quote

Note. You must use the MATLAB Compiler to create C or C++ stand-alone graphics applications. Calling MATLAB C/C++ Graphics Library routines directly from a C or C++ source module is not supported.


So, the answer is no.

Quote

Does that imply that any matlab function could be used by SMath?


I added a list of the available functions (MATLAB C++ Math Library. Reference. Version 2.pdf). Most of them, I think, can be used. The library has functions to solve the ODE: ode45, ode23, ode113, ode15s, ode23s.
Russia ☭ forever, Viacheslav N. Mezentsev
2 users liked this post
Martin Kraska 8/19/2013 10:40:00 AM, Radovan Omorjan 8/19/2013 11:37:00 AM
#4 Posted: 8/19/2013 11:47:38 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

It seems it works for me as well

By the way, I do not have Matlab installed, just followed the instructions and I could see and use the four mentioned function in SMath from the starting post (mw...). Not quite sure how this could be used without Matlab, but never mind - just wanted to try it on .

Regards,
Radovan

[EDIT] Did not understand what uni said about ODE: ode45, ode23, ode113, ode15s, ode23s ?
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Posted: 8/19/2013 11:52:31 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote


I added a list of the available functions (MATLAB C++ Math Library. Reference. Version 2.pdf). Most of them, I think, can be used. The library has functions to solve the ODE: ode45, ode23, ode113, ode15s, ode23s.


That sounds good. However, I don't know if any of these solvers has advantages over what we already have in various plugins.
How about the function find or fscanf?

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#6 Posted: 8/20/2013 2:12:17 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Updated. mwfind(1) added.

Radovan, this Math Library was created precisely in order to use the Matlab without Matlab.

There is one big problem when using functions from the library. The function can have a different number and different type parameters. Furthermore, a different number of the output data. SMath Studio doesn't support such features. I asked Andrew to think about it.
Matlab C++ Math Library. Example 1.png
Russia ☭ forever, Viacheslav N. Mezentsev
3 users liked this post
Radovan Omorjan 8/20/2013 3:58:00 AM, ioan92 8/20/2013 5:43:00 AM, Martin Kraska 8/20/2013 2:31:00 AM
#7 Posted: 8/20/2013 2:54:08 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Very nice. The real fun with find() comes if you can have matrix valued operands and results in boolean expressions. As these cannot be matrix-valued in
SMath, we at least need the matrix sign function. Uni, could you please add this?
In order to find all elements in M less then a number a, you would write in Matlab:
[MATH]find(MNot really nice and comprehensible (the expression may well be wrong), but no loop required.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#8 Posted: 8/20/2013 3:41:16 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Furthermore, a different number of the output data. SMath Studio doesn't support such features. I asked Andrew to think about it.


For the output parameters, an option would be to use embedded assignment, just like in Davide's findroot function. This is very transparant and handy. You would have an optional argument, being a vector of name=key pairs, where name is a variable name and key is an result item key. Your example then would look like

[MATH lang=eng]mwfind(mat(1,2,0,3,2,2),mat(I≡Index1,J≡Index2,V≡Values,3,1))[/MATH]
Of course, there are open questions: What should the return value be? Are there side effects of embedded assignments in nested expressions?
For providing optional input arguments, this would be an option as well. That would look a bit Python-like.

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#9 Posted: 8/20/2013 4:08:47 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Wrote

Updated. mwfind(1) added.

Radovan, this Math Library was created precisely in order to use the Matlab without Matlab.

There is one big problem when using functions from the library. The function can have a different number and different type parameters. Furthermore, a different number of the output data. SMath Studio doesn't support such features. I asked Andrew to think about it.


If I understood well all of this, these mw... functions will be introduced gradually into SMath, as soon as these and similar problems would be solved in SMath. Was I right about it?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#10 Posted: 8/20/2013 6:35:25 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Updated. mwsign(1), mweq(2), mwge(2), mwgt(2), mwle(2), mwlt(2), mwneq(2) added.

Relational operations (Reference, p. 32).
Matlab C++ Math Library. Example 2.png
Russia ☭ forever, Viacheslav N. Mezentsev
2 users liked this post
Radovan Omorjan 8/20/2013 7:23:00 AM, Davide Carpi 8/20/2013 7:30:00 AM
#11 Posted: 8/20/2013 7:30:29 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Thank you uni. It seems I was right

By the way, the second argument does not need to be a matrix. Scalar will do the job as well

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#12 Posted: 8/21/2013 1:00:30 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Updated. mwfprintf(4), mwfscanf(3), mwfscanf(4).

Quote

By the way, the second argument does not need to be a matrix. Scalar will do the job as well



Yes, but it's an undocumented feature. The function takes a matrix as a parameter.

[albumimg]281[/albumimg]
Russia ☭ forever, Viacheslav N. Mezentsev
2 users liked this post
Radovan Omorjan 8/21/2013 5:40:00 AM, Martin Kraska 8/21/2013 5:46:00 PM
#13 Posted: 8/21/2013 6:53:30 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Updated. mwode45(5), mwode23(5), mwode113(5), mwode15s(5), mwode23s(5) added.

mwode45(5) - (init, x1, x2, intvls, D) solve non-stiff differential equations, medium order method.
mwode23(5) - (init, x1, x2, intvls, D) solve non-stiff differential equations, low order method.
mwode113(5) - (init, x1, x2, intvls, D) solve non-stiff differential equations, variable order method.

mwode15s(5) - (init, x1, x2, intvls, D) solve stiff differential equations and DAEs, variable order method.
mwode23s(5) - (init, x1, x2, intvls, D) solve stiff differential equations, low order method.

[albumimg]282[/albumimg]


Matlab C++ Math Library. ODE solvers. Arenstorf orbit.pdf (99 KiB) downloaded 179 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
2 users liked this post
Martin Kraska 8/21/2013 5:45:00 PM, Radovan Omorjan 8/21/2013 8:11:00 AM
#14 Posted: 8/21/2013 4:52:44 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Updated. mwfprintf(4), mwfscanf(3), mwfscanf(4).

Quote

By the way, the second argument does not need to be a matrix. Scalar will do the job as well


Yes, but it's an undocumented feature. The function takes a matrix as a parameter.


Now it is documented, but perhaps not officially supported ;-) Is there any chance to overload the operators? Do they have internal functions that could be overwritten?

Also, thanks for the file ops. Writing of strings is not supported so far?

I fail to read the datafile even if I remove the first line with the column titles. Would be interesting to see what performance we get.

One remark to function naming: This is of course entirely in the souvereignity of the plugin creator. Still I would make some recommendations, driven by
the objective, to make an SMath document as much math-on-paper like as opposed to program code.
- I'd recommend to shift the information on the function's origin from name prefixes like dn_, al_, mw... towards the dynamic assistant help string, much like it is done for the efi-loaded libraries.
- If a function is first or best in providing some feature (which quite frequently happens in your plugins), then please give it an intuitive generic name, perhaps with capital first character in order to indicate it as plugin-based. Example: dn_LinAlgEigenvalues() could well be Eigenvalues().
- technical information on which function actually is doing the job, might be shifted to the description string.
Surely, this all is a matter of taste and perhaps it is quickest, not to waste time on naming strategies. Either way, I try to keep up with documenting.





fprintf.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Вячеслав Мезенцев 8/22/2013 12:01:00 AM
#15 Posted: 8/21/2013 11:44:50 PM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Updated. Now the installer is located within the plugin.

I'll remove all of the prefixes, when Andrey will support the functions with the different types of parameters.

In MATLAB all the parameters are of type matrix. Inside the plugin takes place an implicit conversion to a type of matrix if you use a scalar. Therefore, for example, for the function mwabs() the result is a vector (matrix). Special support for scalar parameters makes sense to do only when overloading will be realized.
Installer.PNG
Russia ☭ forever, Viacheslav N. Mezentsev
1 users liked this post
Martin Kraska 8/22/2013 12:54:00 PM
#16 Posted: 8/22/2013 1:29:59 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Thank you for considering to rename functions. I also would not mind 1x1 matrix results to be converted to scalars by default, even if that might be mathematically a bit sloppy. But perhaps someone can give an example where that would be harmful...
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#17 Posted: 8/22/2013 1:46:39 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

I would like to point the user to the environment variable editor using the command line

"C:\Windows\system32\rundll32" sysdm.cpl,EditEnvironmentVariables

in the plugin handbook page.
but I have no idea how that can be made a link target in the hyperlink region (due to the " signs in the link). Davide, any idea?

An alternative would be that the installer tests for the presence of dll and path entry and adds the entry if required.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#18 Posted: 8/22/2013 5:03:14 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Wrote

I would like to point the user to the environment variable editor using the command line

"C:\Windows\system32\rundll32" sysdm.cpl,EditEnvironmentVariables

in the plugin handbook page.
but I have no idea how that can be made a link target in the hyperlink region (due to the " signs in the link). Davide, any idea?



This require to use an overload of the function that I've used inside the hyperlink region; I need to think how to unlock the feature without compromising those already existing....

P.S. I'm not sure that this command works after windows XP
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 8/22/2013 5:33:00 PM
#19 Posted: 8/22/2013 5:31:34 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

P.S. I'm not sure that this command works after windows XP


I am using Win7 and got the command line from the program manager after clicking through the system control hierarchy. Faster is to locate the dialog via search for "Umg", german for "env".

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#20 Posted: 8/23/2013 3:42:17 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Updated. Now the installer is located within the plugin.


There is an user interaction issue. After updating the plugin and re-starting smath,
the installer dialog pops up and offers installation. You are also informed that you do not need installation if you already have the runtime environment installed. In this case it is natural that the user chooses [Cancel]. Then, however, the dialog pops up every time you launch smath.

If you choose [Install] even if you know that nothing needs to be installed, then suddenly the installer gets aware of that and just finishes and no more messages appear on start-up.

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Вячеслав Мезенцев 8/23/2013 10:15:00 AM
  • New Posts New Posts
  • No New Posts No New Posts