You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a (simple) way to save the simulation results to a *.csv or *.mat file? I couldn't find one.
I can create a DataFrame and save it myself, but it is very inconvenient. An API function would be very nice.
My Workaround
using FMI
using DataFrames
using CSV
outputVars = ["outputs[1]", "outputs[2]", "outputs[3]", "outputs[4]", "outputs[5]", "outputs[6]", "outputs[7]", "outputs[8]"]
result =fmiSimulate(fmu, 0.0, 10.0; recordValues=outputVars)
df =DataFrame(time = result.values.t)
for i in1:length(result.values.saveval[1])
df[!, Symbol(names[i])] = [val[i] for val in result.values.saveval]
end
CSV.write(resultFile, df)
The text was updated successfully, but these errors were encountered:
We could add this as weak dependency using Requires.jl.
There is already a command fmiSaveSolution, we could make a "dispatch" for file formats other than JLD2 (only if MAT.jl or CSV.jl is imported).
Feature Request
Is there a (simple) way to save the simulation results to a
*.csv
or*.mat
file? I couldn't find one.I can create a
DataFrame
and save it myself, but it is very inconvenient. An API function would be very nice.My Workaround
The text was updated successfully, but these errors were encountered: