Custom Component input: physical signal

1 回表示 (過去 30 日間)
smaru
smaru 2015 年 10 月 27 日
コメント済み: Sebastian Castro 2015 年 11 月 10 日
Hi, I'm going from a Ideal Translational Motion Sensor into a Custom Component. So I deliver for example the velocity of a piston into my block. In the Custom Component I want to build a graph where the resistance is on the y-axis and the velocity is on the x-axis. My problem is, that I don't know how the velocity is delivered. How can I access the values and how can I create the nonlinear graph? I would be thankful for any help!

採用された回答

Sebastian Castro
Sebastian Castro 2015 年 10 月 27 日
I'd suggest enabling Simscape data logging and then using the simscape.logging.plotxy function to plot the signals of interest in a MATLAB figure.
- Sebastian
  2 件のコメント
smaru
smaru 2015 年 11 月 10 日
Perfect! Thank you! Do you know how I can change the color line of the plotxy from the default blue into black? A simply 'k' at the end of the plotxy(...,'k') doesn't work..
Sebastian Castro
Sebastian Castro 2015 年 11 月 10 日
Somehow there is no easy way to do it without going into the graphics objects themselves:
h = plotxy(INP1,INP2) % Whatever you plotted
ax = h{1}.Children
line = ax.Children
line.Color = 'k'
The other alternative is just to extract the numeric data from the simlog variable and plot from there:
xdata = INP1.series.values;
ydata = INP2.series.values;
plot(xdata,ydata,'k');
... but then you have to add your own titles, labels, etc. It's a tradeoff.
- Sebastian

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFoundation and Custom Domains についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by