Filter löschen
Filter löschen

How to use tiledlayout in Matlab 2018a ?

10 Ansichten (letzte 30 Tage)
M
M am 24 Mär. 2023
Kommentiert: Adam Danz am 24 Mär. 2023
How to use tiledlayout in Matlab 2018a ?
I want to run the following code in 2018a but I got
Undefined function or variable 'tiledlayout
is there any alternative?
figure
tiledlayout(size(A,2),3)
for k = 1:size(A,2)
nexttile
plot(t, A(:,k))
grid
ylabel('Acceleration')
xlabel('Time')
title("Column "+k)
nexttile
plot(t, V(:,k))
grid
ylabel('Velocity')
xlabel('Time')
nexttile
plot(t, D(:,k))
grid
ylabel('Displacement')
xlabel('Time')
end

Antworten (1)

Simon Chan
Simon Chan am 24 Mär. 2023
Verschoben: DGM am 24 Mär. 2023
This function was introduced from v2019b. You may consider to use function subplot
  1 Kommentar
Adam Danz
Adam Danz am 24 Mär. 2023
Getting the indexing right for subplot might be tricky. Heres a template based on your demo code in the question.
figure
A = rand(1,5);
n = size(A,2);
for k = 1:n
subplot(n,3,3*k-2)
plot(___)...
subplot(n,3,3*k-1)
plot(___)...
subplot(n,3,3*k)
plot(___)...
end

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by