xticks not looping correctly?

2 ビュー (過去 30 日間)
Maria Y
Maria Y 2019 年 3 月 26 日
コメント済み: Walter Roberson 2019 年 3 月 26 日
Hello,
I've created a series of subplots but I'm running into an issue where each suplot's x axis ticks are off. So where subplot 2 should be 31-60, subplot 3 should be 61-90, etc. But instead it looks like this the screenshot I've attached.
Here is the code I've written:
figure;
RTkeys=(SRTT.RT(find(SRTT.Correct_Key==1)));
numRTkeys=1:numel(RTkeys);
x=length(RTkeys)/7;
plotNames={'1', '2', '3', '4', '5', '6', '7'};
sgtitle('Key 1 Reaction Times','fontsize',16,'fontweight','bold');
for k = 1:7
subplot(7,1,k);
plot(numRTkeys((1 + (k-1)*x):k*x), RTkeys((1 + (k-1)*x):k*x), '-o');
title(sprintf('Block %s', plotNames{k}))
xlabel('Key Occurance');
ylabel('Reaction Time');
end
I assume it has to do with the line:
plot(numRTkeys((1 + (k-1)*x):k*x), RTkeys((1 + (k-1)*x):k*x), '-o');
Does anyone have any ideas?
Thank you in advance!

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by