已阅读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四川九洲空管科技有限责任公司招聘软件研发岗拟录用人员笔试历年参考题库附带答案详解
- 绿色采购策略优化-第6篇-洞察与解读
- 造价管理真题试卷【完整版】(文末含答案解析)
- 2022护士职业资格证考试《专业实务》综合练习试卷 附答案
- 2025年贵州省公安招聘辅警考试试卷含答案
- 2022年食品行业人员专业知识提升训练试卷 含答案
- 2022年-2023年一级建造师之一建矿业工程实务能力检测试卷B卷附答案
- 2025年机械工程技术员职业能力评价试卷及答案解析
- 2025年台州临海市中小学教师招聘考试笔试试卷附答案
- 业务流程优化的工具及标准模型框架
- 采购领域廉洁培训课件
- 畜产品质量安全管理课件
- CJ/T 106-1999城市生活垃圾产量计算及预测方法
- 高校组织员试题及答案
- 产教融合模式下职业院校人才培养质量提升策略研究报告
- 脱离父子关系协议书
- 2025年上海市金山区高考英语一模试卷
- 人工智能赋能中职计算机教学创新路径与实践探索
- 眼科技师考试题及答案
- 危险化学品无仓储经营责任制度及操作规程
- 资源与运营管理-第一次形考任务-国开-参考资料
评论
0/150
提交评论