MATLAB 2007 Segmentation Error While Preforming Vector Appendaging

1 次查看(过去 30 天)
When running the following line of code, I get this Segmentation Error in MATLAB 2007B; Note that the OS is Genuine Windows 7 Pro:
%tick = count of instances where the evaluation vector occurs;
percentCalc = tick/numel(EvaluationVector)*100;
percent(end+1)= percentCalc; %adds an additional element of percent "percentCalc" to the growing vector %I believe it crashes on this line and gives this dump message
Both percentCalc and tick are initially defined as 0, while percent is initially defined as empty (all vars defined before the code above). This is in a for loop.
This error occurs on two machines with the same setup, however, one of them skips the following Error Display and exits out of MATLAB:
Saving minidump to file C:\Users\NSPL308\AppData\Local\Temp\matlab_crash_dump.4984.0.dmp
------------------------------------------------------------------------
Segmentation violation detected at Wed Mar 09 15:46:33 2016
------------------------------------------------------------------------
Configuration:
MATLAB Version: 7.5.0.342 (R2007b)
MATLAB License: 345468
Operating System: Microsoft Windows Vista
Window System: Version 6.1 (Build 7600)
Processor ID: x86 Family 6 Model 10 Stepping 9, GenuineIntel
Virtual Machine: Java 1.6.0 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
Default Charset: windows-1252
Register State:
rax = c000e147ae147ae0 rbx = 0000000000000000
rcx = 000000000102ca78 rdx = c000e147ae147ae1
rbp = 0000000037cd1e90 rsi = 00000000376a91f0
rdi = 00000000376a91f0 rsp = 000000000102ca10
r8 = 00000000376a91f0 r9 = 0000000002c402b0
r10 = 0000000002c402b0 r11 = 00000000376a91f0
r12 = 0000000000000008 r13 = 0000000037cd1e90
r14 = 0000000002b2a0e0 r15 = 000000000102cbb0
rip = 0000000002b2a1e9 flg = 0000000000010282
Stack Trace:
[ 0] 0000000002B2A1E9 mcos.dll+500201 (cosiGetArrayElement+004873)
[ 1] 000000000115809D libmx.dll+098461 (mxCreateConvertedCopy+002157)
[ 2] 00000000011595C0 libmx.dll+103872 (mxMatch2DIndicesForIndexedAssignment+001696)
[ 3] 000000000115AC72 libmx.dll+109682 (mxSubscriptedAssignment+000786)
[ 4] 0000000001B28FA6 m_interpreter.dll+561062 (inConvertToLHSType+000998)
[ 5] 0000000001C5982E m_interpreter.dll+1808430 (inConvertToLHSType+1248366)
[ 6] 0000000001C599AF m_interpreter.dll+1808815 (inConvertToLHSType+1248751)
[ 7] 0000000001C8E0A3 m_interpreter.dll+2023587 (inConvertToLHSType+1463523)
[ 8] 0000000001C8E218 m_interpreter.dll+2023960 (inConvertToLHSType+1463896)
[ 9] 0000000001E7E206 m_interpreter.dll+4055558 (inSetAccelFeatureEnabled+038294)
[ 10] 0000000001AD4128 m_interpreter.dll+213288 (inRegisterLineNoHook+011624)
[ 11] 0000000001AD670D m_interpreter.dll+222989 (inRegisterLineNoHook+021325)
[ 12] 0000000001AD68B0 m_interpreter.dll+223408 (inRegisterLineNoHook+021744)
[ 13] 0000000001AD7AE5 m_interpreter.dll+228069 (inRegisterLineNoHook+026405)
[ 14] 0000000001B2B8AD m_interpreter.dll+571565 (inConvertToLHSType+011501)
[ 15] 0000000001B020E9 m_interpreter.dll+401641 (inRegisterInterest+002873)
[ 16] 0000000001B02115 m_interpreter.dll+401685 (inRegisterInterest+002917)
[ 17] 0000000001A0C9F0 m_dispatcher.dll+313840 (Mfh_file::dispatch_fh+00036)
[ 18] 00000000019C1A65 m_dispatcher.dll+006757 (Mfunction_handle::dispatch+000021)
[ 19] 0000000001B1A09C m_interpreter.dll+499868 (inRunSaveObjFunction+009068)
[ 20] 0000000001AD3D4C m_interpreter.dll+212300 (inRegisterLineNoHook+010636)
[ 21] 0000000001AD4DD6 m_interpreter.dll+216534 (inRegisterLineNoHook+014870)
[ 22] 0000000001AD670D m_interpreter.dll+222989 (inRegisterLineNoHook+021325)
[ 23] 0000000001AD68B0 m_interpreter.dll+223408 (inRegisterLineNoHook+021744)
[ 24] 0000000001AD74FB m_interpreter.dll+226555 (inRegisterLineNoHook+024891)
[ 25] 0000000001ACA63A m_interpreter.dll+173626 (inEvalC+001194)
[ 26] 0000000001ACD4A1 m_interpreter.dll+185505 (inIsCodeBlockComplete+005457)
[ 27] 0000000001ACDD9F m_interpreter.dll+187807 (inIsCodeBlockComplete+007759)
[ 28] 0000000001945314 bridge.dll+021268 (mnInitializeParser+000212)
[ 29] 0000000001945CBB bridge.dll+023739 (mnParser+000459)
[ 30] 00000000018FE493 mcr.dll+124051 (mcrInstance::mnParser+000275)
[ 33] 00000000772BF34D kernel32.dll+127821 (BaseThreadInitThunk+000013)
[ 34] 0000000077642CA1 ntdll.dll+208033 (RtlUserThreadStart+000033)
Please follow these steps to report this problem to The MathWorks so we have the best chance of correcting it:
The next time MATLAB is launched under typical usage, a dialog box will open to help you send the error log to The MathWorks. Alternatively, you can send an e-mail to segv@mathworks.com with the following file attached:
C:\Users\NSPL308\AppData\Local\Temp\matlab_crash_dump.4984
If the problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/ts/help_request_1.html
A technical support engineer might contact you with further information.
Thank you for your help. Save your workspace and restart MATLAB.
A. Any Ideas as to what is going on? Is this a java library issue? Am I invoking a method that doesn't exist? Or is the memory getting overloaded?
B. If you do know what is happening, are there any fixes I can do to my code or MATLAB (can't upgrade though) to remedy the situation?
  4 个评论
Midimistro
Midimistro 2016-3-11
Haven't tested the percent(end+1,1) yet, but the EvaluationVector is a predefined vector already in the default workspace, separate from anything generated by the script/function.
Regarding percent(end+1,1), what does the extra ",1" do?
Ced
Ced 2016-3-11
编辑:Ced 2016-3-11
If you do know the total length of percent a priori, you should preallocate it, e.g. percent = zeros(N_ticks_max,1);
The extra "1" does that your elements get appended in a column rather than in a row. Matlab prefers columns.

请先登录,再进行评论。

采纳的回答

Midimistro
Midimistro 2016-6-1
I found out a while back that the problem was actually the percent appending task. Sorry I didn't close the question earlier.
I found the following worked accordingly:
percent(end+1,1)= percentCalc; %appends new value to percent. Works only with R20??+. Column vector format. Most likely introduced with graphical interface change. Faster.
%or
percent = [percent; percentCalc] %Legacy version of appending(works with R2007b+), column vector format. Slower.
I think it is a memory overflow issue that R2007a was not designed to handle, thus the need for different versions based on the version of MATLAB I use.
Thank you for the help though!

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by