Why I am not getting sample time in the discrete transfer function block.

Hi
I am wokin on the transfer fuction block to model the dyamic syatem of the aircraft. But durin the modeling i have noticed that there is no sample time space to enter the value.
How can I enter the sample time in the discrete transfer fucntion block.

3 commentaires

Type this on the command window to solve the problem
set_param(gcb, "SampleTime", "Ts")
thank you @Abdulhakeem it was a great soution!!

Connectez-vous pour commenter.

Réponses (4)

It seems that the option has been obscured in new releases (I'm using 2023b and I have the same issue).
I was able to solve the issue by going to Model Explorer then selecting "Show Details" while the "Discrete Transfer Fcn" is selected.
This then prompts you with a set of properties from which you can search "SampleTime" and select the blue arrow to add it to the block's properties.
Once added, you can hide the details and set the "SampleTime" to "Ts" or whatever value you want.
You can then double-click on the Discrete Transfer Fcn block and check that the parameter is there.
I hope this helps.
Paul
Paul le 14 Oct 2023
Modifié(e) : Paul le 14 Oct 2023
Hi Gokula,
The Discrete Transfer Fcn block is one of the Blocks for Which [Setting] Sample Time Is Not Recommended. Instead, Simulink prefers this block to inherit its sample time from the input signal.
From the linked doc pages, it sounds like if you intentionally change the sample time from inherited (-1), using set_param (or maybe Model Explorer), the Sample Time parameter will then become visible in the Block Parameters dialog. But, again, it's recommended to leave it at -1, which is the default.
It seems like this change in the Block Parmeters Sample Time visibility is a relatively new development. I see the Sample Time parameter in R2022a.

6 commentaires

The built in simulink training request to set the sample time directly, and does not accept default setting.
I have the same problem, in Simulink Fundamentals self-paced course there is a task to change the sample time of Discrete Transfer Function Block. Neither set_param function nor the model explorer method works. And this causes that course cannot be completed.
Suggest contacting TMW directly on this if the documented set_param method doesn't work.
I'm working through the Simulink Fundmentals Self-Paced Training and I am blocked from moving forward due to this conflict. The training is instructing to set the Sample Time of the Discrete Transfer Fcn block, but now that this block doesn't have it, this module cannot be completed.
I'm using the online portal as some of the onramp trainings show up on my Simulink Start Page and others don't. I've had what is available under Learn change.
It appears in other library blocks, too. Here is the Discrete Filter:
As indicated above, it seems like the online training is out of sync with a change to Simulink that occurred sometime after R2022a.
If there is a problem with the online training you'll get more traction on a solution by contacting TMW directly rather than posting here, though posting here for informational purposes makes sense.
I don't know if that's a normal Tech Support request or if the online training has its own support. If you submit a normal Tech Support request I'm sure they'll point you in the right direction if they don't deal with the online training.

Connectez-vous pour commenter.

Pablo
Pablo le 10 Mai 2024
It's been very useful the data provided but every time I have to add a new block of discrete transfer function it goes away and it doesn't ask the sample time. Do you know any way of making it permanent?
Thank you so much for your support

Catégories

En savoir plus sur Simulink dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by