Matlab Runtime Library

Matlab Runtime Library - Consists of approximately 400 Matlab math functions - Сообщения

#1 Опубликовано: 18.08.2013 14:08:18
Вячеслав Мезенцев

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

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

Группа: 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

Показать спойлер


Operators and Special Functions

Показать спойлер


Elementary Matrices and Matrix Manipulation

Показать спойлер


Elementary Math Functions

Показать спойлер


Data Analysis and Fourier Transform Functions

Показать спойлер


Polynomial and Interpolation Functions

Показать спойлер


Function Functions and ODE Solvers

Показать спойлер


Character String Functions

Показать спойлер


File I/O Functions

Показать спойлер


Data Types

Показать спойлер


Time and Dates

Показать спойлер



Examples:

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


matlab.ode.kinetic1.sm (8 КиБ) скачан 200 раз(а).
matlab.ode.kinetic2.sm (13 КиБ) скачан 132 раз(а).
matlab.ode.kinetic3.sm (12 КиБ) скачан 122 раз(а).
matlab.ode.test1.sm (19 КиБ) скачан 118 раз(а).
matlab.ode.test2.sm (18 КиБ) скачан 117 раз(а).
matlab.ode.Amplitude detector.sm (20 КиБ) скачан 150 раз(а).

matlab.ode.kinetic1.pdf (77 КиБ) скачан 160 раз(а).
matlab.ode.kinetic2.pdf (91 КиБ) скачан 108 раз(а).
matlab.ode.kinetic3.pdf (87 КиБ) скачан 97 раз(а).
matlab.ode.test1.pdf (110 КиБ) скачан 115 раз(а).
matlab.ode.test2.pdf (110 КиБ) скачан 99 раз(а).
matlab.ode.Amplitude detector.pdf (148 КиБ) скачан 132 раз(а).
Matlab C++ Math Library. ODE solvers. Amplitude detector.sm (14 КиБ) скачан 596 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
3 пользователям понравился этот пост
Davide Carpi 20.08.2013 17:47:00, ioan92 20.08.2013 05:35:00, Radovan Omorjan 19.08.2013 11:37:00
#2 Опубликовано: 18.08.2013 18:41:11
Martin Kraska

Martin Kraska

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

Группа: 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 пользователям понравился этот пост
#3 Опубликовано: 18.08.2013 22:09:58
Вячеслав Мезенцев

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

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

Группа: Moderator

Цитата

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.

Цитата

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.

Цитата

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 пользователям понравился этот пост
Martin Kraska 19.08.2013 10:40:00, Radovan Omorjan 19.08.2013 11:37:00
#4 Опубликовано: 19.08.2013 11:47:38
Radovan Omorjan

Radovan Omorjan

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

Группа: 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 Опубликовано: 19.08.2013 11:52:31
Martin Kraska

Martin Kraska

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

Группа: 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 Опубликовано: 20.08.2013 02:12:17
Вячеслав Мезенцев

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

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

Группа: 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 пользователям понравился этот пост
Radovan Omorjan 20.08.2013 03:58:00, ioan92 20.08.2013 05:43:00, Martin Kraska 20.08.2013 02:31:00
#7 Опубликовано: 20.08.2013 02:54:08
Martin Kraska

Martin Kraska

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

Группа: 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 Опубликовано: 20.08.2013 03:41:16
Martin Kraska

Martin Kraska

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

Группа: 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 Опубликовано: 20.08.2013 04:08:47
Radovan Omorjan

Radovan Omorjan

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

Группа: 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 Опубликовано: 20.08.2013 06:35:25
Вячеслав Мезенцев

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

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

Группа: 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 пользователям понравился этот пост
Radovan Omorjan 20.08.2013 07:23:00, Davide Carpi 20.08.2013 07:30:00
#11 Опубликовано: 20.08.2013 07:30:29
Radovan Omorjan

Radovan Omorjan

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

Группа: 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 Опубликовано: 21.08.2013 01:00:30
Вячеслав Мезенцев

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

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

Группа: Moderator

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

Цитата

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 пользователям понравился этот пост
Radovan Omorjan 21.08.2013 05:40:00, Martin Kraska 21.08.2013 17:46:00
#13 Опубликовано: 21.08.2013 06:53:30
Вячеслав Мезенцев

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

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

Группа: 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 КиБ) скачан 147 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
2 пользователям понравился этот пост
Martin Kraska 21.08.2013 17:45:00, Radovan Omorjan 21.08.2013 08:11:00
#14 Опубликовано: 21.08.2013 16:52:44
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

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

Цитата

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 пользователям понравился этот пост
#15 Опубликовано: 21.08.2013 23:44:50
Вячеслав Мезенцев

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

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

Группа: 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 пользователям понравился этот пост
Martin Kraska 22.08.2013 12:54:00
#16 Опубликовано: 22.08.2013 13:29:59
Martin Kraska

Martin Kraska

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

Группа: 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 Опубликовано: 22.08.2013 13:46:39
Martin Kraska

Martin Kraska

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

Группа: 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 Опубликовано: 22.08.2013 17:03:14
Davide Carpi

Davide Carpi

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

Группа: 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 пользователям понравился этот пост
Martin Kraska 22.08.2013 17:33:00
#19 Опубликовано: 22.08.2013 17:31:34
Martin Kraska

Martin Kraska

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

Группа: 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 Опубликовано: 23.08.2013 03:42:17
Martin Kraska

Martin Kraska

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

Группа: 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 пользователям понравился этот пост
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений