String to Variable Name (str2var) - Messages
WroteIs there a function or method that would allow a string (or variable name) located in a matrix element to be used as the name to define a variable?
You can also use the Assign() function of the Maxima Plugin (this should work even without Maxima installed).
It converts boolean equations into assignments.
In the case of strings you still need to apply str2num()
Assign.sm (4 KiB) downloaded 27 time(s).
Assign odd behaviour.sm (3 KiB) downloaded 12 time(s).
Any thoughts?
I'm hoping to be able to assign multiple variables from a matrix like this:
Assign For Loop Broken.sm (5 KiB) downloaded 20 time(s).

I think the assign command is not evaluated immediately, but has a delayed evaluation, which somehow only takes place after using the "=" symbol.
WroteYou can also use the Assign() function of the Maxima Plugin (this should work even without Maxima installed).
Assign() is a useful function and it doesn't need Maxima as you have indicated.
I don't (can't) use Maxima but I need Assign() sometimes.
And its codes have zero relation with Maxima functions.
This is why I suggested sometime ago that it could have relocated in another collective plugin.
CustomFunctions plugin is a good candidate for this purpose.
But I am not persistence, it is what it is.
Author of these plugins choose it this way.
Regards
WroteSome odd behavior here. When the "=" evaluation is removed the Assign() function breaks:
Assign odd behaviour.sm (3 KiB) downloaded 12 time(s).
Any thoughts?
I'm hoping to be able to assign multiple variables from a matrix like this:
Assign For Loop Broken.sm (5 KiB) downloaded 20 time(s).
Two hints:
- The Assign function needs to be executed in order to do it's work, either by assigning the result to some dummy variable or by requesting display of the result.
- You don't need a loop, Assign() can handle vector arguments
Blatt10.sm (5 KiB) downloaded 19 time(s).
WroteWroteYou can also use the Assign() function of the Maxima Plugin (this should work even without Maxima installed).
Assign() is a useful function and it doesn't need Maxima as you have indicated.
I don't (can't) use Maxima but I need Assign() sometimes.
And its codes have zero relation with Maxima functions.
This is why I suggested sometime ago that it could have relocated in another collective plugin.
CustomFunctions plugin is a good candidate for this purpose.
But I am not persistence, it is what it is.
Author of these plugins choose it this way.
Regards
In general I don't care where Assign() is defined. It is in the Maxima plugin, because I needed a neat way to make use of results from Maxima functions like algebraic or ode solvers.
Yet I don't think that it would be a good idea to remove functions from plugins, because this would break the dependency management of existing sheets.
I don't know what happens if the same function is defined in multiple plugins. Would SMath crash? If not, which definition is used if both plugins are installed? One would see this in the dynamic help, but how to control?
BTW, I think that some day I'll revisit the Maxima plugin and if I get some help with a linux development tool chain and work flow I could perhaps make the plugin work also under linux. But that would require at least two months of full time work without distractions, because I would need to learn C# anew from scratch.
If someone is a master in C# I am happy to assist in refactoring and bug fixing of the plugin by providing the specifications and unit tests.
I'd be more comfortable with python or javascript but to my knowledge these aren't options for making plugins.
I have a folder on my computer exclusively for the spreadsheets you share.
https://en.smath.com/forum/yaf_postst23228_Assign-Description-to-Variable.aspx
It's a work around, but potentially useful.
Wrote@Razonar, as usual with you, you give imaginative and useful solutions, it's great when people share their knowledge and help others, and with such a high technical level. thanks and congratulations.
I have a folder on my computer exclusively for the spreadsheets you share.
Yes indeed. Likewise. What churichuro said!
Best regards.
Alvaro.
-
New Posts
-
No New Posts