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일

0 개 추천

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')

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2023년 8월 13일

답변:

2023년 8월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by