필터 지우기
필터 지우기

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 CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by