plot single vector and plot matrix

8 次查看(过去 30 天)
TEE =[3 8 9 12 3 2]
TEE = 1×6
3 8 9 12 3 2
TEE1=[98 45 32 45 1 8]
TEE1 = 1×6
98 45 32 45 1 8
TEE2(1,:)=TEE;
TEE2(2,:)=TEE1;
figure
hold on
plot(TEE)
plot(TEE1)
hold off
figure
plot(TEE2)
but the result is different!
Unrecognized function or variable 'but'.
how can build matrix using single vector and plot it?

采纳的回答

Dyuman Joshi
Dyuman Joshi 2023-11-23
编辑:Dyuman Joshi 2023-11-23
To get the same result, transpose the array and then plot.
Refer to the documentation of plot to understand the behaviour of plot() w.r.t different inputs.
TEE =[3 8 9 12 3 2];
TEE1=[98 45 32 45 1 8];
TEE2(1,:)=TEE;
TEE2(2,:)=TEE1;
figure
hold on
plot(TEE)
plot(TEE1)
hold off
figure
%% Plot the transpose of the array
plot(TEE2.')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by