Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


5 Pages123>»
Options
Go to last post Go to first unread
Offline uni  
#1 Posted : 18 August 2013 21:08:18(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1274 time(s) in 745 post(s)
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:




matlab.ode.kinetic1.sm (9kb) downloaded 169 time(s).
matlab.ode.kinetic2.sm (14kb) downloaded 102 time(s).
matlab.ode.kinetic3.sm (13kb) downloaded 91 time(s).
matlab.ode.test1.sm (20kb) downloaded 91 time(s).
matlab.ode.test2.sm (19kb) downloaded 87 time(s).
matlab.ode.Amplitude detector.sm (21kb) downloaded 122 time(s).

matlab.ode.kinetic1.pdf (78kb) downloaded 122 time(s).
matlab.ode.kinetic2.pdf (92kb) downloaded 75 time(s).
matlab.ode.kinetic3.pdf (88kb) downloaded 72 time(s).
matlab.ode.test1.pdf (111kb) downloaded 86 time(s).
matlab.ode.test2.pdf (111kb) downloaded 72 time(s).
matlab.ode.Amplitude detector.pdf (149kb) downloaded 92 time(s).

Edited by user 09 January 2022 05:27:18(UTC)  | Reason: Not specified

File Attachment(s):
MATLAB C++ Math Library. Reference. Version 2.pdf (1,936kb) downloaded 609 time(s).
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 3 users thanked uni for this useful post.
on 19/08/2013(UTC),  on 20/08/2013(UTC),  on 21/08/2013(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline mkraska  
#2 Posted : 19 August 2013 01:41:11(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
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://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 19/08/2013(UTC)
Offline uni  
#3 Posted : 19 August 2013 05:09:58(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1274 time(s) in 745 post(s)
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
thanks 2 users thanked uni for this useful post.
on 19/08/2013(UTC),  on 19/08/2013(UTC)
Offline omorr  
#4 Posted : 19 August 2013 18:47:38(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
It seems it works for me as well Good

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 Good .

Regards,
Radovan

[EDIT] Did not understand what uni said about ODE: ode45, ode23, ode113, ode15s, ode23s Umnik ?

Edited by user 19 August 2013 18:49:54(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline mkraska  
#5 Posted : 19 August 2013 18:52:31(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: uni Go to Quoted Post

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://smath.com/wiki/SMath_with_Plugins.ashx
Offline uni  
#6 Posted : 20 August 2013 09:12:17(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1274 time(s) in 745 post(s)
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.

Edited by user 20 August 2013 09:24:50(UTC)  | Reason: Not specified

uni attached the following image(s):
Matlab C++ Math Library. Example 1.png
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 3 users thanked uni for this useful post.
on 20/08/2013(UTC),  on 20/08/2013(UTC),  on 20/08/2013(UTC)
Offline mkraska  
#7 Posted : 20 August 2013 09:54:08(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
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:
find(M<a), whereas in SMath that would look like mwfind(mwsign(a-M)+1)
Not really nice and comprehensible (the expression may well be wrong), but no loop required.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline mkraska  
#8 Posted : 20 August 2013 10:41:16(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: uni Go to Quoted Post
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

mwfind(mat(1,2,0,3,2,2),mat(I≡Index1,J≡Index2,V≡Values,3,1))
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://smath.com/wiki/SMath_with_Plugins.ashx
Offline omorr  
#9 Posted : 20 August 2013 11:08:47(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: uni Go to Quoted Post
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!"
Offline uni  
#10 Posted : 20 August 2013 13:35:25(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1274 time(s) in 745 post(s)
Updated. mwsign(1), mweq(2), mwge(2), mwgt(2), mwle(2), mwlt(2), mwneq(2) added.

Relational operations (Reference, p. 32).

Edited by user 20 August 2013 13:43:54(UTC)  | Reason: Not specified

uni attached the following image(s):
Matlab C++ Math Library. Example 2.png
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 20/08/2013(UTC),  on 20/08/2013(UTC)
Offline omorr  
#11 Posted : 20 August 2013 14:30:29(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Thank you uni. It seems I was right Acute

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

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline uni  
#12 Posted : 21 August 2013 08:00:30(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1274 time(s) in 745 post(s)
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.

Edited by user 21 August 2013 08:15:52(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 21/08/2013(UTC),  on 22/08/2013(UTC)
Offline uni  
#13 Posted : 21 August 2013 13:53:30(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1274 time(s) in 745 post(s)
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.



File Attachment(s):
Matlab C++ Math Library. ODE solvers.sm (11kb) downloaded 147 time(s).
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 21/08/2013(UTC),  on 22/08/2013(UTC)
Offline mkraska  
#14 Posted : 21 August 2013 23:52:44(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: uni Go to Quoted Post
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.




File Attachment(s):
Section matrix elementwise.sm (50kb) downloaded 92 time(s).
Section matrix operations.sm (80kb) downloaded 80 time(s).
mkraska attached the following image(s):
fprintf.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 22/08/2013(UTC)
Offline uni  
#15 Posted : 22 August 2013 06:44:50(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1274 time(s) in 745 post(s)
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.
uni attached the following image(s):
Installer.PNG
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 22/08/2013(UTC)
Offline mkraska  
#16 Posted : 22 August 2013 20:29:59(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
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://smath.com/wiki/SMath_with_Plugins.ashx
Offline mkraska  
#17 Posted : 22 August 2013 20:46:39(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
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://smath.com/wiki/SMath_with_Plugins.ashx
Offline Davide Carpi  
#18 Posted : 23 August 2013 00:03:14(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: mkraska Go to Quoted Post
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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 23/08/2013(UTC)
Offline mkraska  
#19 Posted : 23 August 2013 00:31:34(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: w3b5urf3r_reloaded Go to Quoted Post
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://smath.com/wiki/SMath_with_Plugins.ashx
Offline mkraska  
#20 Posted : 23 August 2013 10:42:17(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: uni Go to Quoted Post
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://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 23/08/2013(UTC)
Users browsing this topic
5 Pages123>»
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.