3 subplots of those three intervals in a horizontal line
18 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(1 个)
Akihumi
2020-5-9
Eg:
figure
subplot(1,3,1)
plot(x,A)
subplot(1,3,2)
plot(x,B)
subplot(1,3,3)
plot(x,C)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!