-1

I am dealing with a problem with the interpolateTrajectory command of Dymola. I have been trying with a lot of possibilites to make the command run, but i always receive the same error "Failed to expand InterpolateTrajectory"

--First input, I tried to insert .mat file with the matrix created with the commends writeMatrix or writeTrajectory but neither of both works. -- Second input, I just add the .mat file matrix name {"data"} --Third input, I include the output of a readMatrix command or size command

I tried all the possibilities but i run out of ideas as i do not clearly understand the output of InterpolateTrajectory command.

Kind Regards

ichubi

I need to create a matrix and interpolate it. It has 10 rows and the other matrix has 15 rows and it is the output of a simulation

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
ichubi
  • 1

1 Answers1

1

The second argument to interpolateTrajectory is the name of the variables - not "data".

As a simple example:

writeTrajectory("dsres.mat",{"Time","a","b"},[0,0,1;1,1,1;2,4,1])
interpolateTrajectory("dsres.mat",{"a"},linspace(0,2,3))

returns

[0.0, 1.0, 4.0]

You can use readTrajectoryNames to get those names e.g.:

interpolateTrajectory("dsres.mat",readTrajectoryNames("dsres.mat"),linspace(0,2,3))
Hans Olsson
  • 11,123
  • 15
  • 38