Control layout time scope blocks programmatically

4 ビュー (過去 30 日間)
Emerson Nascimento
Emerson Nascimento 2019 年 10 月 25 日
回答済み: Khodour Al Kadry 2025 年 6 月 9 日
I'm trying to plot two signals in different layouts using a time scope, as we do when using subplot. I got to do it programmatically. I'm creating a time scope using dsp.TimeScope(). I've already tried to modify time scope properties using this and this links, but without sucess. I saw that there is a propertie which allows layout modifications in time scopes, it is LayoutDimensions. But a cant acess it.
So, I'd like to do someting like:
subplot(211)
scope(signal1)
subplot(212)
scope(signal2)
Could you help me please ?
Thank's in advance !

回答 (2 件)

Divyajyoti Nayak
Divyajyoti Nayak 2025 年 6 月 3 日
The 'LayoutDimensions' property can be programmatically accessed using the 'TimeScopeConfiguration' object which controls the appearance and behaviour of a scope block. This object can be accessed using the 'get_param' function:
blockPath = '<modelName>/Time Scope';
scopeConfig = get_param(blockPath,'ScopeConfiguration');
scopeConfig.LayoutDimensions = [2,1];
Here's the documention to the 'TimeScopeConfiguration' object for more properties:

Khodour Al Kadry
Khodour Al Kadry 2025 年 6 月 9 日
Hi Emerson
Here is a MATLAB example that shows how to use the LayoutDimensions property on timescope to achieve a similar behavior as subplot
ts = timescope(LayoutDimensions=[1 2]);
signal1 = randn(100,1);
signal2 = randn(100,2);
ts(signal1,signal2);
Hers is an example from the timescope documentation page as well
- Khodour

カテゴリ

Help Center および File ExchangeScopes and Data Logging についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by