matlab报java超内存问题
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
删除如下文件
C:\Users\weiyo\AppData\Roaming\MathWorks\MATLAB\R2017a\matlab.prf
```<!--autointro-->
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
删除如下文件
C:\Users\weiyo\AppData\Roaming\MathWorks\MATLAB\R2017a\matlab.prf
```<!--autointro-->
https://www.pythonpool.com/convert-matlab-to-python/
https://github.com/ebranlard/matlab2python
python日志loging
https://juejin.cn/post/6966998948531666981
python conda安装第三方包时提示
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
解决办法时新建一个虚拟环境再安装。
230224转换了一下试试,
加载个人及系统配置文件用了 1532 毫秒。
(base) PS C:\Users\weiyo<!--autointro-->
安装matlab插件
设置mlint.exe地址,用于语法检查的程序
C:\Program Files\MATLAB\R2017a\bin\win64\mlint.exe
扩展名 功能
Matlab 代码高亮、代码补全(此功能效果不佳,部分代码无法自动补全)、实时语法检查
Matlab Interactive Terminal 在Vscode的终端中运行m文件与Matlab命令行
Matlab Snippets 代码补全(对插件Matlab代码补全功能的补充)
matlab-formatter 代码格式化
装matlab时遇到的一个问题,记录一下解决方法,供各位参考一下。
系统:win10
版本:matlab 2017a
安装问题:弹出dvd1装入dvd2继续。载入dvd2光驱后,依然有这个提示。
原因:dvd1虚拟光驱和dvd2虚拟光驱驱动器号不一致。
操作步骤: 1. 弹出dvd1虚拟光驱, 载入dvd2虚拟光驱
2. 在磁盘管理器中更改驱动器号。操作如图,在(1)处右键,选择(2)处,接下来就是更改驱动器号,驱动器号需要和载入dvd1时的驱动器号一致。
————————————————
221124
redmibook
**您的安装可能需要执行其他配置步骤。**
1。以下产品需要安装[支持的编译器](http://www.mathworks.com/pi_scl_1_R2017a_win64):
Simulink Coder 8.12
Simulink Real-Time 6.6
MATLAB Coder 3.3
2。此安装完成后,应按照从 [www.mathworks.com/distconfig](http://www.mathworks.com/pi_dc_pi_R2017a) 获取的说明中所述继续配置 MATLAB Distributed Computing Server。
3。MATLAB Compiler 6.4 要求安装[支持的编译器](http://www.mathworks.com/pi_scl_4_R2017a_win64)以创建 Excel 加载项
4。MATLAB Compiler SDK 6.3.1 要求安装以下程序:
● [.NET Framework](http://www.mathworks.com/pi_scl_5_R2017a_win64),用于创建与 Excel 集成的 .NET 程序集和可部署的存档
● [支持的编译器](http://www.mathworks.com/pi_scl_5_R2017a_win64),用于创建 COM 组件、C 和 C++ 共享库
● [Java JDK](http://www.mathworks.com/pi_scl_5_R2017a_win64),用于创建 Java 包
```<!--autointro-->
230729
今天打算buildsimulink模型提示没有相关许可证
Unable to check out the MATLAB Coder license which is needed to generate code
按照如下方法安装就可以了。
10、软件激活。
①打开破解文件夹,将license_standalone.lic 复制到安装路径下 ……\MATLAB\R2017a\licenses\中。
②将netapi32.dll 复制到安装路径下 MATLAB\R2017a\bin\win64\中。
③语言设置方法 Preference→General→Chinese,Apply后重启。
```<!--autointro-->
matlab复制图形到剪贴板
https://ww2.mathworks.cn/help/matlab/ref/copygraphics.html
在matlab控制台执行下面命令
run('E:\test\savefig.m')
https://blog.csdn.net/weixin_42943114/article/details/86675872
https://ww2.mathworks.cn/help/matlab/ref/copygraphics.html
<!--autointro-->
figHandles = get(0, 'Children')
figHandles = findobj('Type', 'figure')
我在matlab中有9个打开的图形(由另一个函数生成),我想将它们全部打印到文件中。 有谁知道如何抓住MATLAB中所有打开的图形的句柄?
我知道gcf,但是它似乎并没有满足我的要求。
testdata = load('text.txt')
plot(testdata) % 1ms per data
plot(0:0.1:(length(testdata)-1)*0.1,testdata) % 0.1ms per data
>> figure(2)
>> plot(0:0.1:(length(testdata)-1)*0.1,testdata)
>> grid on
>>
function[]=plot_en()
disp('------------------------------------------------------------------');
disp('Plots the Energy balance');
load envar.dat;
load timevar.dat;
EN=envar;T=timevar;
set(0,'DefaultLineLineWidth',1.5)%默认线条粗细
fh1=figure('Name','Energy Balance','NumberTitle','off');%取消figur图编号
subplot(2,1,1)%窗口划分为两行一列,第一个
set(fh1, 'color', 'white'); % figur背景设为白色
plot(T,EN(:,1),'-r',T,EN(:,4),'-.m');%plot数据
set (gca,'fontsize',10,'fontweight','n','fontname','times new romans','linewidth',0.5,'Box', 'off','TickDir','out' );
% 刻度字体大小 刻度线条粗细
% 图框闭合成Box-on,off 不闭合 刻度线向里-in,out向外
%title(' ENERGY BALANCE OF SIMULATION THROUGH LSIM ','FontSize',8); %标题名
xlabel('time (s)','FontSize',10); %X轴单位,字体大小
ylabel('Energy (J)','FontSize',10); %Y轴单位,字体大小
h=legend('Potential','Total'); %线型标识名
set(h,'Orientation','horizontal','Color', 'c','Box', 'on','Location','best','fontsize',10,'fontweight','n','fontname','times new romans','linewidth',2.5)
% 对线型标识名legend的设置---蓝绿色C背景box包围打开-on,关闭-off ;位置自动最佳;legend字体大小10;box线框粗细2.5
% plot常用颜色,r 红,g 绿,b 蓝,c 蓝绿,m 紫红,y 黄,k 黑,w 白;color阈值[1 0 0]--代表红色
subplot(2,1,2)%%窗口划分为两行一列,第2个
set(fh1, 'color', 'white'); % sets the color to white
plot(T,EN(:,2),T,EN(:,3));
set (gca,'fontsize',10,'fontweight','n','fontname','times new romans','linewidth',0.5,'Box', 'on','TickDir','in' );
% title(' ENERGY BALANCE OF SIMULATION THROUGH LSIM ','FontSize',8);
xlabel('time (s)','FontSize',10);
ylabel('Energy (J)','FontSize',10);
h=legend('Kinetic','Actuator');
set(h,'Orientation','horizontal','Color', 'none','Box', 'off','Location','best','fontsize',10,'fontweight','n','fontname','times new romans','linewidth',0.5)
% legend位置northoutside,外-北;'north' | 'south' | 'east' | 'west' |'northeast' | 'northwest' | 'southeast' | 'southwest' | 'northoutside' |
%'bestoutside'|'northeast' | 'northwest' | 'southeast' | 'southwest' | 'northeastoutside' |
%'northwestoutside' | 'southeastoutside' | 'southwestoutside'
```<!--autointro-->
情况一:figure上只有一个axis:
1、首先调用h = findobj(gca,’Type’,’line’)命令取得曲线的句柄;
2、然后调用xdata=get(h,’XData’)和ydata=get(h,’YData’)取得曲线的数据。
情况二:figure上有几个axis,即用subplot等画得图像:
clc;clear
x=1:10;
y1=x.^2;
y2=x.^3;
subplot(2,1,1)
plot(x,y1)
subplot(2,1,2)
plot(x,y2)
figure_info=findall(gcf,’type’,’line’);
xc1=get(figure_info(1,:),’xdata’)
xc2=get(figure_info(2,:),’xdata’)
yc1=get(figure_info(1,:),’ydata’)
yc2=get(figure_info(2,:),’ydata’)
这样就可以将所有子图中的曲线信息都找出来。
对比了findall help文件,其中findall中的handle_list可以是一下几种:
gcf 返回当前Figure对象的句柄值
gca返回当前axes对象的句柄值
gco返回当前鼠标单击的句柄值,该对象可以是除root对象外的 任意图形对象,并且Matlab会把当前图形对象的句柄值存放在Figure的CurrentObject属性中。
情况三:figure上是个二维图像
h=findobj(gcf,’type’,’image’);
img=get(h,’CData’);
情况四:figure上是曲面图像
figure_info=findall(gcf,’type’,’surf’);
xx=get(figure_info,’xdata’);
yy=get(figure_info,’ydata’);
z=get(figure_info,’zdata’);
原设置
Figure background color设置
如果选择Force white background后用鼠标复制图像也是白色背景而不是透明的。
如果选择Use figure color保存背景和看到的是一致的,类似于截图。
如果选择Transparent background复制出来的就是透明背景。