0

I have to write a Level-2 S-Function in Matlab code (C is not viable) which takes in some parameters and uses them alone and in combination.

First I tried tunable parameters, but unfortunately I haven't succeded in tuning them (the documentation doesn't tell how to set_param for this purpose).

Then I have bumped into documentation of Run-Time parameters that says

The value of a run-time parameter that corresponds to multiple dialog parameters is typically a function of the values of the dialog parameters.

So I deduced that a runtime parameter would suit well, but the same documentation doesn't say how to tune and access them from a Matlab S-function, only from a C one.
Also, in in this page is documented a RuntimePrm object that seems similar to DialogPrm, but trying to write the values result in an error.

Is there any way to "cache" parameter combinations without using DWorks, which would affect subsequent linearization with fake states?

Astrinus
  • 412
  • 9
  • 19
  • Have you looked at the demo sldemo_msfcn_lms which uses run-time param from level-2 MATLAB s-function? – Navan Mar 19 '15 at 16:09
  • Yes but the changes come from outside the S-function in that simulation, not from inside. – Astrinus Mar 19 '15 at 16:14
  • 1
    You should be able to write to Data property of RuntimePrm object. You cannot change data type or size. They should remain as the registered type of run-time param. You also normally do not tune external dialog params from within s-function. – Navan Mar 19 '15 at 18:25
  • Thanks. I had tried it but used not to be working. Now it works. – Astrinus Mar 20 '15 at 08:47

0 Answers0