필터 지우기
필터 지우기

Error while trying to save profiler

조회 수: 4 (최근 30일)
Hari
Hari 2015년 10월 22일
댓글: Collin Spencer 2023년 8월 30일
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
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
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
Collin Spencer 2023년 8월 30일
This error is present in R2021a.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by