How can I change LineWidth of all lines in a printed figure from Simulink?
조회 수: 62 (최근 30일)
이전 댓글 표시
Hello, since the simplot-command isn't working in Matlab 2015 anymore, i tried to manually manipulate a plotted figure of a scope window after the simulation plotted it.
I am trying to find all lines and change the LineWidth and Color, see the attached m-file Image_Maxon_REmax29_ClosedLoop_2015.m
Also I am trying to adjust the inner border space of the image, so that the main title and axis titles can be read. Please see the attached image-file actual. My goal is to have an image like desired.
Can you help me please, to give me some tips?
Thanks in advance and with nice greetings, Lars
댓글 수: 0
답변 (1개)
Sebastian Castro
2015년 5월 22일
The documentation refers to simplot as being replaced with Simulink.sdi.view, which brings up the new Simulation Data Inspector which came out in R2014b:
Is this something you can use? If not, do you have a way of saving the figure as a MATLAB .fig file? Because that would be another way to make this much easier than an image processing problem.
- Sebastian
댓글 수: 2
Sebastian Castro
2015년 5월 22일
Well, if you had a .fig file it would be ideal because MATLAB figures are easy to modify programmatically... scopes, not so much.
For instance, if you have a figure file, you can just do the following... although I see that you do this in your attached script anyway.
open('untitled.fig')
lines = findobj(gcf,'Type','Line');
for i = 1:numel(lines)
lines(i).LineWidth = 2.0;
end
One thing you can do with scopes in R2015a is to select the "Try Time Scope" button, which is the last button in the Scope's toolbar. If you do that, you see that it will change the type of scope. Once you do that, there is a "File > Print to Figure" option which will get you a figure out of the plot.
Once you have this figure, you can then run the above code on it.
How's this all sound?
- Sebastian
참고 항목
카테고리
Help Center 및 File Exchange에서 View and Analyze Simulation Results에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!