How to change each plot to individual titles?

1 Ansicht (letzte 30 Tage)
Meabh Cassidy
Meabh Cassidy am 2 Mär. 2021
Beantwortet: darova am 2 Mär. 2021
I've plotted 4 seperate plots using the code below, however I cant give them all indivdual titles? I can only name them the same title eg 'Acceleration Plots'
Can anyone tell me how to title them seperately?
Thanks
for i = 1:length(data_id)
subplot(6,1,i+1)
plot(dataStruct{data_id(i), 1}.data(:,1),dataStruct{data_id(i), 1}.data(:,4),'color',char(colours(i))),'constant';
fs = 128;
ylabel('Acceleration (g)');
xlabel('Time')
datetick('x','keeplimits');
axis tight
ylim([0.9,1.1])
title('Individual Acceleration Plot')
end

Antworten (1)

darova
darova am 2 Mär. 2021
Create cell array
str = {'plot1', 'plot2', 'myplot','graph'};
for i = 1:4
title(str{i})
end

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by