How can I title my bar graph in x-axis?
古いコメントを表示
Hey,
As you know the default for x-axis in the Bar graph is just numbers. Could you please give me a hint how I can replace them by names? e.g. I would like to have a bar graph with the names of months (Jan, Feb, Mar, ...)in the x-axis.
Thank you,
Mehdi
1 件のコメント
Bharathi
2026 年 1 月 22 日
t generate 1000 zeroes
採用された回答
その他の回答 (3 件)
Grzegorz Knor
2011 年 9 月 30 日
bar(1:12)
set(gca,'xticklabel',{'a','b','c','d','e','f','g','h','i','j','k','l'})
Ckenne
2026 年 5 月 4 日
0 投票
dt = 0.01; % Time step for numerical approximation
tx = 0 : dt : 10;
th = 3 : dt : 12;
x = cos(pi * tx / 2);
h = sin(pi * th);
% Perform convolution and scale by dt
y = conv(x, h) * dt;
% Generate the time axis for the output
ty = tx(1) + th(1) : dt : tx(end) + th(end);
% Plotting
figure;
subplot(3,1,1); plot(tx, x); title('x(t)'); grid on;
subplot(3,1,2); plot(th, h); title('h(t)'); grid on;
subplot(3,1,3); plot(ty, y); title('Convolution y(t) = x(t) * h(t)');
xlabel('Time (t)'); ylabel('y(t)'); grid on;
カテゴリ
ヘルプ センター および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!