How to plot x-axis in both Celsius and Kelvin?

조회 수: 8 (최근 30일)
Martin Privara
Martin Privara 2019년 5월 4일
댓글: Star Strider 2019년 5월 5일
Do you know a simple way how to plot y where axis at bottom is in Kelvin and axis at top is on Celsius?
y = [1 2 3 4 5 6 7 8 9 10]; % variable dependent on temperature
t = [10 20 30 40 50 60 70 80 90 100]; % temperature in degC
T = t + 273.15; % temperature in Kelvin
figure(1)
plot(t,y)
hold on
plot(T,y) % doesnt work so well
xlabel('Temperature, K')
xlabel('Temperature, degC')
I found this link but the example is a bit too compicated..
Thank you for help!
  댓글 수: 6
Martin Privara
Martin Privara 2019년 5월 5일
It works now! Let's see how it behaves with more lines..
Star Strider
Star Strider 2019년 5월 5일
Great!
The XLim call must be after the last line call. The arguments must be the minimum and maximum of all the independent variable vectors in all your line calls.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by