What is the Maple equivalent to Matlab matrix(1:N) so how can I reach matrix elements in Maple?
M := LinearAlgebra:-RandomMatrix(4);
[-93 -32 8 44]
[ ]
[-76 -74 69 92]
M := [ ]
[-72 -4 99 -31]
[ ]
[ -2 27 29 67]
M[2..4,1..2];
[-76 -74]
[ ]
[-72 -4]
[ ]
[ -2 27]
M[2..3,..];
[-76 -74 69 92]
[ ]
[-72 -4 99 -31]
M[..,2..4];
[-32 8 44]
[ ]
[-74 69 92]
[ ]
[ -4 99 -31]
[ ]
[ 27 29 67]
See the help topic rtable_indexing for more.
Related
I'm trying to create a model in which turtles move through a landscape and each type of patch means a different probability of survival for the turtles (representing patches that have more resources = higher chance of survival, patches with less resources = lower chance of survival).
However, all my turtles die out super quickly and don't seem to be following the differences in the probability of survival.
The only thing I have identified is that only if they are in a patch with probability of survival = 1, they survive. If not (even if the probability is .96), they die.
The probability of survival that each type of patch represents is determined by a slider.
extensions [
gis
palette
]
patches-own [
TipoRaster
tipoDeUso
**probSupervivencia**
]
breed [bichos bicho]
to go
if not any? turtles [stop]
if ticks = 120 [stop] ;; representa un ciclo de vida de las hembras adultas (donde cada tick = 1 dia). ***180
ask turtles [
**move
if random-float 1.00 > probSupervivencia [die]**
]
tick
end
to initHabitat
if Habitat = "bichos" [
ask patches with [ tipoDeUso = "Urbano" ][
set probSupervivencia probabilidad-supervivencia-urbano
]
ask patches with [ tipoDeUso = "Nada" ][
set probSupervivencia probabilidad-supervivencia-nada
]
ask patches with [ tipoDeUso = "Bosque" ][
set probSupervivencia probabilidad-supervivencia-bosque
]
ask patches with [ tipoDeUso = "CuerposDeAgua" ][
set probSupervivencia probabilidad-supervivencia-agua
]
ask patches with [ tipoDeUso = "Pastizal" ][
set probSupervivencia probabilidad-supervivencia-pastizal
]
if calidad-matriz = "actual" [
ask patches with [ tipoDeUso = "AgriculturaTemporal" ][
ifelse random-float 1.00 < 0.32 [ set probSupervivencia probabilidad-supervivencia-agricultura-calidad-baja ][ set probSupervivencia probabilidad-supervivencia-agricultura-calidad-alta ]
]
ask patches with [ tipoDeUso = "AgriculturaRiego" ][
ifelse random-float 1.00 < 0.63 [ set probSupervivencia probabilidad-supervivencia-agricultura-calidad-baja ][ set probSupervivencia probabilidad-supervivencia-agricultura-calidad-alta ]
]
]
if calidad-matriz = "alta" [
ask patches with [ tipoDeUso = "AgriculturaTemporal" or tipoDeUso = "AgriculturaRiego" ][
set probSupervivencia probabilidad-supervivencia-agricultura-calidad-alta
]
]
if calidad-matriz = "baja" [
ask patches with [ tipoDeUso = "AgriculturaTemporal" or tipoDeUso = "AgriculturaRiego" ][
set probSupervivencia probabilidad-supervivencia-agricultura-calidad-baja
]
]
if calidad-matriz = "contrastante" [
ask patches with [ tipoDeUso = "AgriculturaTemporal"][
set probSupervivencia probabilidad-supervivencia-agricultura-calidad-alta
]
ask patches with [ tipoDeUso = "AgriculturaRiego" ][
set probSupervivencia probabilidad-supervivencia-agricultura-calidad-baja
]
]
]
end
**to move**
if random 100 < 10 [move-to one-of patches in-radius (tasa-movimiento / longitud-step)]
end
Can anybody figure out what it is I am doing wrong?
Your agents need to inquire about the patch they occupy.
Something like
ask turtles [
if ([probSupervivencia] of patch-here < random-float 1.00) [die]
]
I think this is an error somewhere in my brackets, but I am not sure where this error is located.
to feed
let prey one-of humans-here
if prey != nobody [
[ifelse random-float 1 <= zombie-victory-probability
ifelse random-float 1 <= conversion-probability
[ ask prey [ convert ] ]
[ ask prey [ die ] ]
[ die ]
]]
end
Hard to say for sure as I can't test without seeing your setup code, but maybe like this?
to feed
let prey one-of humans-here
if prey != nobody [
ifelse random-float 1 <= zombie-victory-probability
[ ifelse random-float 1 <= conversion-probability ; option a1
[ ask prey [ convert ] ] ; option b1
[ ask prey [ die ] ] ; option b2
]
[ die ] ; option a2
]
end
I tried using mex files with armadillo linear algebra library. At first,I tried a very simple program as follows:
Could anyone help me?
%%%% matlab script %%%%%%%
mex -larmadillo -lgfortran armaMex_demo.cpp
X = randn(5,5);
Y = randn(5,5);
% Run the demo using X and Y
Z = armaMex_demo(X,Y,3)
%%%%%%%%%%%%% mex files %%%%%%
#include "armaMex.hpp"
#include <armadillo>
using namespace arma;
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
// Check the number of input arguments.
if (nrhs != 3)
mexErrMsgTxt("Incorrect number of input arguments.");
// Check type of input.
if ( (mxGetClassID(prhs[0]) != mxDOUBLE_CLASS) || (mxGetClassID(prhs[1]) != mxDOUBLE_CLASS) )
mexErrMsgTxt("Input must me of type double.");
// Check if input is real.
if ( (mxIsComplex(prhs[0])) || (mxIsComplex(prhs[1])) )
mexErrMsgTxt("Input must be real.");
// Create matrices X and Y from the first and second argument.
mat X = armaGetPr(prhs[0]);
mat Y = armaGetPr(prhs[1]);
int c= armaGetScalar<int>(prhs[2]);
// Our calculations require that matrices must be of the same size
if ( size(X) != size(Y) )
mexErrMsgTxt("Matrices should be of same size.");
// Perform calculations
mat A = X + Y;
mat B = X % Y; // % means element-wise multiplication in Armadillo
mat D = inv(X)*Y;
int ee = trace(X.i()*Y) + log(det(X));
// Create cube C with A and B as slices.
cube C(A.n_rows, A.n_cols, 4);
mat E = zeros<mat>(A.n_rows, A.n_cols);
E(0,0) = ee;
C.slice(0) = A;
C.slice(1) = B;
C.slice(2) = D;
C.slice(3) = E;
plhs[0] = armaCreateMxMatrix(C.n_rows, C.n_cols, C.n_slices);
armaSetCubePr(plhs[0], C);
return;
}
%%%%%%% the error %%%%%%%%%
I tried X, Y with size 3*3, 4*4, it is OK
But when I tried with 5*5 of matrix inversion, a failure occurred
“Segmentation fault (core dumped)”
and in matlab interface
Segmentation violation detected at Thu Jul 30 16:04:53 2015
Configuration:
Crash Decoding : Disabled
Current Visual : 0x21 (class 4, depth 24)
Default Encoding : UTF-8
GNU C Library : 2.19 stable
MATLAB Architecture: glnxa64
MATLAB Root : /usr/local/MATLAB/R2014a
MATLAB Version : 8.3.0.532 (R2014a)
Operating System : Linux 3.16.0-45-generic #60~14.04.1-Ubuntu SMP Fri Jul 24 21:16:23 UTC 2015 x86_64
Processor ID : x86 Family 6 Model 60 Stepping 3, GenuineIntel
Virtual Machine : Java 1.7.0_11-b21 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : The X.Org Foundation (11600000), display :0
Fault Count: 4
Abnormal termination:
Segmentation violation
Register State (from fault):
RAX = 0000000000000001 RBX = 0000000300000002
RCX = 0000000000000000 RDX = 00000000000027f8
RSP = 00007fd737ff71c0 RBP = 0000000000000000
RSI = 00007fd737ff9090 RDI = 0000000300000000
R8 = 0000000000027f40 R9 = 0000000000000002
R10 = 00007fd737ff9090 R11 = bff0000000000000
R12 = 0000000000000000 R13 = 0000000000000000
R14 = 0000003000000030 R15 = 00007fd737ff9090
RIP = 00007fd68e79ff3b EFL = 0000000000010202
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fd68e79ff3b /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+15413051 mkl_blas_avx2_izamax+00000779
[ 1] 0x00007fd68ddae95f /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+04987231 mkl_lapack_zgetf2+00000255
[ 2] 0x00007fd68e1f9f63 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+09490275 mkl_lapack_zgetrf_local+00001459
[ 3] 0x00007fd68e1f9c56 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+09489494 mkl_lapack_zgetrf_local+00000678
[ 4] 0x00007fd68e1f9c56 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+09489494 mkl_lapack_zgetrf_local+00000678
[ 5] 0x00007fd68e1f9c56 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+09489494 mkl_lapack_zgetrf_local+00000678
[ 6] 0x00007fd68e1f9c56 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+09489494 mkl_lapack_zgetrf_local+00000678
[ 7] 0x00007fd68da771de /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+01614302 mkl_lapack_zgetrf+00003822
[ 8] 0x00007fd68dc0ea8b /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+03283595 mkl_lapack_ao_zgetrf+00000107
[ 9] 0x00007fd68ddbae0b /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+05037579 mkl_lapack_zgesv+00000187
[ 10] 0x00007fd688d00a7b /home/weiwei/Work/PolSAR/PolSAR/PolSAR_code/mex_SLICPolSAR.mexa64+00105083
[ 11] 0x00007fd688cf9401 /home/weiwei/Work/PolSAR/PolSAR/PolSAR_code/mex_SLICPolSAR.mexa64+00074753
[ 12] 0x00007fd688cf51ca /home/weiwei/Work/PolSAR/PolSAR/PolSAR_code/mex_SLICPolSAR.mexa64+00057802
[ 13] 0x00007fd688cf0eb5 /home/weiwei/Work/PolSAR/PolSAR/PolSAR_code/mex_SLICPolSAR.mexa64+00040629
[ 14] 0x00007fd688cef8cd /home/weiwei/Work/PolSAR/PolSAR/PolSAR_code/mex_SLICPolSAR.mexa64+00035021
[ 15] 0x00007fd688cebb37 /home/weiwei/Work/PolSAR/PolSAR/PolSAR_code/mex_SLICPolSAR.mexa64+00019255
[ 16] 0x00007fd688ced570 /home/weiwei/Work/PolSAR/PolSAR/PolSAR_code/mex_SLICPolSAR.mexa64+00025968 mexFunction+00001660
[ 17] 0x00007fd74647272a /usr/local/MATLAB/R2014a/bin/glnxa64/libmex.so+00120618 mexRunMexFile+00000090
[ 18] 0x00007fd74646ea94 /usr/local/MATLAB/R2014a/bin/glnxa64/libmex.so+00105108
[ 19] 0x00007fd74646ffb4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmex.so+00110516
[ 20] 0x00007fd745869ad9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_dispatcher.so+00670425 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000697
[ 21] 0x00007fd744b062b4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04461236
[ 22] 0x00007fd744b07bc9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04467657
[ 23] 0x00007fd744b083fc /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04469756
[ 24] 0x00007fd7449826e3 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02873059
[ 25] 0x00007fd74499209e /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02936990
[ 26] 0x00007fd744992183 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02937219
[ 27] 0x00007fd744ac8172 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04206962
[ 28] 0x00007fd7448fd589 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02327945
[ 29] 0x00007fd744900167 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02339175
[ 30] 0x00007fd7448fe26f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02331247
[ 31] 0x00007fd7448feec4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02334404
[ 32] 0x00007fd74495c30b /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02716427
[ 33] 0x00007fd745869c5f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_dispatcher.so+00670815 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00001087
[ 34] 0x00007fd74494020e /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02601486
[ 35] 0x00007fd7448e11b0 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02212272
[ 36] 0x00007fd7448fc25f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02323039
[ 37] 0x00007fd744900167 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02339175
[ 38] 0x00007fd7448fe26f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02331247
[ 39] 0x00007fd7448feec4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02334404
[ 40] 0x00007fd74495c30b /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02716427
[ 41] 0x00007fd745869c5f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_dispatcher.so+00670815 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00001087
[ 42] 0x00007fd74492f135 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02531637
[ 43] 0x00007fd7448f60d9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02298073
[ 44] 0x00007fd7448f2dc7 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02284999
[ 45] 0x00007fd7448f3193 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02285971
[ 46] 0x00007fd74669cafc /usr/local/MATLAB/R2014a/bin/glnxa64/libmwbridge.so+00142076
[ 47] 0x00007fd74669d791 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwbridge.so+00145297 _Z8mnParserv+00000721
[ 48] 0x00007fd74f95392f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00489775 _ZN11mcrInstance30mnParser_on_interpreter_threadEv+00000031
[ 49] 0x00007fd74f934b6d /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00363373
[ 50] 0x00007fd74f934be9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00363497
[ 51] 0x00007fd744028d46 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwuix.so+00343366
[ 52] 0x00007fd74400b382 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwuix.so+00222082
[ 53] 0x00007fd7500a950f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02323727
[ 54] 0x00007fd7500a967c /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02324092
[ 55] 0x00007fd7500a557f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02307455
[ 56] 0x00007fd7500aa9b5 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02329013
[ 57] 0x00007fd7500aade7 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02330087
[ 58] 0x00007fd7500ab4c0 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02331840 _Z25svWS_ProcessPendingEventsiib+00000080
[ 59] 0x00007fd74f935098 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00364696
[ 60] 0x00007fd74f9353bf /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00365503
[ 61] 0x00007fd74f93028f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00344719
[ 62] 0x00007fd74e8de182 /lib/x86_64-linux-gnu/libpthread.so.0+00033154
[ 63] 0x00007fd74e60b47d /lib/x86_64-linux-gnu/libc.so.6+01025149 clone+00000109
Abnormal termination:
Segmentation violation
Register State (from fault):
RAX = 0000000000000002 RBX = 0000000000000000
RCX = 0000001000000004 RDX = 000000000024875f
RSP = 00007fd737ff9538 RBP = 0000000000000000
RSI = 00007fd6b6ddd500 RDI = 00007fd737ff9500
R8 = 0000001000000003 R9 = 0000000000000004
R10 = 0000000000000005 R11 = 00007fd74e698a30
R12 = 0000000000000000 R13 = 0000001000000005
R14 = 00007fd6b6ddd500 R15 = 0000000000000000
RIP = 00007fd68e7a0872 EFL = 0000000000010287
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fd68e7a0872 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+15415410 mkl_blas_avx2_idamax+00000626
[ 1] 0x00007fd68e05faae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07809710 mkl_lapack_dgetf2+00000238
[ 2] 0x00007fd68e05f869 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07809129 mkl_lapack_dgetrf_local+00001369
[ 3] 0x00007fd68e05f4ae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07808174 mkl_lapack_dgetrf_local+00000414
[ 4] 0x00007fd68e05f4ae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07808174 mkl_lapack_dgetrf_local+00000414
[ 5] 0x00007fd68e05f4ae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07808174 mkl_lapack_dgetrf_local+00000414
[ 6] 0x00007fd68e05f4ae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07808174 mkl_lapack_dgetrf_local+00000414
[ 7] 0x00007fd68dab6562 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+01873250 mkl_lapack_dgetrf+00003810
[ 8] 0x00007fd66cf48a74 /home/weiwei/Work/PolSAR/PolSAR/utils/armadillo-5.200.2/mex_interface/armaMex_demo.mexa64+00035444
[ 9] 0x00007fd66cf43542 /home/weiwei/Work/PolSAR/PolSAR/utils/armadillo-5.200.2/mex_interface/armaMex_demo.mexa64+00013634 mexFunction+00002831
[ 10] 0x00007fd74647272a /usr/local/MATLAB/R2014a/bin/glnxa64/libmex.so+00120618 mexRunMexFile+00000090
[ 11] 0x00007fd74646ea94 /usr/local/MATLAB/R2014a/bin/glnxa64/libmex.so+00105108
[ 12] 0x00007fd74646ffb4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmex.so+00110516
[ 13] 0x00007fd745869ad9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_dispatcher.so+00670425 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000697
[ 14] 0x00007fd744b062b4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04461236
[ 15] 0x00007fd744b07bc9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04467657
[ 16] 0x00007fd744b083fc /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04469756
[ 17] 0x00007fd7449826e3 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02873059
[ 18] 0x00007fd74499209e /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02936990
[ 19] 0x00007fd744992183 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02937219
[ 20] 0x00007fd744ac8172 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04206962
[ 21] 0x00007fd7448fd589 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02327945
[ 22] 0x00007fd744900167 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02339175
[ 23] 0x00007fd7448fe26f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02331247
[ 24] 0x00007fd7448feec4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02334404
[ 25] 0x00007fd74495c30b /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02716427
[ 26] 0x00007fd745869c5f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_dispatcher.so+00670815 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00001087
[ 27] 0x00007fd74494020e /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02601486
[ 28] 0x00007fd7448e11b0 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02212272
[ 29] 0x00007fd7448fc25f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02323039
[ 30] 0x00007fd744900167 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02339175
[ 31] 0x00007fd7448fe26f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02331247
[ 32] 0x00007fd7448feec4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02334404
[ 33] 0x00007fd74495c30b /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02716427
[ 34] 0x00007fd745869c5f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_dispatcher.so+00670815 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00001087
[ 35] 0x00007fd74492f135 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02531637
[ 36] 0x00007fd7448f60d9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02298073
[ 37] 0x00007fd7448f2dc7 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02284999
[ 38] 0x00007fd7448f3193 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02285971
[ 39] 0x00007fd74669cafc /usr/local/MATLAB/R2014a/bin/glnxa64/libmwbridge.so+00142076
[ 40] 0x00007fd74669d791 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwbridge.so+00145297 _Z8mnParserv+00000721
[ 41] 0x00007fd74f95392f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00489775 _ZN11mcrInstance30mnParser_on_interpreter_threadEv+00000031
[ 42] 0x00007fd74f934b6d /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00363373
[ 43] 0x00007fd74f934be9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00363497
[ 44] 0x00007fd744028d46 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwuix.so+00343366
[ 45] 0x00007fd74400b382 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwuix.so+00222082
[ 46] 0x00007fd7500a950f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02323727
[ 47] 0x00007fd7500a967c /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02324092
[ 48] 0x00007fd7500a557f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02307455
[ 49] 0x00007fd7500aa9b5 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02329013
[ 50] 0x00007fd7500aade7 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02330087
[ 51] 0x00007fd7500ab4c0 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02331840 _Z25svWS_ProcessPendingEventsiib+00000080
[ 52] 0x00007fd74f935098 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00364696
[ 53] 0x00007fd74f9353bf /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00365503
[ 54] 0x00007fd74f93028f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00344719
[ 55] 0x00007fd74e8de182 /lib/x86_64-linux-gnu/libpthread.so.0+00033154
[ 56] 0x00007fd74e60b47d /lib/x86_64-linux-gnu/libc.so.6+01025149 clone+00000109
Abnormal termination:
Segmentation violation
Register State (from fault):
RAX = 0000000000000001 RBX = 0000000000000000
RCX = 0000001000000004 RDX = 0000000000248729
RSP = 00007fd737ff9538 RBP = 0000000000000000
RSI = 00007fd6b6ddd6b0 RDI = 00007fd737ff9500
R8 = 0000001000000001 R9 = 0000000000000004
R10 = 0000000000000003 R11 = 00007fd74e698a30
R12 = 0000000000000000 R13 = 0000001000000005
R14 = 00007fd6b6ddd6b0 R15 = 0000000000000000
RIP = 00007fd68e7a0872 EFL = 0000000000010287
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fd68e7a0872 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+15415410 mkl_blas_avx2_idamax+00000626
[ 1] 0x00007fd68e05faae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07809710 mkl_lapack_dgetf2+00000238
[ 2] 0x00007fd68e05f869 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07809129 mkl_lapack_dgetrf_local+00001369
[ 3] 0x00007fd68e05f4ae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07808174 mkl_lapack_dgetrf_local+00000414
[ 4] 0x00007fd68e05f4ae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07808174 mkl_lapack_dgetrf_local+00000414
[ 5] 0x00007fd68e05f4ae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07808174 mkl_lapack_dgetrf_local+00000414
[ 6] 0x00007fd68e05f4ae /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+07808174 mkl_lapack_dgetrf_local+00000414
[ 7] 0x00007fd68dab6562 /usr/local/MATLAB/R2014a/bin/glnxa64/mkl.so+01873250 mkl_lapack_dgetrf+00003810
[ 8] 0x00007fd66cf48a74 /home/weiwei/Work/PolSAR/PolSAR/utils/armadillo-5.200.2/mex_interface/armaMex_demo.mexa64+00035444
[ 9] 0x00007fd66cf43542 /home/weiwei/Work/PolSAR/PolSAR/utils/armadillo-5.200.2/mex_interface/armaMex_demo.mexa64+00013634 mexFunction+00002831
[ 10] 0x00007fd74647272a /usr/local/MATLAB/R2014a/bin/glnxa64/libmex.so+00120618 mexRunMexFile+00000090
[ 11] 0x00007fd74646ea94 /usr/local/MATLAB/R2014a/bin/glnxa64/libmex.so+00105108
[ 12] 0x00007fd74646ffb4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmex.so+00110516
[ 13] 0x00007fd745869ad9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_dispatcher.so+00670425 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000697
[ 14] 0x00007fd744b062b4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04461236
[ 15] 0x00007fd744b07bc9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04467657
[ 16] 0x00007fd744b083fc /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04469756
[ 17] 0x00007fd7449826e3 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02873059
[ 18] 0x00007fd74499209e /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02936990
[ 19] 0x00007fd744992183 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02937219
[ 20] 0x00007fd744ac8172 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+04206962
[ 21] 0x00007fd7448fd589 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02327945
[ 22] 0x00007fd744900167 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02339175
[ 23] 0x00007fd7448fe26f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02331247
[ 24] 0x00007fd7448feec4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02334404
[ 25] 0x00007fd74495c30b /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02716427
[ 26] 0x00007fd745869c5f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_dispatcher.so+00670815 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00001087
[ 27] 0x00007fd74494020e /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02601486
[ 28] 0x00007fd7448e11b0 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02212272
[ 29] 0x00007fd7448fc25f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02323039
[ 30] 0x00007fd744900167 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02339175
[ 31] 0x00007fd7448fe26f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02331247
[ 32] 0x00007fd7448feec4 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02334404
[ 33] 0x00007fd74495c30b /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02716427
[ 34] 0x00007fd745869c5f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_dispatcher.so+00670815 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00001087
[ 35] 0x00007fd74492f135 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02531637
[ 36] 0x00007fd7448f60d9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02298073
[ 37] 0x00007fd7448f2dc7 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02284999
[ 38] 0x00007fd7448f3193 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwm_interpreter.so+02285971
[ 39] 0x00007fd74669cafc /usr/local/MATLAB/R2014a/bin/glnxa64/libmwbridge.so+00142076
[ 40] 0x00007fd74669d791 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwbridge.so+00145297 _Z8mnParserv+00000721
[ 41] 0x00007fd74f95392f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00489775 _ZN11mcrInstance30mnParser_on_interpreter_threadEv+00000031
[ 42] 0x00007fd74f934b6d /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00363373
[ 43] 0x00007fd74f934be9 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00363497
[ 44] 0x00007fd744028d46 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwuix.so+00343366
[ 45] 0x00007fd74400b382 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwuix.so+00222082
[ 46] 0x00007fd7500a950f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02323727
[ 47] 0x00007fd7500a967c /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02324092
[ 48] 0x00007fd7500a557f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02307455
[ 49] 0x00007fd7500aa9b5 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02329013
[ 50] 0x00007fd7500aade7 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02330087
[ 51] 0x00007fd7500ab4c0 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwservices.so+02331840 _Z25svWS_ProcessPendingEventsiib+00000080
[ 52] 0x00007fd74f935098 /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00364696
[ 53] 0x00007fd74f9353bf /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00365503
[ 54] 0x00007fd74f93028f /usr/local/MATLAB/R2014a/bin/glnxa64/libmwmcr.so+00344719
[ 55] 0x00007fd74e8de182 /lib/x86_64-linux-gnu/libpthread.so.0+00033154
[ 56] 0x00007fd74e60b47d /lib/x86_64-linux-gnu/libc.so.6+01025149 clone+00000109
Abnormal termination:
Segmentation violation
Register State (from fault):
RAX = 0000000000000002 RBX = 0000000000000000
RCX = 0000001000000004 RDX = 0000000000251169
RSP = 00007fd737ff9538 RBP = 0000000000000000
RSI = 00007fd6b6d984b0 RDI = 00007fd737ff9500
R8 = 0000001000000001 R9 = 0000000000000004
R10 = 0000000000000003 R11 = 00007fd74e698a30
R12 = 0000000000000000 R13 = 0000001000000005
R14 = 00007fd6b6d984b0 R15 = 0000000000000000
RIP = 00007fd68e7a0872 EFL = 0000000000010283
CS = 0033 FS = 0000 GS = 0000
Try to add the Armadillo cast used it in my code and it worked fine:
`vec x = conv_to<vec>::from(armaGetPr(prhs[0],true));`
For more info see: http://sigpack.sourceforge.net/build.html
I am trying to use glmnet package for MatLab. The glmnet works fine, but when trying to use cvglmnet (which is another function from the package), MatLab gives a "catastrophic" error which requires me to close it. It has something to do with a MEX file it is calling. I copied the whole error message below.
Any help is appreciated.
MATLAB crash file:C:\Users\Marcelo\AppData\Local\Temp\matlab_crash_dump.10552-1:
------------------------------------------------------------------------
Access violation detected at Mon Jul 06 17:28:49 2015
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled
Default Encoding : windows-1252
Graphics card 1 : NVIDIA ( 0x10de ) NVIDIA GeForce GT 740M Version 9.18.13.4752
Graphics card 2 : Intel Corporation ( 0x8086 ) Intel(R) HD Graphics 4000 Version 10.18.10.3308
MATLAB Architecture: win64
MATLAB Root : C:\Program Files\MATLAB\R2014b
MATLAB Version : 8.4.0.150421 (R2014b)
Operating System : Microsoft Windows 8.1 Single Language
Processor ID : x86 Family 6 Model 58 Stepping 9, GenuineIntel
Software OpenGL : 0
Virtual Machine : Java 1.7.0_11-b21 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : Version 6.3 (Build 9600)
Fault Count: 1
Abnormal termination:
Access violation
Register State (from fault):
RAX = 0000000000000000 RBX = 0000000000000000
RCX = 000000000402e7f0 RDX = 000000000402e8f0
RSP = 000000000402cd08 RBP = 000000000402e8f0
RSI = 0000000078ab6550 RDI = 000000000402e7f0
R8 = 000000000402db10 R9 = 000000000402e7f0
R10 = 0000000000000000 R11 = 000000000402e8f0
R12 = 0000000000000001 R13 = 0000000000000000
R14 = 000000000402e8f0 R15 = 000000000402e7f0
RIP = 00000000fe160b03 EFL = 00010286
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x00000000fe160b03 C:\Program Files\MATLAB\R2014b\bin\win64\libmx.dll+00396035 MXGETPR+00000003
[ 1] 0x00007ffee4d619dc C:\Users\Marcelo\Desktop\Marcelo\PUC\Mestrado\Dissertação\Instrument Selection\glmnet_matlab\glmnetMex.mexw64+00006620 MEXFUNCTION+00002524
[ 2] 0x00000000fc5f36f0 C:\Program Files\MATLAB\R2014b\bin\win64\libmex.dll+00079600 mexRunMexFile+00000112
[ 3] 0x00000000fc5f2762 C:\Program Files\MATLAB\R2014b\bin\win64\libmex.dll+00075618 inSwapMexfileReader+00000690
[ 4] 0x00000000fc5f2248 C:\Program Files\MATLAB\R2014b\bin\win64\libmex.dll+00074312 mexUnlock+00006008
[ 5] 0x0000000004a805e3 C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00067043 Mfh_file::dispatch_fh+00000659
[ 6] 0x0000000004a80aee C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00068334 Mfunction_handle::dispatch+00000766
[ 7] 0x0000000004e62b2f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00273199 inGetNameInSymbolTable+00017071
[ 8] 0x0000000004e640c0 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00278720 inGetNameInSymbolTable+00022592
[ 9] 0x0000000004e61b4f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00269135 inGetNameInSymbolTable+00013007
[ 10] 0x0000000004e61ab1 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00268977 inGetNameInSymbolTable+00012849
[ 11] 0x0000000004e8406f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00409711 inPathNotification::function_delete_notification+00098591
[ 12] 0x0000000004e827af C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00403375 inPathNotification::function_delete_notification+00092255
[ 13] 0x0000000004e81359 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00398169 inPathNotification::function_delete_notification+00087049
[ 14] 0x0000000004a805e3 C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00067043 Mfh_file::dispatch_fh+00000659
[ 15] 0x0000000004a80aee C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00068334 Mfunction_handle::dispatch+00000766
[ 16] 0x0000000004e62b2f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00273199 inGetNameInSymbolTable+00017071
[ 17] 0x0000000004e640c0 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00278720 inGetNameInSymbolTable+00022592
[ 18] 0x0000000004e61b4f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00269135 inGetNameInSymbolTable+00013007
[ 19] 0x0000000004e61ab1 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00268977 inGetNameInSymbolTable+00012849
[ 20] 0x0000000004e8406f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00409711 inPathNotification::function_delete_notification+00098591
[ 21] 0x0000000004e827af C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00403375 inPathNotification::function_delete_notification+00092255
[ 22] 0x0000000004e81359 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00398169 inPathNotification::function_delete_notification+00087049
[ 23] 0x0000000004a805e3 C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00067043 Mfh_file::dispatch_fh+00000659
[ 24] 0x0000000004a80aee C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00068334 Mfunction_handle::dispatch+00000766
[ 25] 0x0000000004e62b2f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00273199 inGetNameInSymbolTable+00017071
[ 26] 0x0000000004e640c0 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00278720 inGetNameInSymbolTable+00022592
[ 27] 0x0000000004e61b4f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00269135 inGetNameInSymbolTable+00013007
[ 28] 0x0000000004e61ab1 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00268977 inGetNameInSymbolTable+00012849
[ 29] 0x0000000004e8406f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00409711 inPathNotification::function_delete_notification+00098591
[ 30] 0x0000000004e827af C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00403375 inPathNotification::function_delete_notification+00092255
[ 31] 0x0000000004e81359 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00398169 inPathNotification::function_delete_notification+00087049
[ 32] 0x0000000004a805e3 C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00067043 Mfh_file::dispatch_fh+00000659
[ 33] 0x0000000004a80aee C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00068334 Mfunction_handle::dispatch+00000766
[ 34] 0x0000000004e3b606 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00112134 MathWorks::MException::IMExceptionData::IMExceptionData+00037094
[ 35] 0x0000000004e3aa20 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00109088 MathWorks::MException::IMExceptionData::IMExceptionData+00034048
[ 36] 0x0000000004e39219 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00102937 MathWorks::MException::IMExceptionData::IMExceptionData+00027897
[ 37] 0x0000000004e38de5 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00101861 MathWorks::MException::IMExceptionData::IMExceptionData+00026821
[ 38] 0x0000000004e8b708 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00440072 inPathNotification::function_delete_notification+00128952
[ 39] 0x0000000004e63ea5 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00278181 inGetNameInSymbolTable+00022053
[ 40] 0x0000000004e61b4f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00269135 inGetNameInSymbolTable+00013007
[ 41] 0x0000000004e61ab1 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00268977 inGetNameInSymbolTable+00012849
[ 42] 0x0000000004e8406f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00409711 inPathNotification::function_delete_notification+00098591
[ 43] 0x0000000004e827af C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00403375 inPathNotification::function_delete_notification+00092255
[ 44] 0x0000000004e81359 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00398169 inPathNotification::function_delete_notification+00087049
[ 45] 0x0000000004a807a4 C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00067492 Mfh_file::dispatch_fh+00001108
[ 46] 0x0000000004a80aee C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00068334 Mfunction_handle::dispatch+00000766
[ 47] 0x0000000004e62b2f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00273199 inGetNameInSymbolTable+00017071
[ 48] 0x0000000004f4b6f7 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+01226487 inFullEvalFcn+00011159
[ 49] 0x0000000004e65592 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00284050 inGetNameInSymbolTable+00027922
[ 50] 0x0000000004e61b4f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00269135 inGetNameInSymbolTable+00013007
[ 51] 0x0000000004e61ab1 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00268977 inGetNameInSymbolTable+00012849
[ 52] 0x0000000004e8406f C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00409711 inPathNotification::function_delete_notification+00098591
[ 53] 0x0000000004e827af C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00403375 inPathNotification::function_delete_notification+00092255
[ 54] 0x0000000004e81359 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00398169 inPathNotification::function_delete_notification+00087049
[ 55] 0x0000000004a807a4 C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00067492 Mfh_file::dispatch_fh+00001108
[ 56] 0x0000000004a80aee C:\Program Files\MATLAB\R2014b\bin\win64\m_dispatcher.dll+00068334 Mfunction_handle::dispatch+00000766
[ 57] 0x0000000004eb4a88 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00608904 inPathNotification::function_delete_notification+00297784
[ 58] 0x0000000004eb4a04 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00608772 inPathNotification::function_delete_notification+00297652
[ 59] 0x0000000004eb49c5 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00608709 inPathNotification::function_delete_notification+00297589
[ 60] 0x0000000004eb4992 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00608658 inPathNotification::function_delete_notification+00297538
[ 61] 0x0000000004eb4947 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00608583 inPathNotification::function_delete_notification+00297463
[ 62] 0x0000000004e2d69d C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+00054941 inEvalExp+00001309
[ 63] 0x0000000004f5525d C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+01266269 inEvalCmdWithLocalReturn+00000285
[ 64] 0x0000000004f55181 C:\Program Files\MATLAB\R2014b\bin\win64\m_interpreter.dll+01266049 inEvalCmdWithLocalReturn+00000065
[ 65] 0x00000000fb5fe31d C:\Program Files\MATLAB\R2014b\bin\win64\libmwbridge.dll+00058141 mnGetPrompt+00001517
[ 66] 0x00000000fb5fed09 C:\Program Files\MATLAB\R2014b\bin\win64\libmwbridge.dll+00060681 mnParser+00000745
[ 67] 0x00000000fd0dd834 C:\Program Files\MATLAB\R2014b\bin\win64\mcr.dll+00383028 mcrInstance::mnParser_on_interpreter_thread+00000036
[ 68] 0x00000000fd0a68e7 C:\Program Files\MATLAB\R2014b\bin\win64\mcr.dll+00157927 mcr::runtime::setInterpreterThreadToCurrent+00019751
[ 69] 0x00000000fd0a6923 C:\Program Files\MATLAB\R2014b\bin\win64\mcr.dll+00157987 mcr::runtime::setInterpreterThreadToCurrent+00019811
[ 70] 0x00000000fd0a7121 C:\Program Files\MATLAB\R2014b\bin\win64\mcr.dll+00160033 mcr::runtime::setInterpreterThreadToCurrent+00021857
[ 71] 0x00000000fab5d3a6 C:\Program Files\MATLAB\R2014b\bin\win64\uiw.dll+00512934 UIW_AttachThreadInput+00001270
[ 72] 0x00000000fab5cc35 C:\Program Files\MATLAB\R2014b\bin\win64\uiw.dll+00511029 wsd_to_MSW+00004373
[ 73] 0x00000000fab5ccb9 C:\Program Files\MATLAB\R2014b\bin\win64\uiw.dll+00511161 wsd_to_MSW+00004505
[ 74] 0x00007fff0f5108ca C:\WINDOWS\system32\USER32.dll+00592074 BroadcastSystemMessageExA+00000586
[ 75] 0x00007fff0f482e1f C:\WINDOWS\system32\USER32.dll+00011807 IsWindow+00000367
[ 76] 0x00007fff0f482e96 C:\WINDOWS\system32\USER32.dll+00011926 IsWindow+00000486
[ 77] 0x00007fff0f693034 C:\WINDOWS\SYSTEM32\ntdll.dll+00602164 KiUserCallbackDispatcher+00000036
[ 78] 0x00007fff0f482a8a C:\WINDOWS\system32\USER32.dll+00010890 PeekMessageW+00000250
[ 79] 0x00007fff0f486283 C:\WINDOWS\system32\USER32.dll+00025219 GetMessageA+00000243
[ 80] 0x00007fff0f48622f C:\WINDOWS\system32\USER32.dll+00025135 GetMessageA+00000159
[ 81] 0x00000000fab0a26b C:\Program Files\MATLAB\R2014b\bin\win64\uiw.dll+00172651 UIW_ShowMenuItem+00003995
[ 82] 0x00000000fab5dce2 C:\Program Files\MATLAB\R2014b\bin\win64\uiw.dll+00515298 UIW_SuspendAttachThreadInput+00000466
[ 83] 0x0000000100118223 C:\Program Files\MATLAB\R2014b\bin\win64\libmwservices.dll+01212963 services::system_events::PpeDispatchHook::dispatchOne+00032291
[ 84] 0x0000000100123c95 C:\Program Files\MATLAB\R2014b\bin\win64\libmwservices.dll+01260693 sysq::addProcessPendingEventsUnitTestHook+00005813
[ 85] 0x0000000100123d50 C:\Program Files\MATLAB\R2014b\bin\win64\libmwservices.dll+01260880 sysq::addProcessPendingEventsUnitTestHook+00006000
[ 86] 0x0000000100125b75 C:\Program Files\MATLAB\R2014b\bin\win64\libmwservices.dll+01268597 sysq::getCondition+00004629
[ 87] 0x00000001001274ba C:\Program Files\MATLAB\R2014b\bin\win64\libmwservices.dll+01275066 svWS_ProcessPendingEvents+00000138
[ 88] 0x00000000fd0a783d C:\Program Files\MATLAB\R2014b\bin\win64\mcr.dll+00161853 mcr::runtime::setInterpreterThreadToCurrent+00023677
[ 89] 0x00000000fd0a84aa C:\Program Files\MATLAB\R2014b\bin\win64\mcr.dll+00165034 mcr::runtime::setInterpreterThreadToCurrent+00026858
[ 90] 0x00000000fd0a0135 C:\Program Files\MATLAB\R2014b\bin\win64\mcr.dll+00131381 mcr_process_events+00007477
[ 91] 0x00000000fd0a1a12 C:\Program Files\MATLAB\R2014b\bin\win64\mcr.dll+00137746 mcr_process_events+00013842
[ 92] 0x0000000008078f2d C:\Program Files\MATLAB\R2014b\bin\win64\MVMLocal.dll+00167725 mvm_server::inproc::LocalFactory::terminate+00048285
[ 93] 0x00000000fa8ef1ea C:\Program Files\MATLAB\R2014b\bin\win64\mvm.dll+00782826 mvm::detail::initLocalMvmHack+00000490
[ 94] 0x00000000fa8ef7a8 C:\Program Files\MATLAB\R2014b\bin\win64\mvm.dll+00784296 mvm::detail::SessionImpl::privateSession+00000376
[ 95] 0x00000000fa8ef9f8 C:\Program Files\MATLAB\R2014b\bin\win64\mvm.dll+00784888 mvm::detail::SessionImpl::privateSession+00000968
[ 96] 0x0000000140005ddd C:\Program Files\MATLAB\R2014b\bin\win64\MATLAB.exe+00024029
[ 97] 0x0000000140007870 C:\Program Files\MATLAB\R2014b\bin\win64\MATLAB.exe+00030832
[ 98] 0x00007fff0d1f13d2 C:\WINDOWS\system32\KERNEL32.DLL+00005074 BaseThreadInitThunk+00000034
[ 99] 0x00007fff0f615444 C:\WINDOWS\SYSTEM32\ntdll.dll+00087108 RtlUserThreadStart+00000052
This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.
If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.
Thank you for your help.
I have a formula: |Xi-(1/n)*∑X-i|, and I am trying to apply it to a cell-type variable B with 27 rows * 10 columns in MATLAB, where X = B(:,10) , i = analyst and –i= all other analysts w/ exception from analyst i.
I am having problems in applying the sum function and putting it together with abs function and cell2mat. This is what I have so far:
B(:,11)=(abs(cell2mat(B(:,10)) - cell2mat((1./size(B,1))*sum(B(:,10)))));
I would like to get the sum of all the rows except the one that corresponds to the analyst i.
Can someone help me? Thanks for the help.
Try this code:
B(:,11)=num2cell(abs(cell2mat(B(:,10))-((1/size(B,1))*sum(cell2mat(B(:,10))))));
For example: Here "B" is a 27 X 10 cell array.
B =
[35] [76] [68] [59] [13] [63] [ 35] [ 47] [30] [ 7]
[15] [38] [50] [25] [21] [58] [ 45] [ 92] [ 5] [79]
[59] [22] [19] [67] [15] [ 6] [ 6] [ 11] [51] [34]
[27] [80] [50] [ 9] [19] [94] [ 18] [ 75] [77] [61]
[ 5] [95] [15] [63] [ 5] [73] [ 67] [ 74] [64] [75]
[76] [33] [ 6] [67] [64] [74] [ 34] [ 57] [ 9] [11]
[25] [68] [86] [73] [29] [ 7] [ 90] [ 19] [ 9] [13]
[45] [44] [57] [90] [54] [87] [ 12] [ 60] [78] [55]
[69] [84] [93] [99] [70] [94] [ 99] [ 30] [91] [49]
[36] [77] [70] [77] [50] [99] [ 54] [ 14] [54] [90]
[74] [17] [59] [59] [54] [86] [ 71] [ 22] [11] [80]
[40] [87] [82] [93] [45] [79] [100] [ 90] [83] [74]
[69] [99] [88] [59] [13] [52] [ 29] [ 8] [34] [ 6]
[71] [52] [99] [ 2] [50] [18] [ 42] [ 25] [30] [ 8]
[45] [89] [ 1] [13] [86] [40] [ 47] [ 6] [75] [ 9]
[ 2] [59] [87] [87] [88] [14] [ 77] [ 45] [ 2] [80]
[34] [16] [62] [49] [28] [ 4] [ 82] [ 2] [ 5] [95]
[43] [20] [99] [85] [21] [94] [ 11] [ 90] [67] [69]
[28] [41] [53] [21] [57] [31] [ 18] [ 20] [61] [14]
[20] [75] [48] [56] [65] [30] [ 36] [ 10] [53] [73]
[83] [83] [81] [63] [42] [34] [ 6] [ 31] [73] [12]
[43] [79] [23] [ 4] [21] [47] [ 53] [ 46] [71] [12]
[89] [32] [50] [62] [95] [65] [ 34] [ 11] [79] [65]
[40] [54] [91] [37] [ 9] [ 3] [ 18] [100] [29] [33]
[77] [ 9] [58] [ 5] [11] [85] [ 21] [ 34] [70] [66]
[40] [12] [85] [49] [15] [56] [ 91] [ 30] [56] [75]
[81] [14] [74] [20] [17] [86] [ 68] [ 7] [40] [59]
after executing the aforementioned code:
B =
Columns 1 through 10
[35] [76] [68] [59] [13] [63] [ 35] [ 47] [30] [ 7]
[15] [38] [50] [25] [21] [58] [ 45] [ 92] [ 5] [79]
[59] [22] [19] [67] [15] [ 6] [ 6] [ 11] [51] [34]
[27] [80] [50] [ 9] [19] [94] [ 18] [ 75] [77] [61]
[ 5] [95] [15] [63] [ 5] [73] [ 67] [ 74] [64] [75]
[76] [33] [ 6] [67] [64] [74] [ 34] [ 57] [ 9] [11]
[25] [68] [86] [73] [29] [ 7] [ 90] [ 19] [ 9] [13]
[45] [44] [57] [90] [54] [87] [ 12] [ 60] [78] [55]
[69] [84] [93] [99] [70] [94] [ 99] [ 30] [91] [49]
[36] [77] [70] [77] [50] [99] [ 54] [ 14] [54] [90]
[74] [17] [59] [59] [54] [86] [ 71] [ 22] [11] [80]
[40] [87] [82] [93] [45] [79] [100] [ 90] [83] [74]
[69] [99] [88] [59] [13] [52] [ 29] [ 8] [34] [ 6]
[71] [52] [99] [ 2] [50] [18] [ 42] [ 25] [30] [ 8]
[45] [89] [ 1] [13] [86] [40] [ 47] [ 6] [75] [ 9]
[ 2] [59] [87] [87] [88] [14] [ 77] [ 45] [ 2] [80]
[34] [16] [62] [49] [28] [ 4] [ 82] [ 2] [ 5] [95]
[43] [20] [99] [85] [21] [94] [ 11] [ 90] [67] [69]
[28] [41] [53] [21] [57] [31] [ 18] [ 20] [61] [14]
[20] [75] [48] [56] [65] [30] [ 36] [ 10] [53] [73]
[83] [83] [81] [63] [42] [34] [ 6] [ 31] [73] [12]
[43] [79] [23] [ 4] [21] [47] [ 53] [ 46] [71] [12]
[89] [32] [50] [62] [95] [65] [ 34] [ 11] [79] [65]
[40] [54] [91] [37] [ 9] [ 3] [ 18] [100] [29] [33]
[77] [ 9] [58] [ 5] [11] [85] [ 21] [ 34] [70] [66]
[40] [12] [85] [49] [15] [56] [ 91] [ 30] [56] [75]
[81] [14] [74] [20] [17] [86] [ 68] [ 7] [40] [59]
Column 11
[41.2963]
[30.7037]
[14.2963]
[12.7037]
[26.7037]
[37.2963]
[35.2963]
[ 6.7037]
[ 0.7037]
[41.7037]
[31.7037]
[25.7037]
[42.2963]
[40.2963]
[39.2963]
[31.7037]
[46.7037]
[20.7037]
[34.2963]
[24.7037]
[36.2963]
[36.2963]
[16.7037]
[15.2963]
[17.7037]
[26.7037]
[10.7037]