matlab使用
~ matlab不能联网的解决.有可能是代理问题,关闭使用脚本
~ matlab 要求账号登录,但是登录后仍然出现错误,error -9,是注册win10用户名问题
使用cmd输入 set username
然后再开始菜单找到matlab文件夹,其中激活matlab重新激活
~ 图像或数据倒置操作
转置 A'共轭转置 inv(A)逆 filplr(A)左右翻转 flipud(A)上下翻转 rot90(A)逆时针转90度 rot90(A,2)转180度 rot90(A,-1)顺时针转90度
~ matlab常用绘图函数
1、graf2d :XY平面绘图(火柴棒)
2、graf2d2 :XYZ立体绘图(切片)
3、hndlgraf :平面显示线型处理窗口及命令演示
4、hndlaxis :平面显示处理窗口及命令演示
5、graf3d :立体显示处理窗口及命令演示
~ matlab 安装MatConvNet cnn工具箱
github(感觉有些旧): https://codechina.csdn.net/mirrors/vlfeat/matconvnet?utm_source=csdn_github_accelerator
官网: https://www.vlfeat.org/matconvnet/
1.输入 vl_compilenn
问题: 找不到 cl.exe
将646行左右的cl_path = fullfile(cc.Location, 'VC', 'bin', 'amd64'); (该语句在check_clpath函数内)改成
cl_path='C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64';
2.输入 run matlab/vl_setupnn
此时可以用 vl_testnn 测试, 大约五分钟
~~ 配置gpu
参照网址: https://blog.csdn.net/yysyys1/article/details/117573346
主要是以下问题的解决
1)使用debug运行vl_compilenn,这种方法会导致性能损失,不可取。
2)将优化指令-O改为-O+数字。
更改方法如下:
将vl_compilenn.m,将606行的nvcc_compile函数
function nvcc_compile(opts, src, tgt, flags)
% --------------------------------------------------------------------
if check_deps(opts, tgt, src), return ; end
nvcc_path = fullfile(opts.cudaRoot, 'bin', 'nvcc');
nvcc_cmd = sprintf('"%s" -c -o "%s" "%s" %s ', ...
nvcc_path, tgt, src, ...
strjoin(horzcat(flags.base,flags.nvcc)));
opts.verbose && fprintf('%s: NVCC CC: %s\n', mfilename, nvcc_cmd) ;
status = system(nvcc_cmd);
if status, error('Command %s failed.', nvcc_cmd); end;
改为:
function nvcc_compile(opts, src, tgt, flags)
% --------------------------------------------------------------------
mybase=flags.base;
mybase(3)={'-O3'};
if check_deps(opts, tgt, src), return ; end
nvcc_path = fullfile(opts.cudaRoot, 'bin', 'nvcc');
nvcc_cmd = sprintf('"%s" -c -o "%s" "%s" %s ', ...
nvcc_path, tgt, src, ...
strjoin(horzcat(mybase,flags.nvcc)));
opts.verbose && fprintf('%s: NVCC CC: %s\n', mfilename, nvcc_cmd) ;
status = system(nvcc_cmd);
if status, error('Command %s failed.', nvcc_cmd); end;
注意对比,我们使用指令为“-O3”,即默认优化等级为3,也可以改为自己想优化的等级。
5、再次运行vl_compilenn('enableGpu', true)
遇到如下错误:
错误使用 mex
'E:\matconvnet\matlab\mex\vl_nnconv.mexw64' 使用了 '-R2018a' 进
行编译并与 '-R2017b' 链接在一起。 有关详细信息,请参阅 MEX 文件使用了一个 API 进行编译并与另一个 API 链接在一起。
出错 vl_compilenn>mex_link (line 629)
mex(args{:}) ;
出错 vl_compilenn (line 500)
mex_link(opts, objs, flags.mex_dir, flags)
解决方法:将vl_compilenn.m中的largeArrayDims全部替换为lmwblas,一共三处。
解决参考博客:https://blog.csdn.net/qq_23944915/article/details/100137942
6、再次运行vl_compilenn('enableGpu', true)
编译成功。
原文链接:https://blog.csdn.net/qq_17783559/article/details/105474663