




已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
matlab2011a 安装到 99%问题解决 1. 在 matlab的安装目录/toolbox/local 下新建一空文件 pathdef.m ; 2.在“D:Program FilesMATLABR2011abinmatlab.exe“点击可执行文件 matlab.exe 3.出现激活画面,用安装文件里 crack-lic_standalone.dat进行激活。 4.D:Program FilesMATLABR2011abinmatlab.exe 创建一个快捷方式到桌 面就 OK了。 5.打开 matlab,在命令窗口中输入 restoredefaultpath;matlabrc 希望能给大家提供帮助。 Matlab R2007a 中 Warning: Duplicate directory name Matlab R2007a 中存在保存路径的 Bug,症状如下: 当你修改了(增加或删除)搜索路径,并 savepath 后。以后每次启动 MATLAB ,会在 Command Window 的第一行显示下面信息: Warning: Duplicate directory name: C:Documents and Settingsc_cMy DocumentsMATLAB. 而我们 File Set Path,进入路径设置对话框,在“MATLAB search path:”栏里可 以看到只有一个上面提示中的目录,而并没有重复的目录。但却每次都提示这个 Warning,至少这会让你感觉很不爽。 一、Bug 出处 事实上,造成上面的原因并不是真的多了一个提示中的目录,而是我们修改路径后 保存设置时出了问题(命令 savepath 存在 bug!),问题就出在这个 savepath.m 文件上。 我们在 Matlab 的官网上也可以看到这个 bug 信息,如下: 如上所述,这个 bug 存在于 Matlab R2007a 上,到了版本 R2007b 已经得到解 决。 二、解决办法 官网上同时也给出了问题的解决办法,如下: Exit MATLAB. Download the attached savepath.m file to replace the existing savepath.m at matlabroottoolboxmatlabgeneralsavepath.m where matlabroot is the directory in which MATLAB is installed, which you can determine by running the matlabroot function in MATLAB. Start MATLAB from the Windows desktop shortcut or from Windows Start Programs. Run savepath in the Command Window. The warning should no longer appear. 如上所述,按以下步骤可解决此 bug : 1)下载修正后的 savepath.m 文件 (点击此处下载 savepath.m ) 2)如果你正在运行 Matlab,退出 Matlab 3)假如你的 Matlab 安装在目录 D:Program FilesMATLAB 下,则进入目录 D:Program FilesMATLABR2007atoolboxmatlabgeneral 找到并删除这里的 savepath.m 文件, 4)将(1)步中下载的 savepath.m 文件 拷到此目录。 5)启动 Matlab,在 Command Window 输入 savepath 命令即可解决此问题 6)再次重起 Matlab,那个讨厌的 Warning 即会消失 其实不用到其网站下载,savepath.m 文件内容为(在那个文件夹下把下面的内容 替换原先程序里面的内容就可以了): function notsaved = savepath(outputfile) %SAVEPATH Save the current MATLAB path in the pathdef.m file. % SAVEPATH saves the current MATLABPATH in the pathdef.m % which was read on startup. % % SAVEPATH outputFile saves the current MATLABPATH in the % specified file. % % SAVEPATH returns: % 0 if the file was saved successfully % 1 if the file could not be saved % % See also PATHDEF, ADDPATH, RMPATH, PATH, PATHTOOL. % Copyright 1984-2006 The MathWorks, Inc. % $Revision: 1.1.4.12.2.1 $ $Date: 2007/02/28 22:06:17 $ % Assume that things are going well until we learn otherwise. result = 0; % Unless the user specifies otherwise, were going to overwrite the % pathdef.m file that MATLAB currently sees. if nargin = 0 outputfile = which(pathdef.m); else if ischar(outputfile) if nargout = 1 notsaved = 1; end return; end end % This is a token string that we will look for in the template file. magic_string = PLEASE FILL IN ONE DIRECTORY PER LINE; templatefile = fullfile(matlabroot, toolbox, local, template, pathdef.m); % Try to read the template file. If we cant, thats OK, we have a % backup plan. fid = fopen(templatefile, r); if fid = -1 template = fread(fid,*char); fclose(fid); else template = function p = pathdef, 10, . %PATHDEF Search path defaults., 10, . % PATHDEF returns a string that can be used as input to MATLABPATH, 10, . % in order to set the path., 10, 10, . % DO NOT MODIFY THIS FILE. IT IS AN AUTOGENERATED FILE., 10, . % EDITING MAY CAUSE THE FILE TO BECOME UNREADABLE TO, 10, . % THE PATHTOOL AND THE INSTALLER., 10, 10, . p = ., 10, . % BEGIN ENTRIES %, 10, . magic_string, 10, . % END ENTRIES %, 10, . ., 10, . ;, 10, 10, . p = userpath,p;, 10; end % Find the location of the “magic string“ in the file. magic_index = findstr(template, magic_string); % Take everything that appears *before* the “magic string“ line as % “firstpart,“ and everything that appears after that line as % “lastpart.“ % Well sandwich the path particulars between the two ends. firstpart = template(1:magic_index-1); lastpart = template(magic_index + 1:end); lfs_in_firstpart = find(firstpart = 10, 1, last); firstpart = firstpart(1:lfs_in_firstpart); lfs_in_lastpart = find(lastpart = 10, 1, first); lastpart = lastpart(lfs_in_lastpart+1:end); % Read the current path. thepath = matlabpath; % First, Break the path down into a cell array of strings, one for % each entry in the path. We leave the pathsep on the end of each % string. The path might not actually *end* with a pathsep, but if % not, we add one for consistencys sake. ps = pathsep; if thepath(end) = ps thepath = thepath ps; end % Get the exact form of the entries that we want to create in the % new pathdef file based on the path. all_path_lines will be a % cell array of strings. all_path_lines_matches = regexp(thepath,(. ps * ps ?),tokens); all_path_lines = all_path_lines_matches:; % g363196 - For the PC Windows, exclude the value of $documentsMATLAB % from being saved because it is dynamic (per user) and % automatically placed on the path by userpath.m on startup. cname = computer; if (strncmp(cname,PC,2) try % What is the current $documentsMATLAB ? rc sd = dos(startdir $documentsMATLAB -a); sd = strcat(sd,;); % Exclude it from path list that will be saved % Use the indices returned by setdiff to reconstruct the % resulting set while preserving the order unused indices = setdiff(all_path_lines,sd); all_path_lines = all_path_lines(sort(indices); catch end end all_path_lines = matlabrootify(all_path_lines); % Start constructing the contents of the new file. We start with % the firstpart. cont = firstpart; % Append the paths separated by newline characters cont = cont all_path_lines:; % Conclude with the lastpart. cont = cont lastpart; % We have the completed new text of the file, so we try to write it out. % Return immediately if a directory. if isdir(outputfile) if nargout = 1 notsaved = 1; end return; end fid = fopen(outputfile, w); if fid = -1 % We failed to open the file for writing. That might be % because we dont have write permission for that file. Lets % try to make it read-write. if isunix unix(chmod 666 , outputfile, ); elseif ispc end % Last chance. Can we write to it? If we fail here, we have % no choice but to fail. fid = fopen(outputfile, w); if fid = -1 result = 1; if nargout = 1 notsaved = result; end return; end end % Write it out. count = fprintf(fid,%s, cont); if count length(template) result = 1; end fclose(fid); clear pathdef; %make sure that pathdef gets cleared. if nargout = 1 notsaved = result; end %- function dirnames = matlabrootify(dirnamesIn) % Given a cell array of path entries, this performs two functions: % (1) If the path entry under consideration is a subdirectory of % matlabroot, it encodes that information directly into the string. % Therefore, even if the location of the MATLAB installation is changed, % pathdef.m will still point to the appropriate location. % (2) Performs additional formatting. % If were on PC, we want to do our comparisons in a case-insensitive % fashion. Since it also doesnt matter what case the entries are made in, % we might as well lowercase everything now - no harm done. if ispc mlroot = lower(matlabroot); dirnames = lower(dirnamesIn); else mlroot = matlabroot
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 抛光线安全培训课件
- 2025年新型铁合金用封接玻璃项目发展计划
- 2025年高密度聚乙烯土工膜项目建议书
- 2025年临床路径信息系统项目合作计划书
- 2025年SIC涂层石英玻璃管合作协议书
- 2025年广西桂林十八中中考数学三模试卷(含答案)
- 2025年民用高端线缆合作协议书
- 家庭保洁考试流程及答案
- 2025年江苏医疗考试题型及答案
- 慢阻肺的护理
- 16949标准培训课件
- 护理情景模拟演练脚本
- T-CMES 04001-2020 机床装备制造成熟度评价规范
- 征信异议申诉合同(2篇)
- 施工现场安排及人材机计划
- 教师督导问责办法培训
- 人美版美术七年级上册第一单元《第2课 品篆刻之美》课件
- 户外演出舞台方案
- 带押过户合同模板
- 2024届高考英语1000核心词考前背熟事半功倍
- 韬睿惠悦-知识管理KM-职涯地图方法论(P65)-2015
评论
0/150
提交评论