sensitivity analysis generate random integer values

1 回表示 (過去 30 日間)
Abdelmjid AITZIANE
Abdelmjid AITZIANE 2022 年 1 月 9 日
コメント済み: men8th 2022 年 12 月 23 日
In Simulink senstivity analysis module, to generate integer values with latin hypercube sampling method to performe a sensitivity analysis for a discrete model, the system generate a decimal values.How can I generate random integer values?
Thank you in advance
  2 件のコメント
men8th
men8th 2022 年 12 月 23 日
I have the same question. From what I can tell at the moment you cannot do this out of the box. A possible solution might be to generate real numbers then round to integers, but I'm not sure I want to add that logic to my model.
men8th
men8th 2022 年 12 月 23 日
Actually, there is this clue in the documentation "To use a variable of a numeric data type other than double, convert the variable to a Simulink.Parameter object, which separates a parameter value from its data type. Set the Value property to a default double number, and use the DataType property to control the data type."
So it looks like if assign a double to a parameter expecting an integer it will cast it to an integer?

サインインしてコメントする。

回答 (1 件)

Jon
Jon 2022 年 1 月 10 日
Sound like you are looking for the MATLAB randi function, you can get details by typing doc randi on the command line

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by