Matlab学习笔记6 - Jerry

本文记录了Matlab中的三个关键知识点:如何设置Plot的样式和保存为EPS格式,如何创建并保存视频,以及调整Matlab工作空间的背景颜色。通过实例展示了color_bar的使用,VideoWriter的视频生成过程,以及自定义颜色主题的方法。
摘要由CSDN通过智能技术生成


Matlab 知识点记录

1.Plot 设定与保存格式设置

color_bar5=[0.6,0.3,0.8]*0.93;
figure(1)
plot([1:iteration_time],J_list(1:end),'-','color',color_bar5,'LineWidth',1);
xlabel('Iteration')
ylabel('J Value')
xlim([0,iteration_time]);
ylim([7,10.5]);
title('J Value Plot')
fprintf('The final plots are printed.\n');
fig1 = figure(1);
saveas(fig1,'C:\Users\xxx\Desktop\fig1_J.eps','epsc')

2.Video 视频制作与保存

%Video Start
v=VideoWriter('s_t_3dVideo_dif_test.evi');
open(v);

x=T_list(1:interval:end);
for i=1:n_new_step
    y1=S_new_list(1,1:i);
    
    plot(x(1:i),y1,'color',color_bar1,'LineWidth',2);
    hold on
    
    title('Agent Position Plot');
    xlabel('Time(s)')
    ylabel('Position')

    xlim([0,x(end)]);
    ylim([0,7]);    
    
    %get frame
    frame = getframe(gcf);   
    writeVideo(v,frame);
end
close(v);

3.Matlab Color 背景颜色设置

First
Second

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值