error in ds_simulate

18 views
Skip to first unread message

Gunjan Sharma

unread,
Mar 13, 2021, 9:57:11 AM3/13/21
to DynaSim Users
I installed dynasim from matlab addons option.
When I tried running dstutrial.m  ,I got error as :

"Error:File: dsSimulate.m Line: 812 Column: 64
Identifier 'sim_id' is not a function or a shared variable. To share 'sim_id' with nested function, initialize it in the current
scope"

I tried running some other examples like harmonicOscillator.m and got same error.

I am currently using matlab R2020b .
Please help me resolve this issue.

Thanks,
Gunjan

Erik Roberts

unread,
Mar 14, 2021, 9:15:19 PM3/14/21
to Gunjan Sharma, DynaSim Users
It looks like newer versions of Matlab have changed the way variable scope is handled. Jason updated the GitHub code a few days ago so it should now be fixed on the master branch:
https://github.com/DynaSim/DynaSim/commit/87cb1f5227f0fc2be13a4128d421b96d0f532f0d

Erik

--
You received this message because you are subscribed to the Google Groups "DynaSim Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynasim-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynasim-users/631469a4-b9a7-4c73-b813-47f69eea9d90n%40googlegroups.com.

Gunjan Sharma

unread,
Mar 15, 2021, 11:27:11 AM3/15/21
to DynaSim Users
Hello Eric,

Thank you for replying.

The error I had earlier got corrected ,however some other errors popped up. It seems that  the code is not compatible with matlab version r2020b.
I tried running the code on octave 5.1.0.0 and it worked fine.  So , from now I will be working  on the same .

Thanks
Gunjan

Jason Sherfey

unread,
Mar 15, 2021, 7:30:32 PM3/15/21
to Gunjan Sharma, DynaSim Users
Hi Gunjan,

Thanks for sharing the bug you found. Several additional changes have now been made to the development version of dynasim to make it compatible with newer versions of Matlab. I tested it using R2019b but do not have access to 2020b. Could you try running the "dev" version located here: https://github.com/DynaSim/DynaSim/tree/dev. If that works for you, I'll update the main version with the other changes.

Thanks,
Jason



Gunjan Sharma

unread,
Mar 16, 2021, 10:29:24 AM3/16/21
to DynaSim Users
Thank you Jason, the code is working now.
Reply all
Reply to author
Forward
0 new messages