Table Generator - running/recording an SMath sheet multiple times - Messages
I need the ability to change the “input” variables in an SMath sheet, and then grab/record the “output” variables, and then do that again and again and again. I’m essentially trying to create a generator for my “outputs” for potentially hundreds of pre-selected “input” combinations, using the calculations of an SMath sheet, to save time mostly.
I have created this ability in Excel, using its VBA, and am hopeful that this is somehow possible for SMath sheets.
I have also managed to successfully create the "combin" plugin with VB, so I am at least familiar with if that's a route I would need.
Please let me know if I need to clarify anything.
WrotePlease let me know if I need to clarify anything.
Would love to help, but unsure of your initial goal - please elaborate on procedure.
Something tells me you could benefit from using spreadsheet interaction here, but again - not quite sure what would you like to do
WroteOnce the data is in Smath, you can create formulas in a loop, with each data set being processed in each loop. Then export to excel or csv file.
I have SMath sheets that run a bunch of calculations to come up with outputs at the end. Each sheet is essentially one big tool for getting these values at the end (to avoid doing it all by hand every time). What my goal would be is to run the entire sheet for those outputs with each data set of inputs. Are you saying that I can place a loop somewhere in the sheet to have the entire sheet run with each input data set while also collecting the outputs of each loop cycle? I ask because it is my understanding that SMath runs a sheet "in order", so placing a loop anywhere on the sheet meant to run the rest of the sheet a number of times would be exactly what i am looking for (hopefully not having to enclose the entire sheet in that loop).
Wrote
Would love to help, but unsure of your initial goal - please elaborate on procedure.
Something tells me you could benefit from using spreadsheet interaction here, but again - not quite sure what would you like to do
Hopefully my response to the above clears a bit.
Spreadsheet Interaction? It sounds promising. Can you point me to where I can read up on that? Unless you mean outright just working with a spreadsheet alongside SMath. I think that may be actually the way I would go.

