3 subplots of those three intervals in a horizontal line

15 ビュー (過去 30 日間)
Ryan Scott
Ryan Scott 2020 年 5 月 9 日
回答済み: Akihumi 2020 年 5 月 9 日
clear;
clc;
X = readtable('FinalProj_TVdata.csv');
Y = readtable('FinalProj_Pdata.csv');
%Convert from Fahrenheit to Kelvin
TempK = ((X{:,1}-32)*5/9)+273.15;
time = 1:300;
%Temperature vs time graph 1
figure(1)
plot(TempK,time);
title('Temperature vs Time')
xlabel('Temperature(Kelvin)')
ylabel('Time(days)')
%Defining symbols for different intervals
t1 = 1:100;
t2 = 101:200;
t3 = 201:300;
A = TempK(1:100);
B = TempK(101:200);
C = TempK(201:300);
%Graph 2 of intervals
figure(2)
plot(A,t1)
hold on
plot(B,t2)
plot(C,t3)
hold off
title('Temperature vs Time intervals')
xlabel('Temperature(Kelvin)')
ylabel('Time(days)')
legend({'y = t1','y = t2', 'y = t3'},'Location','northeast')
I am trying to graph the 3 sub intervals into a horizontal line. Can anyone please help me with that? Thank you!

回答 (1 件)

Akihumi
Akihumi 2020 年 5 月 9 日
Do you mean using something like subplot?
Eg:
figure
subplot(1,3,1)
plot(x,A)
subplot(1,3,2)
plot(x,B)
subplot(1,3,3)
plot(x,C)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by