matlab
文章平均质量分 52
python进击的巨人
人生苦短 我用python
展开
-
matlab批量更改xml路径
% clear% docNode=xmlread(‘1.xml’,‘r’);% % docRootNode = xml.getDocumentElement;% thisnode=docNode.createElement(‘path’);% thisnode.appendChild(docNode.createTextNode(‘内容’))% xmlwrite(‘2.xml’,docNode)% % Nodes=xml.getChildNodes;% % RootNOdes=Nodes.i原创 2021-05-14 14:39:02 · 243 阅读 · 0 评论 -
matlab mat 文件转python npy文件
1.千万要注意使用-v7.3保存matlab 代码save(‘YTrain.mat’, ‘YTrain’,‘YTrain.npy’)python 代码import h5pyimport numpy as npmat = h5py.File(‘D://shouxieshuzixuanzhuanjiaodu//XTrain.mat’,‘r’)print(mat.keys())print(mat[‘XTrain’].shape)mat_t = np.transpose(mat[‘XTrain’]原创 2020-10-23 15:21:07 · 2043 阅读 · 0 评论 -
最完美的matlab绘图教程集合
% X=[5 10 15 20 25 30 35 40]; %横坐标% Y=[120 200 380 381 490 590 680 700];%第一条线纵坐标% Y1=[120 210 385 490 500 600 810 910];%第二条线纵坐标% x2=[5 44];%虚线横坐标% y2=[120 950];%虚线纵坐标% plot(x2,y2,’:’,‘linewidth’...原创 2020-02-14 13:56:44 · 466 阅读 · 0 评论 -
如何重命名
save([‘0000’ image_name ],‘a’);原创 2020-02-13 16:41:11 · 101 阅读 · 0 评论 -
matlab批量读取文件夹中内容代码
clear all;close all;file_path = ‘B_hatchback0.9’;%输入图像文件夹路径img_path_list = dir(strcat(file_path,’*.mat’));%dir文件夹中的所有文件或者文件夹所组成的列表,strcat为横向连接字符串。%获取该文件夹中所有png格式的图像,形成图像的列表my_images={};img_num ...原创 2020-02-13 15:47:24 · 343 阅读 · 0 评论 -
MATLAB报错:未定义函数或变量解决办法
MATLAB报错:未定义函数或变量解决办法edit(fullfile(matlabroot,‘examples’,‘nnet’,‘main’,‘此处放未定义函数’))比如: edit(fullfile(matlabroot,‘examples’,‘nnet’,‘main’,‘createLgraphUsingConnections’))比如缺createLgraphUsingConnecti...原创 2020-02-03 14:11:10 · 18304 阅读 · 1 评论