Error while trying to save profiler
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hi,
I'm using the following code to save the profiler
profsave(profile('info'),strcat('C:\Users\Some Name\Desktop\', DateStarted, '\Profile_Result'));
The folder strcat('C:\Users\Some Name\Desktop\', DateStarted, '\Profile_Result') exists and the profiler starts saving HTML files with names starting from "file0", "file1" etc in the above folder but then it abruptly stops after a couple of HTML files and then displays the following error:
Subscript indices must either be real positive integers or logicals.
Error in profview>makefilepage (line 1245)
canRunList =
find(linelist(startLine:endLine)==runnableLines(startLine:endLine)) +
startLine - 1;
Error in profview (line 70)
s = makefilepage(profileInfo,idx, busyLineSortKeyStr2Num(busyLineSortKey));
Error in profsave (line 42)
str = profview(n,profInfo);
What could be the issue?
Thanks
Hari
採用された回答
Sudhanshu Bhatt
2015 年 10 月 28 日
Hi Hari,
This behavior was seen in MATLAB R2013b in the way PROFSAVE handles p-coded functions to which a plain comment M-File exists.
To workaround the issue, localize the M-File and rename or remove it before running PROFSAVE.
In the case you do not know which M-File causes the error do the following:
1) Set a conditional breakpoint in line 1118 of the file profview.m ( the line would be: runnableLines = runnableLines .* lineMask;). Set the condition to be startLine == 0.
2) Run PROFSAVE and wait until you reach the breakpoint. Now, you can obtain the function name which causes the error be looking at strc(fcnIdx) variable.
3) Locate the file by using WHICH command and rename the M-file.
If this still does not resolve your issue, you can create a Technical Support Request by clicking on the link below:
Thanks
Sudhanshu Bhatt
10 件のコメント
Hari
2015 年 11 月 2 日
Hi,
Thanks for the response. I have no p-codes in my workflow. All are regular *.m code files
But it seems that some of the functions that I use from matlab are itself *.p. I went through the steps you outlined and the break is happening for
C:\Program Files\MATLAB\R2015a\toolbox\symbolic\symbolic\symengine.p
Frankly I dont need to save the profiler part of "symengine.p". I'm primarily interested only in profiling the parts based on my own codes
So what could I do to overcome this error? I dont understand what you mean by "To workaround the issue, localize the M-File and rename or remove it before running PROFSAVE."
Thanks
Hari
Walter Roberson
2015 年 11 月 2 日
For example after having located C:\Program Files\MATLAB\R2015a\toolbox\symbolic\symbolic\symengine.p as the problem,
rename the corresponding .m to something that MATLAB does not pay attention to
movefile('C:\Program Files\MATLAB\R2015a\toolbox\symbolic\symbolic\symengine.m', 'C:\Program Files\MATLAB\R2015a\toolbox\symbolic\symbolic\symengine.m_help');
Hari
2015 年 11 月 2 日
Thanks for the response Walter.
Can you kindly indicate where the "movefile" code needs to go in. Is it
a) within "PROFVIEW FUNCTION" Or
b) within "PROFSAVE FUNCTION" Or
c) Is this a one-time execution to be submitted in the "COMMAND WINDOW" Or
d) Is this a code inserted in my own code/workflow just before I call the profsave command for saving profiler results?
I'm asking the above to understand if this is a one-time activity or not and also what if there are other "p-code" files native to matlab where the failure may occur:
1) My original codes/workflow runs on different machines so do I need to repeat the "movefile" process in every machine
2) Also within a single machine the same set of codes/workflow are run multiple times with different seed. I assume "movefile" is a one time fix for a specific machine
3) If there are other "p-code" files where the break happen, I guess then the process needs to be repeated with the argument for "movefile" appropriately changed
Also once the movefile changes the name of the extension from "symengine.p" (I believe u meant to write symengine.p as 1st argument instead of symengine.m?) to "symengine.m_help" would it not cause issues in future when I refer to symengine function?
I'm surprised MATHWORKS hasnt taken steps to hide this unnecessary complexity ("patchwork") from end users. Why Cant MW just implement (programmatically) the skipping of p-files from saving process and just issue a note/warning saying that p-files not saved.
Thanks
Hari
Walter Roberson
2015 年 11 月 2 日
This is one time per file (on each system)
Do not move the .p file: move the .m file . The .p file has the real code (in encoded format) and the .m file contains only documentation.
This was a bug that is, I gather, thought to have already been fixed. The bug does not appear to have an externally-visible ID. You should ask technical support for assistance and reference this discussion.
Hari
2015 年 11 月 2 日
Thanks for the getting back around "one time/file/system" and "move only the *.m dummy documentation corresponding to actual *.p".
So I gather from this that I need to use option c) which is "COMMAND WINDOW" for this "movefile" code. Right?
Btw, I did raise a technical request (yesterday) based on the link provided by Sudhanshu and also referenced this open discussion.
Walter Roberson
2015 年 11 月 2 日
Yes, command window unless you want to edit the code in profview.m .
Hari
2015 年 11 月 3 日
Thanks for the clarification Walter.
Any ideas on why I get an access denied error when I issue movefile command. I'm the sole owner/admin of this system (Win 8 Pro).
Restarting Matlab does not work. I can post a seperate thread if it is considered as a new issue
Walter Roberson
2015 年 11 月 3 日
Starting some time in Windows Vista (I think it was), files that are stored under the standard executable directory are protected against user write access, as a security measure. You will need to run as Administrator to move / delete / rename them.
Hari
2015 年 11 月 6 日
For anybody else encountering this: Matlab Tech support confirmed that they were able to reproduce the problem in 2015a and it no longer appears in 2015b.
Thanks to Sudhanshu/Walter for providing the solution/steps.
Collin Spencer
2023 年 8 月 30 日
This error is present in R2021a.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Debugging and Analysis についてさらに検索
製品
タグ
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
