Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,990 Was thanked: 1128 time(s) in 724 post(s)
|
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 |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
PLUGIN UPDATED- fixed issue of sys2mat() involving sys() special features (many thanks to
mkraska
) best regards, w3b5urf3r |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,990 Was thanked: 1128 time(s) in 724 post(s)
|
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. mkraska attached the following image(s): |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
Originally Posted by: mkraska 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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
PLUGIN UPDATED- mat2sys() now can handle also non-column matrices (nested or not) - sys2mat() symbolical enhancements regards, w3b5urf3r Edited by user 20 February 2013 20:04:23(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
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 Edited by user 15 March 2013 14:12:48(UTC)
| Reason: Not specified Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
3 users thanked Davide Carpi for this useful post.
|
on 15/03/2013(UTC), on 16/03/2013(UTC), on 16/03/2013(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,990 Was thanked: 1128 time(s) in 724 post(s)
|
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 File Attachment(s): mkraska attached the following image(s): |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
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 File Attachment(s): bug.sm (7kb) downloaded 52 time(s). Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 18/05/2011(UTC) Posts: 36
Was thanked: 3 time(s) in 3 post(s)
|
Great job websurfer! Would it be possible to change mat2sys such that it doesn't collapse nested matrices? Please see attached Edited by user 16 April 2013 18:34:00(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,990 Was thanked: 1128 time(s) in 724 post(s)
|
Originally Posted by: sublim21 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: sys(sys(1,2,2,1),3,2,1)=sys(1,2,3,3,1)mat2sys could, however, have an option to restrict the conversion to the outer level matrix and leave all entries as they are. |
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 18/05/2011(UTC) Posts: 36
Was thanked: 3 time(s) in 3 post(s)
|
mkraska, you're right. sys2mat was a typo. Thanks!
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
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 Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,990 Was thanked: 1128 time(s) in 724 post(s)
|
|
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
A Nightly update for anyone are using SMath Studio 0.96.4902 (plugins -> online gallery) - removed norme clone (not needed anymore) - added not recursive mat2sys.1(#)- added not recursive sys2mat.1(#)best regards, w3b5urf3r File Attachment(s): Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,990 Was thanked: 1128 time(s) in 724 post(s)
|
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. mkraska attached the following image(s): |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
UPDATED- new function: InterpBilinear() - new function: GetType() - mat2sys() improvements for 1x1 matrices (examples attached in the first post) Edited by user 01 March 2014 19:29:37(UTC)
| Reason: Not specified Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
2 users thanked Davide Carpi for this useful post.
|
on 01/03/2014(UTC), on 02/03/2014(UTC)
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
PLUGIN UPDATED- added strsplit("string","delimiter" ) Best regards, Davide Edited by user 23 June 2014 01:46:02(UTC)
| Reason: Not specified Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,495 Was thanked: 1275 time(s) in 746 post(s)
|
|
Russia ☭ forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
Thank you Viacheslav Done: added strjoin(2) Best regards, Davide Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
2 users thanked Davide Carpi for this useful post.
|
on 23/06/2014(UTC), on 23/06/2014(UTC)
|
|
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.