フィルターのクリア

Simulink Realtime - is it possible to change parameter dimensions?

5 ビュー (過去 30 日間)
Sandra
Sandra 2022 年 6 月 9 日
回答済み: Dimitri MANKOV 2022 年 6 月 10 日
I have a realtime model that is using Look-up Tables, when the model is loaded on the target (SpeedGoat) I want to change the Breakpoints & Table using setparam command from a Matlab App.
This works OK if I use a new parameter of the same size, but if I want to reduce/extend the number of points, I get an error:
>> setparam(tg,'','miX_pos_vehNotchBP2_km',ones(1,16))
Error using slrealtime.Target/throwErrorWithCause
Cannot set 'miX_pos_vehNotchBP2_km' parameter value on target 'Speedgoat': Actual dimensions are '1 16',
expected dimensions are '1 17'.
I also tried feeding the parameters into the Lookup Table (using 'Input Port' rather than 'Dialog') but get the same error.
So my question is - is there anyway I changing the parameter dimensions when the model is loaded on the target? or do I need to used 'resample' to resize my new parameter?

回答 (1 件)

Dimitri MANKOV
Dimitri MANKOV 2022 年 6 月 10 日
Hi Sandra,
I don't think this is possible: once the code is generated, the dimensions are fixed as far as I know. But you could indeed use the resample function, or have several lookup tables of different dimentsions in your model, and then switch between them using a Multiport Switch block, for example.
I hope this is helpful!

カテゴリ

Help Center および File ExchangeTarget Computer Setup についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by