Expand a certain range on x axis

7 ビュー (過去 30 日間)
VICTOR COELLO ELOI
VICTOR COELLO ELOI 2023 年 8 月 13 日
回答済み: Sam Chak 2023 年 8 月 13 日
Hello,
How can I expand a certain range on the x axis to show how the function changes in that particular range?. I have a function that varies rapidly in a very short window of time but remains constant on considerably longer one, making the function very narrow in the first range. The graph below is similar to what I want to reproduce.
The compression and expansion times are of the order of 10ms, and holding times are 10 to 20 seconds. Still, one can see clearly how the volume changes. This graph, for reference, is from "Multi compression–expansion process for chemical energy conversion: Transformation of methane to unsaturated hydrocarbons and hydrogen".
Any help is appreciated.
  1 件のコメント
dpb
dpb 2023 年 8 月 13 日
編集済み: dpb 2023 年 8 月 13 日
So, does the above actually have a real time axis or is it just a representation without actual times (which appears to be if it is representative of the above description)?
Unfortunately, all the Instrumentation TB rectangular pulse functions mysteriously neglected to include a risetime argument so you have to build your own...but the rectpuls function illustrates replicating a custom waveform that does the easier part.

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

回答 (1 件)

Sam Chak
Sam Chak 2023 年 8 月 13 日
Not sure if this is what you want. Perhaps you can try using xlim() to set the x-axis limits to range from 0 to 0.5 s in this example
t = linspace(0, 9, 121);
T = -0.85;
V = @(t, T) (sign(t - T) - sign(t - T-1) + sign(t - T-3) - sign(t - T-4) + sign(t - T-6) - sign(t - T-7) + sign(t - T-9) - sign(t - T-10))/2;
subplot(211)
plot(t, V(t, T), 'linewidth', 1.5),
xlim([0 9]), ylim([0 1.5]), grid on
xlabel('t'), ylabel('V')
subplot(212)
plot(t, V(t, T), 'linewidth', 1.5),
title('Zooming in on the Time scale')
xlim([0 0.5]), ylim([0 1.5]), grid on
xlabel('t'), ylabel('V')

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by