WroteThank you for the responses. Please bare with me if you'd still like to help, I'm having trouble explaining what I'm wanting.
WroteOnce the data is in Smath, you can create formulas in a loop, with each data set being processed in each loop. Then export to excel or csv file.
I have SMath sheets that run a bunch of calculations to come up with outputs at the end. Each sheet is essentially one big tool for getting these values at the end (to avoid doing it all by hand every time). What my goal would be is to run the entire sheet for those outputs with each data set of inputs. Are you saying that I can place a loop somewhere in the sheet to have the entire sheet run with each input data set while also collecting the outputs of each loop cycle? I ask because it is my understanding that SMath runs a sheet "in order", so placing a loop anywhere on the sheet meant to run the rest of the sheet a number of times would be exactly what i am looking for (hopefully not having to enclose the entire sheet in that loop).Wrote
Would love to help, but unsure of your initial goal - please elaborate on procedure.
Something tells me you could benefit from using spreadsheet interaction here, but again - not quite sure what would you like to do
Hopefully my response to the above clears a bit.
Spreadsheet Interaction? It sounds promising. Can you point me to where I can read up on that? Unless you mean outright just working with a spreadsheet alongside SMath. I think that may be actually the way I would go.
From the sounds of it I have done, at some point, exactly what you would like to do. I will get back to you when I am off work. Btw where are you from? When I read "under the rock" first thing that comes to mind is rocky mountain house haha
WroteFrom the sounds of it I have done, at some point, exactly what you would like to do. I will get back to you when I am off work. Btw where are you from? When I read "under the rock" first thing that comes to mind is rocky mountain house haha
Haha, no unfortunately not, though I'm actually from Edmonton, so it's very close. I'm simply from under a rock because there are a lot of things I don't know.
Thank you very much for offering your help. I look forward to your response. (:
WroteWroteFrom the sounds of it I have done, at some point, exactly what you would like to do. I will get back to you when I am off work. Btw where are you from? When I read "under the rock" first thing that comes to mind is rocky mountain house haha
Haha, no unfortunately not, though I'm actually from Edmonton, so it's very close. I'm simply from under a rock because there are a lot of things I don't know.
Thank you very much for offering your help. I look forward to your response. (:
Kemili,
Attached is a file that should help you with your task.
1st part of the .sm workbook goes over creation of the function based on a sample procedure. Function will take input and provide output.
2nd pat of the worksheet will write the resulting output to an excel file.
If you do not have EXCEL installed you will need to use XLSX Import/Export plugin instead of EXCEL I/O. The benefit of using XLSX Import/Export is that it does not require MS EXCEL software; one of the drawbacks is that it does not let you to add data to existing EXCEL worksheet and overwrites it completely instead.
P.S.: Small world - it just happened that I live in Edmonton as well. If at some point you will get a long list of burning questions related to SMath Studio I would not refuse to meet for a cup of coffee ;-)
File not found.File not found.
WroteCan I get a point in the right direction, because Iâm lost and a bit overwhelmed with the tons of info that is the internet.
I need the ability to change the âinputâ variables in an SMath sheet, and then grab/record the âoutputâ variables, and then do that again and again and again. Iâm essentially trying to create a generator for my âoutputsâ for potentially hundreds of pre-selected âinputâ combinations, using the calculations of an SMath sheet, to save time mostly.
That does not induce my understanding, No example.
If you collect data calculated in Smath, then stay in Smath,
that's why an example is necessary.
Jean
Wrote
That does not induce my understanding, No example.
If you collect data calculated in Smath, then stay in Smath,
that's why an example is necessary.
I am somewhat new to SMath (I've been aware of it for a couple years now, but only just started tinkering in it) and have not the capability at this time to produce an example. ): I'm still trying to wrap my head around a bunch of things about this program. And I do apologize, your earlier post had me more confused than before, but I know once I learn more I will go back to it. (:
Alex,
Thank you for your files. I'm currently deciphering them, and learning more! Once I get either really stuck or if I am able to reach my goal, I will post again. (:
:d
WroteI'm currently deciphering them, and learning more! Once I get either really stuck or if I am able to reach my goal, I will post again. (:
:d
When in doubt, copy/paste to notepad! This is how I learned alot of Smath syntax from existing examples
I now understand functions, importing/exporting data to excel, and the include plugin.
Though I believe I could technically use these to do what I need, it would require severe rewriting of the long (20+ unhidden pages each) SMath sheets I have, that currently double as a "user's guide" to see/evaluate the flow of how/what is being calculated (so it has kindof a display format, instead of "code" ).
That aside as a project in of itself, I am searching for a quicker solution that may let me use my current SMath sheets as they are, or with minimal editing.
With that, I am seeking a way to use an SMath sheet as a function itself - where I can insert a large matrix of input sets obtained from an excel/text file, and I would get a result matrix of associated outputs exported into another excel/text file.
There is a "Script Region" plugin on this site that allows insertion of script in cpp/VB/Python, to which I've managed to at least set up, and have figured out one or two things about it. Can this work to change the values of select-variables on the sheet, and recalculate said sheet in multiple iterations? While also recording the resulting values due to the changes, on each run?
Please and thank you,
QuoteCan this work to change the values of select-variables on the sheet, and recalculate said sheet in multiple iterations?
Isn't this the data you would be importing from excel? It's difficult to give more specific answers without an example.
Alrighty, I've managed to pull together an example of what I'm looking for.
It uses the "Script Region" plugin. My questions are in that script region.
But if this plugin doesn't have the ability to do what I'd like, I wonder if simply going through my questions will spark an idea of another way to do what I want? Or if someone knows in which direction I should go? (:
Please and thank you, :d
use each set(row) of inputs from this matrix without converting the entire sheet
into a function"
Where is "Under a rock" ? Ah ! that's where your matrix is.
Something weird. Could it be that you have to just read from file, from foreign file
than Smath itself. As it looks importData.XLSX is just an instruction where to find
outside of Smath. You may need an instruction to "read" and have it in hand in Smath
myArray:=rfile(importData.XLSX("C:\SMath Testing\inputs.xlsx","Sheet1","A3","B11"))
Not too expensive to try
Within Smath itself works so nice
CWD:=CurrentDirectory("C:\SmathFile")
wfile(p,CWD,"Bézier")
rData:=rfile(CWD,"Bézier")
As a byside question, did you create the Excel data table form a math function?
Is it an import from JoBlo ? or from some Excel archive older than your Smath ?
In the worst case, you can copy the Excel table in "BLOC" into NotePad and paste
individually each NotePad entry into the Smath image matrix. Can't help more,
I didn't touch Excel since 2000, when I got Mathcad 8.
Jean
I tried every possible torture, not to avail.
I think it is a non confessed bug .
Cheers, Jean.
I meant that the sheet isn't using the matrix. I've already gotten the matrix imported just fine into the sheet. The sheet works fine also, but I need a way to programmatically run the sheet for the outputs for every set of inputs.
"As a byside question, did you create the Excel data table form a math function?"
-I just created the Excel file by hand.
"In the worst case, you can copy the Excel table in "BLOC" into NotePad and paste
individually each NotePad entry into the Smath image matrix."
-Sorry, I don't know what BLOC is, or what you mean with this. But it seems like this is still help for importing a matrix?
Fill any empty cell with 0 to get square/rectangular all valued array.
"copy in bloc" => select all cells in Excel ... copy, paste in NotePad.
Can't see why Smath does not read my test Excel ?
Transit cell by cell via NotePad is dark age technique.
Cheers [Edmonton], Jean.
I'm not really sure why your SMath doesnt read my Excel files either, but I had added a matrix in case import from excel didn't work, because that isn't my focus. Can you not open the excel at all? This is what it looks like.
File not found.File not found.
I believe I performed what you intended. Files need to be in the same directory.
Let me know if this is what you needed.
inputs.xlsx (7 KiB) downloaded 47 time(s).
example.sm (16 KiB) downloaded 78 time(s).
-
New Posts
-
No New Posts