Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Extract simulation-results and write to new file using OMShell

Extract simulation-results and write to new file using OMShell

After running simulation with resultfile "mySim_res.mat", how can I extract certain variables/parameters from that file and then write these to a csv file ?
I tried

filterSimulationResults("mySim_res.mat", "myCSV.csv", "x")



but get no output, neither true or false...

BTW, I use Windows 10, and the simulation is carried out using the OMShell - simulate-command


EDIT #1
I found that you can extract data from your simulation using "readSimulationResult". E.g.

simData := readSimulationResult("filename.mat", {var1, ..., varN})


and then write values to a csv file using

writeFile("filename.csv", simData)


where the "simData" must be a string with proper format...

Edited by: C1Ron - Jul-10-19 18:12:44
There are 0 guests and 0 other users also viewing this topic
You are here: