simulink scope: adjust axis tick mark intervals (R2015b)
이전 댓글 표시
Hi, I must be something stupid. I seem to have silly spacings for the time in minutes on my scope, but I can't see any way to change it. For example, I would like tick marks at 0, 300, 600, 900, 1200...3000. What am I not seeing? Kind regards,

댓글 수: 2
Jason
2016년 3월 3일
If you change your TimeUnits to "none" or "seconds" you should see a more natural, round number for the ticks.
I have created an enhancement request for TimeUnits of minutes to use better tick values.
Jan
2025년 1월 30일
Did you get an update of your request?
It would also be nice if we could set the XTicks and YTicks, as in MATLAB. Sometimes it is nice to see a grid that corresponds to a sampling or quantization interval.
답변 (1개)
Anudeep Kumar
2025년 2월 5일
Hey, I was facing the same issue, and I found a workaround that worked well for me using the "To Workspace" block. This method allows you to export your data to MATLAB and take full advantage of MATLAB's plotting capabilities.
Here's how I did it:
First add a “To Workspace” block and connect the signal that is to be exported, configure the block to save data to MATLAB Workspace.
Then use the following MATLAB code to plot the data with custom tick settings:
% Assuming 'simout' is the logged signal from Simulink
time = simout.time;
data = simout.signals.values;
figure;
plot(time, data);
xticks(0:0.5:max(time)); % Set X ticks
yticks(-1:0.5:1); % Set Y ticks
xlabel('Time (s)');
ylabel('Signal');
title('Custom Plot with Specific Ticks');
I hope this helps!
댓글 수: 2
I did that already, but the simulation needs to be finished before that can run. However, I found a way to do it in the book [Modeling of Digital Communication Systems Using Simulink] by Giordano and Levesque.
They provided this code to add menu options to a scope window that gives all the control you have in MATLAB figures. It allowed me to make the modifications to the grids that I wanted. Just copy/paste it to the MATLAB command window after you've opened the scope window.
shh = get(0, 'ShowHiddenHandles');
set(0, 'ShowHiddenHandles', 'on');
set(gcf, 'MenuBar', 'Figure');
set(gcf, 'CloseRequestFcn', 'closereq');
set(gcf, 'DefaultLineClipping', 'Off');
set(0, 'ShowHiddenHandles', shh);

Anudeep Kumar
2025년 3월 14일
Hey @Jan
Thanks for sharing this workaround! worked for me as well.
카테고리
도움말 센터 및 File Exchange에서 Sources에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!