Category: Matlab
Category Archives: Matlab
Memory Allocation Error While Running Simulink
Im trying a simulation, it takes 7-8 hours in doing the whole simulation, but when it stops i get these 3 warnings/errors, which are making me lose the whole simulation.
My computer specs are:
Intel® Core™ i7-9750H
16GB RAM (2×8) 2666 MHz
256GB SSD
I’ve tried analyzing CPU and RAM’s usage to try to find where the problem occurs. RAM’s usage is around 5-7 Gb when the simulation is running, but when it goes to 100% and it starts terminating it uses the whole capacity of the memory, which I think is causing errors to the simulation. I’ve tried both using my pc while running the simulation and without using it, but both times it ended like this.
Is there any fix to this problem?Im trying a simulation, it takes 7-8 hours in doing the whole simulation, but when it stops i get these 3 warnings/errors, which are making me lose the whole simulation.
My computer specs are:
Intel® Core™ i7-9750H
16GB RAM (2×8) 2666 MHz
256GB SSD
I’ve tried analyzing CPU and RAM’s usage to try to find where the problem occurs. RAM’s usage is around 5-7 Gb when the simulation is running, but when it goes to 100% and it starts terminating it uses the whole capacity of the memory, which I think is causing errors to the simulation. I’ve tried both using my pc while running the simulation and without using it, but both times it ended like this.
Is there any fix to this problem? Im trying a simulation, it takes 7-8 hours in doing the whole simulation, but when it stops i get these 3 warnings/errors, which are making me lose the whole simulation.
My computer specs are:
Intel® Core™ i7-9750H
16GB RAM (2×8) 2666 MHz
256GB SSD
I’ve tried analyzing CPU and RAM’s usage to try to find where the problem occurs. RAM’s usage is around 5-7 Gb when the simulation is running, but when it goes to 100% and it starts terminating it uses the whole capacity of the memory, which I think is causing errors to the simulation. I’ve tried both using my pc while running the simulation and without using it, but both times it ended like this.
Is there any fix to this problem? memory allocation error, simulink MATLAB Answers — New Questions
MPLAB XC8 C Compiler
I have a question
I have used MPLAB XC16 C Compiler and MPLAB XC32 C Compiler in MATLAB Simulink environment and it was very useful.
But can MPLAB XC8 C Compiler also be used in MATLAB Simulink?
I have read a lot of information on this site about MPLAB XC8 C Compiler, but I don’t understand anything.
Site address:
https://nl.mathworks.com/help/bugfinder/ref/mplabxc8ccompilercompilermicrochip.html?searchHighlight=XC8%20C%20Compiler&s_tid=srchtitle_support_results_1_XC8%20C%20Compiler#mw_08216afd-f7cc-4b49-bf9d-cc323f130c3e_seealso
thanks a lotI have a question
I have used MPLAB XC16 C Compiler and MPLAB XC32 C Compiler in MATLAB Simulink environment and it was very useful.
But can MPLAB XC8 C Compiler also be used in MATLAB Simulink?
I have read a lot of information on this site about MPLAB XC8 C Compiler, but I don’t understand anything.
Site address:
https://nl.mathworks.com/help/bugfinder/ref/mplabxc8ccompilercompilermicrochip.html?searchHighlight=XC8%20C%20Compiler&s_tid=srchtitle_support_results_1_XC8%20C%20Compiler#mw_08216afd-f7cc-4b49-bf9d-cc323f130c3e_seealso
thanks a lot I have a question
I have used MPLAB XC16 C Compiler and MPLAB XC32 C Compiler in MATLAB Simulink environment and it was very useful.
But can MPLAB XC8 C Compiler also be used in MATLAB Simulink?
I have read a lot of information on this site about MPLAB XC8 C Compiler, but I don’t understand anything.
Site address:
https://nl.mathworks.com/help/bugfinder/ref/mplabxc8ccompilercompilermicrochip.html?searchHighlight=XC8%20C%20Compiler&s_tid=srchtitle_support_results_1_XC8%20C%20Compiler#mw_08216afd-f7cc-4b49-bf9d-cc323f130c3e_seealso
thanks a lot mplab xc8 c compiler, mplab, simulink MATLAB Answers — New Questions
Automate install – pass license information
2023b – Setup.exe passing ‘installer_input.txt’ properties to help simplify the install for users, works great for install key and network license location etc but is there a way to also keep it interactive so user can select needed toolboxes? Dont really want to install them all if the user doesnt even want them.
I see refrences to mode= but seems that has been removed since 2020versions?
Is there an alternative in the 2023 versons?2023b – Setup.exe passing ‘installer_input.txt’ properties to help simplify the install for users, works great for install key and network license location etc but is there a way to also keep it interactive so user can select needed toolboxes? Dont really want to install them all if the user doesnt even want them.
I see refrences to mode= but seems that has been removed since 2020versions?
Is there an alternative in the 2023 versons? 2023b – Setup.exe passing ‘installer_input.txt’ properties to help simplify the install for users, works great for install key and network license location etc but is there a way to also keep it interactive so user can select needed toolboxes? Dont really want to install them all if the user doesnt even want them.
I see refrences to mode= but seems that has been removed since 2020versions?
Is there an alternative in the 2023 versons? automated install, silent install, interactive install MATLAB Answers — New Questions
“PyCapsule_Import could not import module ‘libmwbuffer’ “error when converting to numpy
Is this a bug unique to this version R2024a ? I have never seen such a error before, when I used the older version.Is this a bug unique to this version R2024a ? I have never seen such a error before, when I used the older version. Is this a bug unique to this version R2024a ? I have never seen such a error before, when I used the older version. numpy, libmwbuffer, matlab MATLAB Answers — New Questions
Unable to Insert Blocks by Typing Directly in Simulink (MATLAB 2017a)
Hi, I’m using MATLAB 2017a and Simulink, but when I click on the canvas and type a block name (e.g., "constant"), it only creates a comment, not a block.
Is this feature available in 2017a, or is there something I need to enable? If it’s not supported, is there a faster way to insert blocks?
Thanks for your help!Hi, I’m using MATLAB 2017a and Simulink, but when I click on the canvas and type a block name (e.g., "constant"), it only creates a comment, not a block.
Is this feature available in 2017a, or is there something I need to enable? If it’s not supported, is there a faster way to insert blocks?
Thanks for your help! Hi, I’m using MATLAB 2017a and Simulink, but when I click on the canvas and type a block name (e.g., "constant"), it only creates a comment, not a block.
Is this feature available in 2017a, or is there something I need to enable? If it’s not supported, is there a faster way to insert blocks?
Thanks for your help! simulink-blocks, blocks, simulink-issue, block-insertion, simulink MATLAB Answers — New Questions
How to modify modem.qammod for the latest MATLAB version?
clc ;
clear all ;
close all ;
m =512; % Total number of OFDM symbols
N =1024; % Length of each OFDM symbol
M =4; % Size of the Constellation ( M can be 4 , 8 , 16 ,32 , 64 , 128 , 256)
pilotFrequency =8 ; % Pilot Symbol insertion frequency
E =2; % Energy of each Pilot Symbol
Ncp =256 ; % Length of the Cyclic Prefix
Tx = modem.qammod (‘M’,M ) ; % Choosing the modulation format as M – ary Quadrature Amplitude Modulation (M- QAM )
Rx = modem.qamdemod (‘M’,M) ; % Fixing up the demodulation format at the receiving end as M – ary QAM
% ACO – OFDM Transmitter
Data = randi ([0 M-1] ,m , N ); % Generation of Random bits Matrix of size m by N
for k1 =1: m
for m1 =1: N
if mod ( m1 ,2) ==0 % Performing Modulo operation to extract the even subcarriers
Data ( k1 , m1 ) =0; % Setting the Even Subcarriers to Zero
end
end
end
DataMod = modulate ( Tx , Data ) ; % Performing Data Modulation
DataMod_serialtoparallel = DataMod .’; % Performing Serial to Parallel Conversion
PLoc = 1: pilotFrequency :N ; % Fixing the location of Pilot carrires
DLoc = setxor (1: N , PLoc ) ; % Fixing the location of Data subcarriers
DataMod_serialtoparallel ( PLoc ,:) = E*DataMod_serialtoparallel ( PLoc ,:) ; % Inserting Pilot carriers
datamat = DataMod_serialtoparallel ; % Assigning the total data including the pilots to a variable called datamat
% Computation of Hermitian Symmetry Criteria
datamat (1 ,:) =0; % Assigning the First subcarrier to Zero
datamat (513 ,:) =0; % Assigning the Middle Subcarrier to Zero
datamat (514:1024 ,:) = flipud ( conj ( datamat (2:512 ,:) )) ; % Illustrating that only half of the subcarriers are exploited for data transmission as the remaining half are flipped complex conjugate versions of the previous ones .
d_ifft = ifft (( datamat ) ) ; % Computation of IFFT operation
% Ensuring that only the positive portion of the signal is transmitted
for k2 =1: N
for m2 =1: m
if( d_ifft ( k2 , m2 ) <0)
d_ifft ( k2 , m2 ) =0;
end
end
end
d_ifft_paralleltoserial = d_ifft .’; % Parallel to Serial Conversion
CP_part = d_ifft_paralleltoserial (: ,end – Ncp +1: end) ; %Addition of Cyclic Prefix
ACOOFDM_CP =[ CP_part d_ifft_paralleltoserial ]; %Transmissin of ACO – OFDM signal
% VLC Channel Modeling
theta = 70; %LED semi – angle
ml = – log10 (2) / log10 ( cos ( theta ) ) ; % Computation of Lambertian Mode Number
APD =0.01; % Area of the photodiode
lx =5; ly =5; lz =3; % Size of the Dimensions of the Indoor Room Environment
h =2.15;
[ XT , YT ]= meshgrid ([ – lx /4 lx /4] ,[ – ly /4 ly /4]) ;
Nx = lx *5; Ny = ly *5;
x = linspace ( – lx /2 , lx /2 , Nx );
y = linspace ( – ly /2 , ly /2 , Ny );
[ XR , YR ]= meshgrid (x , y );
D1 = sqrt (( XR – XT (1 ,1) ) .^2+( YR – YT (1 ,1) ) .^2+ h ^2) ;
D2 = sqrt (( XR – XT (2 ,2) ) .^2+( YR – YT (2 ,2) ) .^2+ h ^2) ;
cosphi_A1 = h ./ D1 ;
receiver_angle = acosd ( cosphi_A1 ) ;
H_A1 =3600*(( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .* D1.^2) +( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .^2* D1.^2* D2 .^2) ) ; % Computation of VLC channel Impulse Response taking into consideration Non Line of Sight ( NLOS ) Environment
H_A2 = H_A1 ./ norm ( H_A1 );
d_channell = filter ( H_A2 (1 ,1:2) ,1 , ACOOFDM_CP .’) .’; %Illustration of channel effect on the transmitted ACO – OFDM signal
count =0;
snr_vector =0:1:30; % size of signal to noise ratio (SNR ) vector
for snr = snr_vector
SNR = snr + 10* log10 ( log2 (M ) ) ;
count = count +1 ;
ACOOFDM_with_chann = awgn(d_channell , SNR ,’measured’) ; % Addition of AWGN
% Receiver of ACO – OFDM
ACOOFDM_removal_CP = ACOOFDM_with_chann (: , Ncp+1: N + Ncp );
% Removal of Cyclic Prefix
ACOOFDM_serialtoparallel = ACOOFDM_removal_CP .’; %Serial to Parallel Conversion
ACOOFDM_parallel_fft = fft ( ACOOFDM_serialtoparallel) ;
% Computation of FFT operation
% Channel Estimation
TransmittedPilots = DataMod_serialtoparallel ( PLoc,:) ; % Extracting the transmitted pilots
ReceivedPilots = ACOOFDM_parallel_fft ( PLoc ,:) ;
%Extracting the received pilot tones effected by channel
for r =1:m
H_MMSE(: , r ) = MMSE(ReceivedPilots(: , r ) ,TransmittedPilots(: , r ), N, pilotFrequency, H_A2(1 ,1:2), SNR);% Minimum Mean SquareError ( MMSE ) Channel Estimation
end
HData_MMSE_parallel1 = H_MMSE.’;
ACOOFDM_SERIAL_MMSE = demodulate(Rx ,(ACOOFDM_parallel_fft.’)./( HData_MMSE_parallel1) ) ;
% Recovery of Pilots from the Original Transmitted signal and Received Signal
Data_no_pilots = Data (: , DLoc ) ;
Recovered_Pilot_MMSE = ACOOFDM_SERIAL_MMSE (: , DLoc ) ;
% Computation of Bit Error Rate
[~ , recoveredMMSE( count ) ]= biterr ( Data_no_pilots (: ,2:255) , Recovered_Pilot_MMSE (: ,2:255) ) ;
end
% Plotting the BER curves
semilogy ( snr_vector , recoveredMMSE ,’gs -‘,’LineWidth’,2) ;
axis ([0 30 10^ -4 1]) ;
grid on ;
function H_MMSE = MMSE(RxP,TxP,N,pilotFrequency,h_CIR,SNR)
% I modified the MMSE_CE function provided in :MIMO-OFDM Wireless
% Communications with MATLAB¢ç Yong Soo Cho, Jaekwon Kim,
% Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd
% The modification made the function more suitable with my OFDM Matlab code
noiseVar = 10^(SNR*0.1);
Np=N/pilotFrequency; % Number of Pilots
H_LS = RxP./TxP; % LS estimate
k=0:length(h_CIR)-1;
hh = h_CIR*h_CIR’;
% tmp = h_CIR.*conj(h_CIR).*k;
r = sum(h_CIR.*conj(h_CIR).*k)/hh;
r2 = (h_CIR.*conj(h_CIR).*k)*k.’/hh;
t_rms = sqrt(r2-r^2); % rms delay
D = 1j*2*pi*t_rms/N; % Denomerator of Eq. (6.16) page 192
K1 = repmat([0:N-1].’,1,Np);
K2 = repmat([0:Np-1],N,1);
rf = 1./(1+D*(K1-K2*pilotFrequency));
K3 = repmat([0:Np-1].’,1,Np);
K4 = repmat([0:Np-1],Np,1);
rf2 = 1./(1+D*pilotFrequency*(K3-K4));
Rhp = rf;
Rpp = rf2 + eye(length(H_LS),length(H_LS))/noiseVar;
H_MMSE = transpose(Rhp*inv(Rpp)*H_LS); % MMSE channel estimate
endclc ;
clear all ;
close all ;
m =512; % Total number of OFDM symbols
N =1024; % Length of each OFDM symbol
M =4; % Size of the Constellation ( M can be 4 , 8 , 16 ,32 , 64 , 128 , 256)
pilotFrequency =8 ; % Pilot Symbol insertion frequency
E =2; % Energy of each Pilot Symbol
Ncp =256 ; % Length of the Cyclic Prefix
Tx = modem.qammod (‘M’,M ) ; % Choosing the modulation format as M – ary Quadrature Amplitude Modulation (M- QAM )
Rx = modem.qamdemod (‘M’,M) ; % Fixing up the demodulation format at the receiving end as M – ary QAM
% ACO – OFDM Transmitter
Data = randi ([0 M-1] ,m , N ); % Generation of Random bits Matrix of size m by N
for k1 =1: m
for m1 =1: N
if mod ( m1 ,2) ==0 % Performing Modulo operation to extract the even subcarriers
Data ( k1 , m1 ) =0; % Setting the Even Subcarriers to Zero
end
end
end
DataMod = modulate ( Tx , Data ) ; % Performing Data Modulation
DataMod_serialtoparallel = DataMod .’; % Performing Serial to Parallel Conversion
PLoc = 1: pilotFrequency :N ; % Fixing the location of Pilot carrires
DLoc = setxor (1: N , PLoc ) ; % Fixing the location of Data subcarriers
DataMod_serialtoparallel ( PLoc ,:) = E*DataMod_serialtoparallel ( PLoc ,:) ; % Inserting Pilot carriers
datamat = DataMod_serialtoparallel ; % Assigning the total data including the pilots to a variable called datamat
% Computation of Hermitian Symmetry Criteria
datamat (1 ,:) =0; % Assigning the First subcarrier to Zero
datamat (513 ,:) =0; % Assigning the Middle Subcarrier to Zero
datamat (514:1024 ,:) = flipud ( conj ( datamat (2:512 ,:) )) ; % Illustrating that only half of the subcarriers are exploited for data transmission as the remaining half are flipped complex conjugate versions of the previous ones .
d_ifft = ifft (( datamat ) ) ; % Computation of IFFT operation
% Ensuring that only the positive portion of the signal is transmitted
for k2 =1: N
for m2 =1: m
if( d_ifft ( k2 , m2 ) <0)
d_ifft ( k2 , m2 ) =0;
end
end
end
d_ifft_paralleltoserial = d_ifft .’; % Parallel to Serial Conversion
CP_part = d_ifft_paralleltoserial (: ,end – Ncp +1: end) ; %Addition of Cyclic Prefix
ACOOFDM_CP =[ CP_part d_ifft_paralleltoserial ]; %Transmissin of ACO – OFDM signal
% VLC Channel Modeling
theta = 70; %LED semi – angle
ml = – log10 (2) / log10 ( cos ( theta ) ) ; % Computation of Lambertian Mode Number
APD =0.01; % Area of the photodiode
lx =5; ly =5; lz =3; % Size of the Dimensions of the Indoor Room Environment
h =2.15;
[ XT , YT ]= meshgrid ([ – lx /4 lx /4] ,[ – ly /4 ly /4]) ;
Nx = lx *5; Ny = ly *5;
x = linspace ( – lx /2 , lx /2 , Nx );
y = linspace ( – ly /2 , ly /2 , Ny );
[ XR , YR ]= meshgrid (x , y );
D1 = sqrt (( XR – XT (1 ,1) ) .^2+( YR – YT (1 ,1) ) .^2+ h ^2) ;
D2 = sqrt (( XR – XT (2 ,2) ) .^2+( YR – YT (2 ,2) ) .^2+ h ^2) ;
cosphi_A1 = h ./ D1 ;
receiver_angle = acosd ( cosphi_A1 ) ;
H_A1 =3600*(( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .* D1.^2) +( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .^2* D1.^2* D2 .^2) ) ; % Computation of VLC channel Impulse Response taking into consideration Non Line of Sight ( NLOS ) Environment
H_A2 = H_A1 ./ norm ( H_A1 );
d_channell = filter ( H_A2 (1 ,1:2) ,1 , ACOOFDM_CP .’) .’; %Illustration of channel effect on the transmitted ACO – OFDM signal
count =0;
snr_vector =0:1:30; % size of signal to noise ratio (SNR ) vector
for snr = snr_vector
SNR = snr + 10* log10 ( log2 (M ) ) ;
count = count +1 ;
ACOOFDM_with_chann = awgn(d_channell , SNR ,’measured’) ; % Addition of AWGN
% Receiver of ACO – OFDM
ACOOFDM_removal_CP = ACOOFDM_with_chann (: , Ncp+1: N + Ncp );
% Removal of Cyclic Prefix
ACOOFDM_serialtoparallel = ACOOFDM_removal_CP .’; %Serial to Parallel Conversion
ACOOFDM_parallel_fft = fft ( ACOOFDM_serialtoparallel) ;
% Computation of FFT operation
% Channel Estimation
TransmittedPilots = DataMod_serialtoparallel ( PLoc,:) ; % Extracting the transmitted pilots
ReceivedPilots = ACOOFDM_parallel_fft ( PLoc ,:) ;
%Extracting the received pilot tones effected by channel
for r =1:m
H_MMSE(: , r ) = MMSE(ReceivedPilots(: , r ) ,TransmittedPilots(: , r ), N, pilotFrequency, H_A2(1 ,1:2), SNR);% Minimum Mean SquareError ( MMSE ) Channel Estimation
end
HData_MMSE_parallel1 = H_MMSE.’;
ACOOFDM_SERIAL_MMSE = demodulate(Rx ,(ACOOFDM_parallel_fft.’)./( HData_MMSE_parallel1) ) ;
% Recovery of Pilots from the Original Transmitted signal and Received Signal
Data_no_pilots = Data (: , DLoc ) ;
Recovered_Pilot_MMSE = ACOOFDM_SERIAL_MMSE (: , DLoc ) ;
% Computation of Bit Error Rate
[~ , recoveredMMSE( count ) ]= biterr ( Data_no_pilots (: ,2:255) , Recovered_Pilot_MMSE (: ,2:255) ) ;
end
% Plotting the BER curves
semilogy ( snr_vector , recoveredMMSE ,’gs -‘,’LineWidth’,2) ;
axis ([0 30 10^ -4 1]) ;
grid on ;
function H_MMSE = MMSE(RxP,TxP,N,pilotFrequency,h_CIR,SNR)
% I modified the MMSE_CE function provided in :MIMO-OFDM Wireless
% Communications with MATLAB¢ç Yong Soo Cho, Jaekwon Kim,
% Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd
% The modification made the function more suitable with my OFDM Matlab code
noiseVar = 10^(SNR*0.1);
Np=N/pilotFrequency; % Number of Pilots
H_LS = RxP./TxP; % LS estimate
k=0:length(h_CIR)-1;
hh = h_CIR*h_CIR’;
% tmp = h_CIR.*conj(h_CIR).*k;
r = sum(h_CIR.*conj(h_CIR).*k)/hh;
r2 = (h_CIR.*conj(h_CIR).*k)*k.’/hh;
t_rms = sqrt(r2-r^2); % rms delay
D = 1j*2*pi*t_rms/N; % Denomerator of Eq. (6.16) page 192
K1 = repmat([0:N-1].’,1,Np);
K2 = repmat([0:Np-1],N,1);
rf = 1./(1+D*(K1-K2*pilotFrequency));
K3 = repmat([0:Np-1].’,1,Np);
K4 = repmat([0:Np-1],Np,1);
rf2 = 1./(1+D*pilotFrequency*(K3-K4));
Rhp = rf;
Rpp = rf2 + eye(length(H_LS),length(H_LS))/noiseVar;
H_MMSE = transpose(Rhp*inv(Rpp)*H_LS); % MMSE channel estimate
end clc ;
clear all ;
close all ;
m =512; % Total number of OFDM symbols
N =1024; % Length of each OFDM symbol
M =4; % Size of the Constellation ( M can be 4 , 8 , 16 ,32 , 64 , 128 , 256)
pilotFrequency =8 ; % Pilot Symbol insertion frequency
E =2; % Energy of each Pilot Symbol
Ncp =256 ; % Length of the Cyclic Prefix
Tx = modem.qammod (‘M’,M ) ; % Choosing the modulation format as M – ary Quadrature Amplitude Modulation (M- QAM )
Rx = modem.qamdemod (‘M’,M) ; % Fixing up the demodulation format at the receiving end as M – ary QAM
% ACO – OFDM Transmitter
Data = randi ([0 M-1] ,m , N ); % Generation of Random bits Matrix of size m by N
for k1 =1: m
for m1 =1: N
if mod ( m1 ,2) ==0 % Performing Modulo operation to extract the even subcarriers
Data ( k1 , m1 ) =0; % Setting the Even Subcarriers to Zero
end
end
end
DataMod = modulate ( Tx , Data ) ; % Performing Data Modulation
DataMod_serialtoparallel = DataMod .’; % Performing Serial to Parallel Conversion
PLoc = 1: pilotFrequency :N ; % Fixing the location of Pilot carrires
DLoc = setxor (1: N , PLoc ) ; % Fixing the location of Data subcarriers
DataMod_serialtoparallel ( PLoc ,:) = E*DataMod_serialtoparallel ( PLoc ,:) ; % Inserting Pilot carriers
datamat = DataMod_serialtoparallel ; % Assigning the total data including the pilots to a variable called datamat
% Computation of Hermitian Symmetry Criteria
datamat (1 ,:) =0; % Assigning the First subcarrier to Zero
datamat (513 ,:) =0; % Assigning the Middle Subcarrier to Zero
datamat (514:1024 ,:) = flipud ( conj ( datamat (2:512 ,:) )) ; % Illustrating that only half of the subcarriers are exploited for data transmission as the remaining half are flipped complex conjugate versions of the previous ones .
d_ifft = ifft (( datamat ) ) ; % Computation of IFFT operation
% Ensuring that only the positive portion of the signal is transmitted
for k2 =1: N
for m2 =1: m
if( d_ifft ( k2 , m2 ) <0)
d_ifft ( k2 , m2 ) =0;
end
end
end
d_ifft_paralleltoserial = d_ifft .’; % Parallel to Serial Conversion
CP_part = d_ifft_paralleltoserial (: ,end – Ncp +1: end) ; %Addition of Cyclic Prefix
ACOOFDM_CP =[ CP_part d_ifft_paralleltoserial ]; %Transmissin of ACO – OFDM signal
% VLC Channel Modeling
theta = 70; %LED semi – angle
ml = – log10 (2) / log10 ( cos ( theta ) ) ; % Computation of Lambertian Mode Number
APD =0.01; % Area of the photodiode
lx =5; ly =5; lz =3; % Size of the Dimensions of the Indoor Room Environment
h =2.15;
[ XT , YT ]= meshgrid ([ – lx /4 lx /4] ,[ – ly /4 ly /4]) ;
Nx = lx *5; Ny = ly *5;
x = linspace ( – lx /2 , lx /2 , Nx );
y = linspace ( – ly /2 , ly /2 , Ny );
[ XR , YR ]= meshgrid (x , y );
D1 = sqrt (( XR – XT (1 ,1) ) .^2+( YR – YT (1 ,1) ) .^2+ h ^2) ;
D2 = sqrt (( XR – XT (2 ,2) ) .^2+( YR – YT (2 ,2) ) .^2+ h ^2) ;
cosphi_A1 = h ./ D1 ;
receiver_angle = acosd ( cosphi_A1 ) ;
H_A1 =3600*(( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .* D1.^2) +( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .^2* D1.^2* D2 .^2) ) ; % Computation of VLC channel Impulse Response taking into consideration Non Line of Sight ( NLOS ) Environment
H_A2 = H_A1 ./ norm ( H_A1 );
d_channell = filter ( H_A2 (1 ,1:2) ,1 , ACOOFDM_CP .’) .’; %Illustration of channel effect on the transmitted ACO – OFDM signal
count =0;
snr_vector =0:1:30; % size of signal to noise ratio (SNR ) vector
for snr = snr_vector
SNR = snr + 10* log10 ( log2 (M ) ) ;
count = count +1 ;
ACOOFDM_with_chann = awgn(d_channell , SNR ,’measured’) ; % Addition of AWGN
% Receiver of ACO – OFDM
ACOOFDM_removal_CP = ACOOFDM_with_chann (: , Ncp+1: N + Ncp );
% Removal of Cyclic Prefix
ACOOFDM_serialtoparallel = ACOOFDM_removal_CP .’; %Serial to Parallel Conversion
ACOOFDM_parallel_fft = fft ( ACOOFDM_serialtoparallel) ;
% Computation of FFT operation
% Channel Estimation
TransmittedPilots = DataMod_serialtoparallel ( PLoc,:) ; % Extracting the transmitted pilots
ReceivedPilots = ACOOFDM_parallel_fft ( PLoc ,:) ;
%Extracting the received pilot tones effected by channel
for r =1:m
H_MMSE(: , r ) = MMSE(ReceivedPilots(: , r ) ,TransmittedPilots(: , r ), N, pilotFrequency, H_A2(1 ,1:2), SNR);% Minimum Mean SquareError ( MMSE ) Channel Estimation
end
HData_MMSE_parallel1 = H_MMSE.’;
ACOOFDM_SERIAL_MMSE = demodulate(Rx ,(ACOOFDM_parallel_fft.’)./( HData_MMSE_parallel1) ) ;
% Recovery of Pilots from the Original Transmitted signal and Received Signal
Data_no_pilots = Data (: , DLoc ) ;
Recovered_Pilot_MMSE = ACOOFDM_SERIAL_MMSE (: , DLoc ) ;
% Computation of Bit Error Rate
[~ , recoveredMMSE( count ) ]= biterr ( Data_no_pilots (: ,2:255) , Recovered_Pilot_MMSE (: ,2:255) ) ;
end
% Plotting the BER curves
semilogy ( snr_vector , recoveredMMSE ,’gs -‘,’LineWidth’,2) ;
axis ([0 30 10^ -4 1]) ;
grid on ;
function H_MMSE = MMSE(RxP,TxP,N,pilotFrequency,h_CIR,SNR)
% I modified the MMSE_CE function provided in :MIMO-OFDM Wireless
% Communications with MATLAB¢ç Yong Soo Cho, Jaekwon Kim,
% Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd
% The modification made the function more suitable with my OFDM Matlab code
noiseVar = 10^(SNR*0.1);
Np=N/pilotFrequency; % Number of Pilots
H_LS = RxP./TxP; % LS estimate
k=0:length(h_CIR)-1;
hh = h_CIR*h_CIR’;
% tmp = h_CIR.*conj(h_CIR).*k;
r = sum(h_CIR.*conj(h_CIR).*k)/hh;
r2 = (h_CIR.*conj(h_CIR).*k)*k.’/hh;
t_rms = sqrt(r2-r^2); % rms delay
D = 1j*2*pi*t_rms/N; % Denomerator of Eq. (6.16) page 192
K1 = repmat([0:N-1].’,1,Np);
K2 = repmat([0:Np-1],N,1);
rf = 1./(1+D*(K1-K2*pilotFrequency));
K3 = repmat([0:Np-1].’,1,Np);
K4 = repmat([0:Np-1],Np,1);
rf2 = 1./(1+D*pilotFrequency*(K3-K4));
Rhp = rf;
Rpp = rf2 + eye(length(H_LS),length(H_LS))/noiseVar;
H_MMSE = transpose(Rhp*inv(Rpp)*H_LS); % MMSE channel estimate
end matlab, ofdm, channel estimation, visible light communication, ber, snr, modem.qammod, qammod MATLAB Answers — New Questions
set simulnk Scope Property—-BackgroundColor
i‘m try to set simulnk Scope Property—-BackgroundColor; use below code ,it works, but when close and reopen the model, the property recovered to default;
open_system([modelname ‘/scop4sim’]);
set(0,’ShowHiddenHandles’,’On’)
handles = guihandles(gcf);
handles.VisualizationPanel.BackgroundColor=[1 1 0];
but when set the BackgroundColor use style GUI by mouse,then close and reopen ,the BackgroundColor property is the set Vaule by mouse,not recovered;
so what’s the problem, why set by code reopen model Scope not save the property seted;i‘m try to set simulnk Scope Property—-BackgroundColor; use below code ,it works, but when close and reopen the model, the property recovered to default;
open_system([modelname ‘/scop4sim’]);
set(0,’ShowHiddenHandles’,’On’)
handles = guihandles(gcf);
handles.VisualizationPanel.BackgroundColor=[1 1 0];
but when set the BackgroundColor use style GUI by mouse,then close and reopen ,the BackgroundColor property is the set Vaule by mouse,not recovered;
so what’s the problem, why set by code reopen model Scope not save the property seted; i‘m try to set simulnk Scope Property—-BackgroundColor; use below code ,it works, but when close and reopen the model, the property recovered to default;
open_system([modelname ‘/scop4sim’]);
set(0,’ShowHiddenHandles’,’On’)
handles = guihandles(gcf);
handles.VisualizationPanel.BackgroundColor=[1 1 0];
but when set the BackgroundColor use style GUI by mouse,then close and reopen ,the BackgroundColor property is the set Vaule by mouse,not recovered;
so what’s the problem, why set by code reopen model Scope not save the property seted; simulink, scope, property set MATLAB Answers — New Questions
Is there a good way to use the Optuna hyperparameter optimization framework in MATLAB?
As we all know, Optuna is a well-regarded hyperparameter optimization framework that is independent of any machine learning framework and is very easy to use in Python. However, my cost object-function is in MATLAB, which typically belongs to black-box optimization, and I am unsure how to use the Optuna library.
I also know that the Statistics and Machine Learning Toolbox has techniques like random search, grid search, and Bayesian hyperparameter optimization, but they haven’t performed very well. The Global Optimization Toolbox can use heuristic search algorithms such as GA and PSO, but I am limited by the high computational cost of the cost function. I also tried surrogateopt. Although the iteration speed is relatively fast, it tends to get stuck in local optima, causing subsequent iterations to nearly stop. Overall, it doesn’t perform as well as the PSO algorithm! Therefore, I would like to explore the performance of the Optuna library.As we all know, Optuna is a well-regarded hyperparameter optimization framework that is independent of any machine learning framework and is very easy to use in Python. However, my cost object-function is in MATLAB, which typically belongs to black-box optimization, and I am unsure how to use the Optuna library.
I also know that the Statistics and Machine Learning Toolbox has techniques like random search, grid search, and Bayesian hyperparameter optimization, but they haven’t performed very well. The Global Optimization Toolbox can use heuristic search algorithms such as GA and PSO, but I am limited by the high computational cost of the cost function. I also tried surrogateopt. Although the iteration speed is relatively fast, it tends to get stuck in local optima, causing subsequent iterations to nearly stop. Overall, it doesn’t perform as well as the PSO algorithm! Therefore, I would like to explore the performance of the Optuna library. As we all know, Optuna is a well-regarded hyperparameter optimization framework that is independent of any machine learning framework and is very easy to use in Python. However, my cost object-function is in MATLAB, which typically belongs to black-box optimization, and I am unsure how to use the Optuna library.
I also know that the Statistics and Machine Learning Toolbox has techniques like random search, grid search, and Bayesian hyperparameter optimization, but they haven’t performed very well. The Global Optimization Toolbox can use heuristic search algorithms such as GA and PSO, but I am limited by the high computational cost of the cost function. I also tried surrogateopt. Although the iteration speed is relatively fast, it tends to get stuck in local optima, causing subsequent iterations to nearly stop. Overall, it doesn’t perform as well as the PSO algorithm! Therefore, I would like to explore the performance of the Optuna library. hyperparameter optimization, statistics, machine learning MATLAB Answers — New Questions
the squential feature selection with Sequentialfs function
Hi all,
I’m having trouble with feature selection; could someone please assist me?
My code is:
X = trainingFeatures;
y = trainingLabels;
c = cvpartition(y,’k’,10);
opts = statset(‘display’,’iter’);
fun = @(XT,yT,Xt,yt)…
(sum(~strcmp(yt,classify(Xt,XT,yT,’quadratic’))));
[fs,history] = sequentialfs(fun,X,y,’cv’,c,’options’,opts);
When we run the code, we get:Hi all,
I’m having trouble with feature selection; could someone please assist me?
My code is:
X = trainingFeatures;
y = trainingLabels;
c = cvpartition(y,’k’,10);
opts = statset(‘display’,’iter’);
fun = @(XT,yT,Xt,yt)…
(sum(~strcmp(yt,classify(Xt,XT,yT,’quadratic’))));
[fs,history] = sequentialfs(fun,X,y,’cv’,c,’options’,opts);
When we run the code, we get: Hi all,
I’m having trouble with feature selection; could someone please assist me?
My code is:
X = trainingFeatures;
y = trainingLabels;
c = cvpartition(y,’k’,10);
opts = statset(‘display’,’iter’);
fun = @(XT,yT,Xt,yt)…
(sum(~strcmp(yt,classify(Xt,XT,yT,’quadratic’))));
[fs,history] = sequentialfs(fun,X,y,’cv’,c,’options’,opts);
When we run the code, we get: feature selection, image processing, sequentialfs, machine learning, artificial intelligence MATLAB Answers — New Questions
Resulting Model Workspace when using Simulink InputObject
Hello,
I am currently playing around in using the model workspace in Simulink and overwriting some of the variables via the Simulink InputObject. But I am facing an issue: How do I know what I simulated in the end. E.g. I would like to put the value of certain parameters in the figures I programatically generate. Or I simply would like to store the parameter set alongside the simulation results.
So the question is: How can I retrieve the resulting state of the model workspace, when using a Simulink InputObject when simulating with the sim command?
I mean I could make sure, that the InputObject provides values for all the variables in the model workspace. This way I could retrieve the state from the InputObject or the source, which feeds the InputObject. But then I would loose the flexibility to relay on default values stored in the model workspace itself.
Thank you for your help in advance.Hello,
I am currently playing around in using the model workspace in Simulink and overwriting some of the variables via the Simulink InputObject. But I am facing an issue: How do I know what I simulated in the end. E.g. I would like to put the value of certain parameters in the figures I programatically generate. Or I simply would like to store the parameter set alongside the simulation results.
So the question is: How can I retrieve the resulting state of the model workspace, when using a Simulink InputObject when simulating with the sim command?
I mean I could make sure, that the InputObject provides values for all the variables in the model workspace. This way I could retrieve the state from the InputObject or the source, which feeds the InputObject. But then I would loose the flexibility to relay on default values stored in the model workspace itself.
Thank you for your help in advance. Hello,
I am currently playing around in using the model workspace in Simulink and overwriting some of the variables via the Simulink InputObject. But I am facing an issue: How do I know what I simulated in the end. E.g. I would like to put the value of certain parameters in the figures I programatically generate. Or I simply would like to store the parameter set alongside the simulation results.
So the question is: How can I retrieve the resulting state of the model workspace, when using a Simulink InputObject when simulating with the sim command?
I mean I could make sure, that the InputObject provides values for all the variables in the model workspace. This way I could retrieve the state from the InputObject or the source, which feeds the InputObject. But then I would loose the flexibility to relay on default values stored in the model workspace itself.
Thank you for your help in advance. simulink, workspace MATLAB Answers — New Questions
generated “unvaforable zero” value from multiplying two matrices, how to solve/correct it?
for simplicity, i have a two matrices A and B generated by matlab like below. when i calculated manually by excel with the function mmult(A;B) the value of C is vaforable like this. even when i increasing the decimal. especially the value of cell matrix C at 3,1 it was definetly zero
but when i multiply them in matlab i got value of C like this
how to deal with this type of problem? any guidance will help me alot, because i got bunch of wild value zero like this 🙁 thanks a lott.
the following attachments is my full code, matrix A is k_sup and matrix B is uaa, and matrix C is Fsupt in my line code. input3Dxlsx is my input.
P.S
i tried calculate separately with new script (like the following A*B bottom), copy those matrices from generated excel (so the value is accurate), and the generated value of matrix C is entirely different, like this:
here is the following matrix A and B i copy from generated excel
A = [-3710000000 0 0 0 0 0;
0 -12624305.56 0 0 0 75745833.33;
0 0 -2318750 0 -13912500 0;
0 0 0 -69358333.33 0 0;
0 0 13912500 0 55650000 0;
0 -75745833.33 0 0 0 302983333.3]
B = [0
0
-0.025876011
0
0.004312668
0]
C = A*Bfor simplicity, i have a two matrices A and B generated by matlab like below. when i calculated manually by excel with the function mmult(A;B) the value of C is vaforable like this. even when i increasing the decimal. especially the value of cell matrix C at 3,1 it was definetly zero
but when i multiply them in matlab i got value of C like this
how to deal with this type of problem? any guidance will help me alot, because i got bunch of wild value zero like this 🙁 thanks a lott.
the following attachments is my full code, matrix A is k_sup and matrix B is uaa, and matrix C is Fsupt in my line code. input3Dxlsx is my input.
P.S
i tried calculate separately with new script (like the following A*B bottom), copy those matrices from generated excel (so the value is accurate), and the generated value of matrix C is entirely different, like this:
here is the following matrix A and B i copy from generated excel
A = [-3710000000 0 0 0 0 0;
0 -12624305.56 0 0 0 75745833.33;
0 0 -2318750 0 -13912500 0;
0 0 0 -69358333.33 0 0;
0 0 13912500 0 55650000 0;
0 -75745833.33 0 0 0 302983333.3]
B = [0
0
-0.025876011
0
0.004312668
0]
C = A*B for simplicity, i have a two matrices A and B generated by matlab like below. when i calculated manually by excel with the function mmult(A;B) the value of C is vaforable like this. even when i increasing the decimal. especially the value of cell matrix C at 3,1 it was definetly zero
but when i multiply them in matlab i got value of C like this
how to deal with this type of problem? any guidance will help me alot, because i got bunch of wild value zero like this 🙁 thanks a lott.
the following attachments is my full code, matrix A is k_sup and matrix B is uaa, and matrix C is Fsupt in my line code. input3Dxlsx is my input.
P.S
i tried calculate separately with new script (like the following A*B bottom), copy those matrices from generated excel (so the value is accurate), and the generated value of matrix C is entirely different, like this:
here is the following matrix A and B i copy from generated excel
A = [-3710000000 0 0 0 0 0;
0 -12624305.56 0 0 0 75745833.33;
0 0 -2318750 0 -13912500 0;
0 0 0 -69358333.33 0 0;
0 0 13912500 0 55650000 0;
0 -75745833.33 0 0 0 302983333.3]
B = [0
0
-0.025876011
0
0.004312668
0]
C = A*B matlab, excel, arrays, array, cell array, multiple MATLAB Answers — New Questions
What is the difference between Permute Dimensions and Transpose blocks in discrete systems?
My question is regarding the Permute Dimensions and Transpose blocks in Models targeted to generate code via EmbeddedCoder.
1 – What is the difference between the blocks in terms of functionality and CPU load and speed in generated code.
2 – Which is generally better?My question is regarding the Permute Dimensions and Transpose blocks in Models targeted to generate code via EmbeddedCoder.
1 – What is the difference between the blocks in terms of functionality and CPU load and speed in generated code.
2 – Which is generally better? My question is regarding the Permute Dimensions and Transpose blocks in Models targeted to generate code via EmbeddedCoder.
1 – What is the difference between the blocks in terms of functionality and CPU load and speed in generated code.
2 – Which is generally better? optimization, arrays, transpose, permutate, embedded coder, cpu MATLAB Answers — New Questions
Running all Nastran input .bdf files contained in a folder using Matlab
Hello everyone,
I am trying to run a number of nastran input.bdf files contained in a folder using "system "command in matlab
System command works well when i secify onle one file named"1.bdf" like:
system(‘D:MSC.SoftwareMSC_Nastran20180binnastranw.exe 1.bdf’)
But,I have three bdf files in folder, I am trying to run using for loop
I have tried:
……………………………………………………………………….
files = dir(‘*.bdf’);
for i = 1 : length(files)
filename = files(K).name;
system(‘D:MSC.SoftwareMSC_Nastran20180binnastranw.exe filename’)
end
……………………………………………………………………………
But it does not start nastran ,rather gives output such as
ans=0
ans=0
ans=0Hello everyone,
I am trying to run a number of nastran input.bdf files contained in a folder using "system "command in matlab
System command works well when i secify onle one file named"1.bdf" like:
system(‘D:MSC.SoftwareMSC_Nastran20180binnastranw.exe 1.bdf’)
But,I have three bdf files in folder, I am trying to run using for loop
I have tried:
……………………………………………………………………….
files = dir(‘*.bdf’);
for i = 1 : length(files)
filename = files(K).name;
system(‘D:MSC.SoftwareMSC_Nastran20180binnastranw.exe filename’)
end
……………………………………………………………………………
But it does not start nastran ,rather gives output such as
ans=0
ans=0
ans=0 Hello everyone,
I am trying to run a number of nastran input.bdf files contained in a folder using "system "command in matlab
System command works well when i secify onle one file named"1.bdf" like:
system(‘D:MSC.SoftwareMSC_Nastran20180binnastranw.exe 1.bdf’)
But,I have three bdf files in folder, I am trying to run using for loop
I have tried:
……………………………………………………………………….
files = dir(‘*.bdf’);
for i = 1 : length(files)
filename = files(K).name;
system(‘D:MSC.SoftwareMSC_Nastran20180binnastranw.exe filename’)
end
……………………………………………………………………………
But it does not start nastran ,rather gives output such as
ans=0
ans=0
ans=0 running nastran job in matlab MATLAB Answers — New Questions
How to quantify variance explained from PCA?
Hi,
I want to quantify the amount of variance explained by PCA. However, I want to define the PCs using one half of my data, and test it using the other half as follows:
[COEFF,SCORE,latent,tsquare] = princomp(InputMatrix_TrainingData); %InputMatrix is an 8 x 78 matrix.
RecomputedScores = InputMatrix_TestData*COEFF; %Output
This works fine for recomputing the scores based upon alternate data, but how do I recompute the amount of variance explained etc. ?
ThanksHi,
I want to quantify the amount of variance explained by PCA. However, I want to define the PCs using one half of my data, and test it using the other half as follows:
[COEFF,SCORE,latent,tsquare] = princomp(InputMatrix_TrainingData); %InputMatrix is an 8 x 78 matrix.
RecomputedScores = InputMatrix_TestData*COEFF; %Output
This works fine for recomputing the scores based upon alternate data, but how do I recompute the amount of variance explained etc. ?
Thanks Hi,
I want to quantify the amount of variance explained by PCA. However, I want to define the PCs using one half of my data, and test it using the other half as follows:
[COEFF,SCORE,latent,tsquare] = princomp(InputMatrix_TrainingData); %InputMatrix is an 8 x 78 matrix.
RecomputedScores = InputMatrix_TestData*COEFF; %Output
This works fine for recomputing the scores based upon alternate data, but how do I recompute the amount of variance explained etc. ?
Thanks pca; svd MATLAB Answers — New Questions
Local variables are getting generated after code generation using embedded coder and if statement expression is not Boolean type throwing an error after running polyspace
An Image shown below in which guard condition is mentioned whose if statement is non compitant as per MISRA C 2012 Rule 14.4
As per Rule if statement should have boolean type expression.An Image shown below in which guard condition is mentioned whose if statement is non compitant as per MISRA C 2012 Rule 14.4
As per Rule if statement should have boolean type expression. An Image shown below in which guard condition is mentioned whose if statement is non compitant as per MISRA C 2012 Rule 14.4
As per Rule if statement should have boolean type expression. misra c 2012, 14.4 rule MATLAB Answers — New Questions
No unconditional default transitions help
Hello, I am running into an issue with the state below. I am a bit stuck, previously I had set the SFNoUnconditionalDefaultTransitionDiag parameter to be a warning but changed it to an error now. Now I am unsure on how going about fixing this error.
In a default transition, every path must lead to a substate and there must be one path that is not guarded by a condition or triggered by an event. Suggested Actions
– Terminate every path along the default transition in a substate.
– Ensure one default transition path is not guarded by a condition or triggered by an event.Hello, I am running into an issue with the state below. I am a bit stuck, previously I had set the SFNoUnconditionalDefaultTransitionDiag parameter to be a warning but changed it to an error now. Now I am unsure on how going about fixing this error.
In a default transition, every path must lead to a substate and there must be one path that is not guarded by a condition or triggered by an event. Suggested Actions
– Terminate every path along the default transition in a substate.
– Ensure one default transition path is not guarded by a condition or triggered by an event. Hello, I am running into an issue with the state below. I am a bit stuck, previously I had set the SFNoUnconditionalDefaultTransitionDiag parameter to be a warning but changed it to an error now. Now I am unsure on how going about fixing this error.
In a default transition, every path must lead to a substate and there must be one path that is not guarded by a condition or triggered by an event. Suggested Actions
– Terminate every path along the default transition in a substate.
– Ensure one default transition path is not guarded by a condition or triggered by an event. simulink, stateflow MATLAB Answers — New Questions
problem using fplot for small arguments of spherical bessel functions
i’m trying to plot spherical bessel functions (i. e. half integer order bessel functions) for small arguments (x << 1) and i’ve tried using vectors and it turns out very well; but the problem is when i try to use symbolic variable to define the function and plot it, i observe like meshing problems or diverging behavior (like in the image below). is there a way to fix it?
i’ve already tried modify the meshdensity but the problem remains. thanks a lot
l = 6; % order of the bessel function
syms r
rho = sqrt(pi./(2*r)) .* besselj(l + 0.5,r); % definition of spherical bessel function
% in terms of bessel function
f1 = figure;
fplot(real(rho),[0 0.35])
ylim([-0.1,0.5])i’m trying to plot spherical bessel functions (i. e. half integer order bessel functions) for small arguments (x << 1) and i’ve tried using vectors and it turns out very well; but the problem is when i try to use symbolic variable to define the function and plot it, i observe like meshing problems or diverging behavior (like in the image below). is there a way to fix it?
i’ve already tried modify the meshdensity but the problem remains. thanks a lot
l = 6; % order of the bessel function
syms r
rho = sqrt(pi./(2*r)) .* besselj(l + 0.5,r); % definition of spherical bessel function
% in terms of bessel function
f1 = figure;
fplot(real(rho),[0 0.35])
ylim([-0.1,0.5]) i’m trying to plot spherical bessel functions (i. e. half integer order bessel functions) for small arguments (x << 1) and i’ve tried using vectors and it turns out very well; but the problem is when i try to use symbolic variable to define the function and plot it, i observe like meshing problems or diverging behavior (like in the image below). is there a way to fix it?
i’ve already tried modify the meshdensity but the problem remains. thanks a lot
l = 6; % order of the bessel function
syms r
rho = sqrt(pi./(2*r)) .* besselj(l + 0.5,r); % definition of spherical bessel function
% in terms of bessel function
f1 = figure;
fplot(real(rho),[0 0.35])
ylim([-0.1,0.5]) fplot, syms, spherical bessel function MATLAB Answers — New Questions
MATLAB on Linux crashes when importing Python module
Any time I try to import a Python module, whether it’s from the standard library, installed, or custom, MATLAB crashed when I call py.importlib.import_module(). Here’s the crash log I get:
——————————————————————————–
abort() detected at Thu Jun 27 16:12:00 2019 -0400
——————————————————————————–
Configuration:
Crash Decoding : Disabled – No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Desktop Environment : ubuntu:GNOME
GNU C Library : 2.27 stable
Graphics Driver : Unknown hardware
Java Version : Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : glnxa64
MATLAB Entitlement ID : 5340214
MATLAB Root : /usr/local/MATLAB/R2018a
MATLAB Version : 9.4.0.813654 (R2018a)
OpenGL : hardware
Operating System : Ubuntu 18.04.2 LTS
Process ID : 72835
Processor ID : x86 Family 143 Model 1 Stepping 1, AuthenticAMD
Session Key : 0f3fa0ad-c4e3-4220-bbe7-b8df6cca1d4a
Static TLS mitigation : Disabled: Cannot load X11
Window System : The X.Org Foundation (12001000), display :0
Fault Count: 1
Abnormal termination
Register State (from fault):
RAX = 0000000000000000 RBX = 00007f805bff5860
RCX = 00007f80804a1e97 RDX = 0000000000000000
RSP = 00007f805bff55f0 RBP = 00007f805bff5960
RSI = 00007f805bff55f0 RDI = 0000000000000002
R8 = 0000000000000000 R9 = 00007f805bff55f0
R10 = 0000000000000008 R11 = 0000000000000246
R12 = 00007f805bff5860 R13 = 0000000000001000
R14 = 0000000000000000 R15 = 0000000000000030
RIP = 00007f80804a1e97 EFL = 0000000000000246
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007f80804a1e97 /lib/x86_64-linux-gnu/libc.so.6+00257687 gsignal+00000199
[ 1] 0x00007f80804a3801 /lib/x86_64-linux-gnu/libc.so.6+00264193 abort+00000321
[ 2] 0x00007f80804ec897 /lib/x86_64-linux-gnu/libc.so.6+00563351
[ 3] 0x00007f80804f390a /lib/x86_64-linux-gnu/libc.so.6+00592138
[ 4] 0x00007f80804fae1c /lib/x86_64-linux-gnu/libc.so.6+00622108 cfree+00001228
[ 5] 0x00007f7e75d8456d /home/mlh6/anaconda3/lib/python3.7/lib-dynload/../../libcrypto.so.1.1+01406317 EVP_MD_CTX_reset+00000205
[ 6] 0x00007f7e75d8459a /home/mlh6/anaconda3/lib/python3.7/lib-dynload/../../libcrypto.so.1.1+01406362 EVP_MD_CTX_free+00000010
[ 7] 0x00007f7f0c002e87 /home/mlh6/anaconda3/lib/python3.7/lib-dynload/_hashlib.cpython-37m-x86_64-linux-gnu.so+00011911
[ 8] 0x00007f7e772140cc /home/mlh6/anaconda3/lib/libpython3.7m.so+00426188 _PyEval_EvalFrameDefault+00008396
[ 9] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 10] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 11] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 12] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 13] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 14] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 15] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 16] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 17] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 18] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 19] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 20] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 21] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 22] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[ 23] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 24] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 25] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[ 26] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 27] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 28] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 29] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 30] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 31] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 32] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 33] 0x00007f7e772c9a2f /home/mlh6/anaconda3/lib/libpython3.7m.so+01169967 _PyFunction_FastCallDict+00000703
[ 34] 0x00007f7e772ca4c3 /home/mlh6/anaconda3/lib/libpython3.7m.so+01172675
[ 35] 0x00007f7e772ca76a /home/mlh6/anaconda3/lib/libpython3.7m.so+01173354 _PyObject_CallMethodIdObjArgs+00000186
[ 36] 0x00007f7e772fdea0 /home/mlh6/anaconda3/lib/libpython3.7m.so+01384096 PyImport_ImportModuleLevelObject+00001328
[ 37] 0x00007f7e77218f7a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446330 _PyEval_EvalFrameDefault+00028538
[ 38] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 39] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 40] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 41] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 42] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 43] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 44] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 45] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 46] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 47] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 48] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[ 49] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 50] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 51] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[ 52] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 53] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 54] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 55] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 56] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 57] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 58] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 59] 0x00007f7e772c9a2f /home/mlh6/anaconda3/lib/libpython3.7m.so+01169967 _PyFunction_FastCallDict+00000703
[ 60] 0x00007f7e772ca4c3 /home/mlh6/anaconda3/lib/libpython3.7m.so+01172675
[ 61] 0x00007f7e772ca76a /home/mlh6/anaconda3/lib/libpython3.7m.so+01173354 _PyObject_CallMethodIdObjArgs+00000186
[ 62] 0x00007f7e772fdea0 /home/mlh6/anaconda3/lib/libpython3.7m.so+01384096 PyImport_ImportModuleLevelObject+00001328
[ 63] 0x00007f7e77218f7a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446330 _PyEval_EvalFrameDefault+00028538
[ 64] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 65] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 66] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 67] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 68] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 69] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 70] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 71] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 72] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 73] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 74] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[ 75] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 76] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 77] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[ 78] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 79] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 80] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 81] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 82] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 83] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 84] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 85] 0x00007f7e772c9a2f /home/mlh6/anaconda3/lib/libpython3.7m.so+01169967 _PyFunction_FastCallDict+00000703
[ 86] 0x00007f7e772ca4c3 /home/mlh6/anaconda3/lib/libpython3.7m.so+01172675
[ 87] 0x00007f7e772ca76a /home/mlh6/anaconda3/lib/libpython3.7m.so+01173354 _PyObject_CallMethodIdObjArgs+00000186
[ 88] 0x00007f7e772fdea0 /home/mlh6/anaconda3/lib/libpython3.7m.so+01384096 PyImport_ImportModuleLevelObject+00001328
[ 89] 0x00007f7e77218f7a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446330 _PyEval_EvalFrameDefault+00028538
[ 90] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 91] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 92] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 93] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 94] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 95] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 96] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 97] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 98] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 99] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[100] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[101] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[102] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[103] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[104] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[105] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[106] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[107] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[108] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[109] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[110] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3Any time I try to import a Python module, whether it’s from the standard library, installed, or custom, MATLAB crashed when I call py.importlib.import_module(). Here’s the crash log I get:
——————————————————————————–
abort() detected at Thu Jun 27 16:12:00 2019 -0400
——————————————————————————–
Configuration:
Crash Decoding : Disabled – No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Desktop Environment : ubuntu:GNOME
GNU C Library : 2.27 stable
Graphics Driver : Unknown hardware
Java Version : Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : glnxa64
MATLAB Entitlement ID : 5340214
MATLAB Root : /usr/local/MATLAB/R2018a
MATLAB Version : 9.4.0.813654 (R2018a)
OpenGL : hardware
Operating System : Ubuntu 18.04.2 LTS
Process ID : 72835
Processor ID : x86 Family 143 Model 1 Stepping 1, AuthenticAMD
Session Key : 0f3fa0ad-c4e3-4220-bbe7-b8df6cca1d4a
Static TLS mitigation : Disabled: Cannot load X11
Window System : The X.Org Foundation (12001000), display :0
Fault Count: 1
Abnormal termination
Register State (from fault):
RAX = 0000000000000000 RBX = 00007f805bff5860
RCX = 00007f80804a1e97 RDX = 0000000000000000
RSP = 00007f805bff55f0 RBP = 00007f805bff5960
RSI = 00007f805bff55f0 RDI = 0000000000000002
R8 = 0000000000000000 R9 = 00007f805bff55f0
R10 = 0000000000000008 R11 = 0000000000000246
R12 = 00007f805bff5860 R13 = 0000000000001000
R14 = 0000000000000000 R15 = 0000000000000030
RIP = 00007f80804a1e97 EFL = 0000000000000246
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007f80804a1e97 /lib/x86_64-linux-gnu/libc.so.6+00257687 gsignal+00000199
[ 1] 0x00007f80804a3801 /lib/x86_64-linux-gnu/libc.so.6+00264193 abort+00000321
[ 2] 0x00007f80804ec897 /lib/x86_64-linux-gnu/libc.so.6+00563351
[ 3] 0x00007f80804f390a /lib/x86_64-linux-gnu/libc.so.6+00592138
[ 4] 0x00007f80804fae1c /lib/x86_64-linux-gnu/libc.so.6+00622108 cfree+00001228
[ 5] 0x00007f7e75d8456d /home/mlh6/anaconda3/lib/python3.7/lib-dynload/../../libcrypto.so.1.1+01406317 EVP_MD_CTX_reset+00000205
[ 6] 0x00007f7e75d8459a /home/mlh6/anaconda3/lib/python3.7/lib-dynload/../../libcrypto.so.1.1+01406362 EVP_MD_CTX_free+00000010
[ 7] 0x00007f7f0c002e87 /home/mlh6/anaconda3/lib/python3.7/lib-dynload/_hashlib.cpython-37m-x86_64-linux-gnu.so+00011911
[ 8] 0x00007f7e772140cc /home/mlh6/anaconda3/lib/libpython3.7m.so+00426188 _PyEval_EvalFrameDefault+00008396
[ 9] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 10] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 11] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 12] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 13] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 14] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 15] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 16] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 17] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 18] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 19] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 20] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 21] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 22] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[ 23] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 24] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 25] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[ 26] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 27] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 28] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 29] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 30] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 31] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 32] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 33] 0x00007f7e772c9a2f /home/mlh6/anaconda3/lib/libpython3.7m.so+01169967 _PyFunction_FastCallDict+00000703
[ 34] 0x00007f7e772ca4c3 /home/mlh6/anaconda3/lib/libpython3.7m.so+01172675
[ 35] 0x00007f7e772ca76a /home/mlh6/anaconda3/lib/libpython3.7m.so+01173354 _PyObject_CallMethodIdObjArgs+00000186
[ 36] 0x00007f7e772fdea0 /home/mlh6/anaconda3/lib/libpython3.7m.so+01384096 PyImport_ImportModuleLevelObject+00001328
[ 37] 0x00007f7e77218f7a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446330 _PyEval_EvalFrameDefault+00028538
[ 38] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 39] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 40] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 41] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 42] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 43] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 44] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 45] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 46] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 47] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 48] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[ 49] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 50] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 51] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[ 52] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 53] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 54] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 55] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 56] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 57] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 58] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 59] 0x00007f7e772c9a2f /home/mlh6/anaconda3/lib/libpython3.7m.so+01169967 _PyFunction_FastCallDict+00000703
[ 60] 0x00007f7e772ca4c3 /home/mlh6/anaconda3/lib/libpython3.7m.so+01172675
[ 61] 0x00007f7e772ca76a /home/mlh6/anaconda3/lib/libpython3.7m.so+01173354 _PyObject_CallMethodIdObjArgs+00000186
[ 62] 0x00007f7e772fdea0 /home/mlh6/anaconda3/lib/libpython3.7m.so+01384096 PyImport_ImportModuleLevelObject+00001328
[ 63] 0x00007f7e77218f7a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446330 _PyEval_EvalFrameDefault+00028538
[ 64] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 65] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 66] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 67] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 68] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 69] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 70] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 71] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 72] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 73] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 74] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[ 75] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 76] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 77] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[ 78] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 79] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 80] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 81] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 82] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 83] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 84] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 85] 0x00007f7e772c9a2f /home/mlh6/anaconda3/lib/libpython3.7m.so+01169967 _PyFunction_FastCallDict+00000703
[ 86] 0x00007f7e772ca4c3 /home/mlh6/anaconda3/lib/libpython3.7m.so+01172675
[ 87] 0x00007f7e772ca76a /home/mlh6/anaconda3/lib/libpython3.7m.so+01173354 _PyObject_CallMethodIdObjArgs+00000186
[ 88] 0x00007f7e772fdea0 /home/mlh6/anaconda3/lib/libpython3.7m.so+01384096 PyImport_ImportModuleLevelObject+00001328
[ 89] 0x00007f7e77218f7a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446330 _PyEval_EvalFrameDefault+00028538
[ 90] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 91] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 92] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 93] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 94] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 95] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 96] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 97] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 98] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 99] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[100] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[101] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[102] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[103] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[104] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[105] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[106] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[107] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[108] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[109] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[110] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3 Any time I try to import a Python module, whether it’s from the standard library, installed, or custom, MATLAB crashed when I call py.importlib.import_module(). Here’s the crash log I get:
——————————————————————————–
abort() detected at Thu Jun 27 16:12:00 2019 -0400
——————————————————————————–
Configuration:
Crash Decoding : Disabled – No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Desktop Environment : ubuntu:GNOME
GNU C Library : 2.27 stable
Graphics Driver : Unknown hardware
Java Version : Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : glnxa64
MATLAB Entitlement ID : 5340214
MATLAB Root : /usr/local/MATLAB/R2018a
MATLAB Version : 9.4.0.813654 (R2018a)
OpenGL : hardware
Operating System : Ubuntu 18.04.2 LTS
Process ID : 72835
Processor ID : x86 Family 143 Model 1 Stepping 1, AuthenticAMD
Session Key : 0f3fa0ad-c4e3-4220-bbe7-b8df6cca1d4a
Static TLS mitigation : Disabled: Cannot load X11
Window System : The X.Org Foundation (12001000), display :0
Fault Count: 1
Abnormal termination
Register State (from fault):
RAX = 0000000000000000 RBX = 00007f805bff5860
RCX = 00007f80804a1e97 RDX = 0000000000000000
RSP = 00007f805bff55f0 RBP = 00007f805bff5960
RSI = 00007f805bff55f0 RDI = 0000000000000002
R8 = 0000000000000000 R9 = 00007f805bff55f0
R10 = 0000000000000008 R11 = 0000000000000246
R12 = 00007f805bff5860 R13 = 0000000000001000
R14 = 0000000000000000 R15 = 0000000000000030
RIP = 00007f80804a1e97 EFL = 0000000000000246
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007f80804a1e97 /lib/x86_64-linux-gnu/libc.so.6+00257687 gsignal+00000199
[ 1] 0x00007f80804a3801 /lib/x86_64-linux-gnu/libc.so.6+00264193 abort+00000321
[ 2] 0x00007f80804ec897 /lib/x86_64-linux-gnu/libc.so.6+00563351
[ 3] 0x00007f80804f390a /lib/x86_64-linux-gnu/libc.so.6+00592138
[ 4] 0x00007f80804fae1c /lib/x86_64-linux-gnu/libc.so.6+00622108 cfree+00001228
[ 5] 0x00007f7e75d8456d /home/mlh6/anaconda3/lib/python3.7/lib-dynload/../../libcrypto.so.1.1+01406317 EVP_MD_CTX_reset+00000205
[ 6] 0x00007f7e75d8459a /home/mlh6/anaconda3/lib/python3.7/lib-dynload/../../libcrypto.so.1.1+01406362 EVP_MD_CTX_free+00000010
[ 7] 0x00007f7f0c002e87 /home/mlh6/anaconda3/lib/python3.7/lib-dynload/_hashlib.cpython-37m-x86_64-linux-gnu.so+00011911
[ 8] 0x00007f7e772140cc /home/mlh6/anaconda3/lib/libpython3.7m.so+00426188 _PyEval_EvalFrameDefault+00008396
[ 9] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 10] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 11] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 12] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 13] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 14] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 15] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 16] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 17] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 18] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 19] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 20] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 21] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 22] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[ 23] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 24] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 25] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[ 26] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 27] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 28] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 29] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 30] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 31] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 32] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 33] 0x00007f7e772c9a2f /home/mlh6/anaconda3/lib/libpython3.7m.so+01169967 _PyFunction_FastCallDict+00000703
[ 34] 0x00007f7e772ca4c3 /home/mlh6/anaconda3/lib/libpython3.7m.so+01172675
[ 35] 0x00007f7e772ca76a /home/mlh6/anaconda3/lib/libpython3.7m.so+01173354 _PyObject_CallMethodIdObjArgs+00000186
[ 36] 0x00007f7e772fdea0 /home/mlh6/anaconda3/lib/libpython3.7m.so+01384096 PyImport_ImportModuleLevelObject+00001328
[ 37] 0x00007f7e77218f7a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446330 _PyEval_EvalFrameDefault+00028538
[ 38] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 39] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 40] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 41] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 42] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 43] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 44] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 45] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 46] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 47] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 48] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[ 49] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 50] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 51] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[ 52] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 53] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 54] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 55] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 56] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 57] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 58] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 59] 0x00007f7e772c9a2f /home/mlh6/anaconda3/lib/libpython3.7m.so+01169967 _PyFunction_FastCallDict+00000703
[ 60] 0x00007f7e772ca4c3 /home/mlh6/anaconda3/lib/libpython3.7m.so+01172675
[ 61] 0x00007f7e772ca76a /home/mlh6/anaconda3/lib/libpython3.7m.so+01173354 _PyObject_CallMethodIdObjArgs+00000186
[ 62] 0x00007f7e772fdea0 /home/mlh6/anaconda3/lib/libpython3.7m.so+01384096 PyImport_ImportModuleLevelObject+00001328
[ 63] 0x00007f7e77218f7a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446330 _PyEval_EvalFrameDefault+00028538
[ 64] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 65] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 66] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 67] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 68] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 69] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 70] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 71] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 72] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 73] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 74] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[ 75] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 76] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 77] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[ 78] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 79] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 80] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 81] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 82] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[ 83] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[ 84] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[ 85] 0x00007f7e772c9a2f /home/mlh6/anaconda3/lib/libpython3.7m.so+01169967 _PyFunction_FastCallDict+00000703
[ 86] 0x00007f7e772ca4c3 /home/mlh6/anaconda3/lib/libpython3.7m.so+01172675
[ 87] 0x00007f7e772ca76a /home/mlh6/anaconda3/lib/libpython3.7m.so+01173354 _PyObject_CallMethodIdObjArgs+00000186
[ 88] 0x00007f7e772fdea0 /home/mlh6/anaconda3/lib/libpython3.7m.so+01384096 PyImport_ImportModuleLevelObject+00001328
[ 89] 0x00007f7e77218f7a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446330 _PyEval_EvalFrameDefault+00028538
[ 90] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 91] 0x00007f7e773d436f /home/mlh6/anaconda3/lib/libpython3.7m.so+02261871 PyEval_EvalCodeEx+00000063
[ 92] 0x00007f7e772a3abc /home/mlh6/anaconda3/lib/libpython3.7m.so+01014460 PyEval_EvalCode+00000028
[ 93] 0x00007f7e772a790e /home/mlh6/anaconda3/lib/libpython3.7m.so+01030414
[ 94] 0x00007f7e772c9561 /home/mlh6/anaconda3/lib/libpython3.7m.so+01168737 _PyMethodDef_RawFastCallDict+00000769
[ 95] 0x00007f7e772c9be6 /home/mlh6/anaconda3/lib/libpython3.7m.so+01170406 _PyCFunction_FastCallDict+00000038
[ 96] 0x00007f7e77218d61 /home/mlh6/anaconda3/lib/libpython3.7m.so+00445793 _PyEval_EvalFrameDefault+00028001
[ 97] 0x00007f7e773d4284 /home/mlh6/anaconda3/lib/libpython3.7m.so+02261636 _PyEval_EvalCodeWithName+00002756
[ 98] 0x00007f7e772c9680 /home/mlh6/anaconda3/lib/libpython3.7m.so+01169024 _PyFunction_FastCallKeywords+00000144
[ 99] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[100] 0x00007f7e7721910a /home/mlh6/anaconda3/lib/libpython3.7m.so+00446730 _PyEval_EvalFrameDefault+00028938
[101] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[102] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[103] 0x00007f7e77214cb9 /home/mlh6/anaconda3/lib/libpython3.7m.so+00429241 _PyEval_EvalFrameDefault+00011449
[104] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[105] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[106] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[107] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3.7m.so+00450096
[108] 0x00007f7e7721b0f6 /home/mlh6/anaconda3/lib/libpython3.7m.so+00454902
[109] 0x00007f7e77216808 /home/mlh6/anaconda3/lib/libpython3.7m.so+00436232 _PyEval_EvalFrameDefault+00018440
[110] 0x00007f7e77219e30 /home/mlh6/anaconda3/lib/libpython3 python MATLAB Answers — New Questions
unable to iterate serially through files in a for loop
I am running a matlab for loop to iterate through 30 .csv files and 30 .xlsx files. At each iteration of the for loop, i expect matlab to read the days from the .xlsx file, pass it to the .csv file so the same days can be selected and then do the calculation in the code. The code runs well, but the files saved are not showing the correct answers like when the calculations are done individually for each .mat and .xlsx file at a time. Only the anwers in the first saved for loop file is correct, the others are not what i expect. it looks like matlab is skipping the files or mixing them up in the for loop iteration, as only the first iteration is correct. The files are arranged serially in my working folder, hence i expect the for loop to iterate serially. Attached here are some of three of the files. Also attached here is the code. Please the main point of concern are the for loops which iterates through the .xlsx and .csv files. Thank you.
startIndex = 1;
endIndex = 3;
startIndex1 = 1;
endIndex1 = 3;
filelist = dir(‘C:UsersshedrDownloadstec data2017DOBUM2*.csv’);
filelistt = dir(‘C:UsersshedrDownloadstec data2017DOBUM2*.xlsx’);
output1 = cell(31,1);
for fileidx = startIndex:endIndex
% for fileidx = 1:numel(filelist)
spectrum = readmatrix(filelist(fileidx).name);
% y = spectrum(2:end,1:4);
% ctm = cell2mat(y)
e = length(spectrum);
[F] = fillmissing(spectrum, ‘linear’);
for fileidx1 = startIndex1:endIndex1
% for fileidx1 = 1:numel(filelistt)
if fileidx == fileidx1
spectrum1 = readmatrix(filelistt(fileidx1).name);
% % trying to extract the 5 quiet days
yy1 = spectrum1(:,1);
% ctm1 = cell2mat(yy1);
rmn1 = F(:,1) == yy1;
sbd1 = F(rmn1, :);
df1 = sbd1(:,4);
dd = size(df1);
yy2 = spectrum1(:,2);
% ctm2 = cell2mat(yy2);
rmn2 = F(:,1) == yy2;
sbd2 = F(rmn2, :);
df2 = sbd2(:,4);
dd = size(df2);
yy3 = spectrum1(:,3);
% ctm3 = cell2mat(yy3);
rmn3 = F(:,1) == yy3;
sbd3 = F(rmn3, :);
df3 = sbd3(:,4);
dd = size(df3);
yy4 = spectrum1(:,4);
% ctm4 = cell2mat(yy4);
rmn4 = F(:,1) == yy4;
sbd4 = F(rmn4, :);
df4 = sbd4(:,4);
dd = size(df4);
yy5 = spectrum1(:,5);
% ctm5 = cell2mat(yy5);
rmn5 = F(:,1) == yy5;
sbd5 = F(rmn5, :);
df5 = sbd5(:,4);
dd = size(df5);
% concatenating of the 5 quiet days
c = [df1,df2,df3,df4,df5];
% mean along horz. line
cm = mean(c,2);
% mean for the entire column
cmm = mean(cm);
crp = repmat(cmm,24,1);
cmm1 = cm-crp;
cmm2 = cmm1.^2;
cmm3 = mean(cmm2);
cmm4 = sqrt(cmm3); %% this is the standard deviation
mc = cm’;
ee = e/24;
con = repmat(mc,1,ee);
cno = con’;
tyc = F(:,4);
tycc = tyc-cno
ty = F(:,1);
% concatenating the time column with the computed tec values.
yt = [ty,tycc];
elseif fileidx <= 10
save([‘C:UsersshedrDownloadstec data2017DOBUM2casc’, num2str(fileidx)],’yt’)
% elseif fileidx <= 20
% save([‘C:UsersshedrDownloadstec data2017DOBUM2frns’, num2str(fileidx)],’yt’)
% elseif fileidx <= 30
% save([‘C:UsersshedrDownloadstec data2017DOBUM2func’, num2str(fileidx)],’yt’)
% we = size(cno)
end
end
% output1{fileidx} = y;
endI am running a matlab for loop to iterate through 30 .csv files and 30 .xlsx files. At each iteration of the for loop, i expect matlab to read the days from the .xlsx file, pass it to the .csv file so the same days can be selected and then do the calculation in the code. The code runs well, but the files saved are not showing the correct answers like when the calculations are done individually for each .mat and .xlsx file at a time. Only the anwers in the first saved for loop file is correct, the others are not what i expect. it looks like matlab is skipping the files or mixing them up in the for loop iteration, as only the first iteration is correct. The files are arranged serially in my working folder, hence i expect the for loop to iterate serially. Attached here are some of three of the files. Also attached here is the code. Please the main point of concern are the for loops which iterates through the .xlsx and .csv files. Thank you.
startIndex = 1;
endIndex = 3;
startIndex1 = 1;
endIndex1 = 3;
filelist = dir(‘C:UsersshedrDownloadstec data2017DOBUM2*.csv’);
filelistt = dir(‘C:UsersshedrDownloadstec data2017DOBUM2*.xlsx’);
output1 = cell(31,1);
for fileidx = startIndex:endIndex
% for fileidx = 1:numel(filelist)
spectrum = readmatrix(filelist(fileidx).name);
% y = spectrum(2:end,1:4);
% ctm = cell2mat(y)
e = length(spectrum);
[F] = fillmissing(spectrum, ‘linear’);
for fileidx1 = startIndex1:endIndex1
% for fileidx1 = 1:numel(filelistt)
if fileidx == fileidx1
spectrum1 = readmatrix(filelistt(fileidx1).name);
% % trying to extract the 5 quiet days
yy1 = spectrum1(:,1);
% ctm1 = cell2mat(yy1);
rmn1 = F(:,1) == yy1;
sbd1 = F(rmn1, :);
df1 = sbd1(:,4);
dd = size(df1);
yy2 = spectrum1(:,2);
% ctm2 = cell2mat(yy2);
rmn2 = F(:,1) == yy2;
sbd2 = F(rmn2, :);
df2 = sbd2(:,4);
dd = size(df2);
yy3 = spectrum1(:,3);
% ctm3 = cell2mat(yy3);
rmn3 = F(:,1) == yy3;
sbd3 = F(rmn3, :);
df3 = sbd3(:,4);
dd = size(df3);
yy4 = spectrum1(:,4);
% ctm4 = cell2mat(yy4);
rmn4 = F(:,1) == yy4;
sbd4 = F(rmn4, :);
df4 = sbd4(:,4);
dd = size(df4);
yy5 = spectrum1(:,5);
% ctm5 = cell2mat(yy5);
rmn5 = F(:,1) == yy5;
sbd5 = F(rmn5, :);
df5 = sbd5(:,4);
dd = size(df5);
% concatenating of the 5 quiet days
c = [df1,df2,df3,df4,df5];
% mean along horz. line
cm = mean(c,2);
% mean for the entire column
cmm = mean(cm);
crp = repmat(cmm,24,1);
cmm1 = cm-crp;
cmm2 = cmm1.^2;
cmm3 = mean(cmm2);
cmm4 = sqrt(cmm3); %% this is the standard deviation
mc = cm’;
ee = e/24;
con = repmat(mc,1,ee);
cno = con’;
tyc = F(:,4);
tycc = tyc-cno
ty = F(:,1);
% concatenating the time column with the computed tec values.
yt = [ty,tycc];
elseif fileidx <= 10
save([‘C:UsersshedrDownloadstec data2017DOBUM2casc’, num2str(fileidx)],’yt’)
% elseif fileidx <= 20
% save([‘C:UsersshedrDownloadstec data2017DOBUM2frns’, num2str(fileidx)],’yt’)
% elseif fileidx <= 30
% save([‘C:UsersshedrDownloadstec data2017DOBUM2func’, num2str(fileidx)],’yt’)
% we = size(cno)
end
end
% output1{fileidx} = y;
end I am running a matlab for loop to iterate through 30 .csv files and 30 .xlsx files. At each iteration of the for loop, i expect matlab to read the days from the .xlsx file, pass it to the .csv file so the same days can be selected and then do the calculation in the code. The code runs well, but the files saved are not showing the correct answers like when the calculations are done individually for each .mat and .xlsx file at a time. Only the anwers in the first saved for loop file is correct, the others are not what i expect. it looks like matlab is skipping the files or mixing them up in the for loop iteration, as only the first iteration is correct. The files are arranged serially in my working folder, hence i expect the for loop to iterate serially. Attached here are some of three of the files. Also attached here is the code. Please the main point of concern are the for loops which iterates through the .xlsx and .csv files. Thank you.
startIndex = 1;
endIndex = 3;
startIndex1 = 1;
endIndex1 = 3;
filelist = dir(‘C:UsersshedrDownloadstec data2017DOBUM2*.csv’);
filelistt = dir(‘C:UsersshedrDownloadstec data2017DOBUM2*.xlsx’);
output1 = cell(31,1);
for fileidx = startIndex:endIndex
% for fileidx = 1:numel(filelist)
spectrum = readmatrix(filelist(fileidx).name);
% y = spectrum(2:end,1:4);
% ctm = cell2mat(y)
e = length(spectrum);
[F] = fillmissing(spectrum, ‘linear’);
for fileidx1 = startIndex1:endIndex1
% for fileidx1 = 1:numel(filelistt)
if fileidx == fileidx1
spectrum1 = readmatrix(filelistt(fileidx1).name);
% % trying to extract the 5 quiet days
yy1 = spectrum1(:,1);
% ctm1 = cell2mat(yy1);
rmn1 = F(:,1) == yy1;
sbd1 = F(rmn1, :);
df1 = sbd1(:,4);
dd = size(df1);
yy2 = spectrum1(:,2);
% ctm2 = cell2mat(yy2);
rmn2 = F(:,1) == yy2;
sbd2 = F(rmn2, :);
df2 = sbd2(:,4);
dd = size(df2);
yy3 = spectrum1(:,3);
% ctm3 = cell2mat(yy3);
rmn3 = F(:,1) == yy3;
sbd3 = F(rmn3, :);
df3 = sbd3(:,4);
dd = size(df3);
yy4 = spectrum1(:,4);
% ctm4 = cell2mat(yy4);
rmn4 = F(:,1) == yy4;
sbd4 = F(rmn4, :);
df4 = sbd4(:,4);
dd = size(df4);
yy5 = spectrum1(:,5);
% ctm5 = cell2mat(yy5);
rmn5 = F(:,1) == yy5;
sbd5 = F(rmn5, :);
df5 = sbd5(:,4);
dd = size(df5);
% concatenating of the 5 quiet days
c = [df1,df2,df3,df4,df5];
% mean along horz. line
cm = mean(c,2);
% mean for the entire column
cmm = mean(cm);
crp = repmat(cmm,24,1);
cmm1 = cm-crp;
cmm2 = cmm1.^2;
cmm3 = mean(cmm2);
cmm4 = sqrt(cmm3); %% this is the standard deviation
mc = cm’;
ee = e/24;
con = repmat(mc,1,ee);
cno = con’;
tyc = F(:,4);
tycc = tyc-cno
ty = F(:,1);
% concatenating the time column with the computed tec values.
yt = [ty,tycc];
elseif fileidx <= 10
save([‘C:UsersshedrDownloadstec data2017DOBUM2casc’, num2str(fileidx)],’yt’)
% elseif fileidx <= 20
% save([‘C:UsersshedrDownloadstec data2017DOBUM2frns’, num2str(fileidx)],’yt’)
% elseif fileidx <= 30
% save([‘C:UsersshedrDownloadstec data2017DOBUM2func’, num2str(fileidx)],’yt’)
% we = size(cno)
end
end
% output1{fileidx} = y;
end for loop, iteration MATLAB Answers — New Questions
Animating a 2-D Array as a function of time
Hi,
I’m trying to construct an animation for a 1200×8 array named ‘ppdtrace’ that returns the entire row data in a stepwise manner. I’m hoping to track the evolution of these data at points 1:8 across 1200 time steps. So, it would read in the data from row 1 and plot the return values along the y-plane with whole numbers [1:8] on the x-plane. What I have currently uses the animatedline function and plots it with:
h=animatedline(‘MaximumNumPoints’,100);
for i=1:1200
for l=1:8
addpoints(h,l,ppdtrace(i,l));
drawnow;
end
end
Which evolves as I was predicting, but I would prefer to have only data points denoted as ‘o’ , ‘x’ , or something of this manner, without the lines between. Is there a function that I can use to achieve this, or perhaps a command I can use to manipulate the animatedline function?
Alternatively, I would be fine with continuing to use animatedline if there was a way to prevent the function from connecting the data point at position 8 in the (n)th row with the data point at position 1 in the n+1 row.
Thanks!Hi,
I’m trying to construct an animation for a 1200×8 array named ‘ppdtrace’ that returns the entire row data in a stepwise manner. I’m hoping to track the evolution of these data at points 1:8 across 1200 time steps. So, it would read in the data from row 1 and plot the return values along the y-plane with whole numbers [1:8] on the x-plane. What I have currently uses the animatedline function and plots it with:
h=animatedline(‘MaximumNumPoints’,100);
for i=1:1200
for l=1:8
addpoints(h,l,ppdtrace(i,l));
drawnow;
end
end
Which evolves as I was predicting, but I would prefer to have only data points denoted as ‘o’ , ‘x’ , or something of this manner, without the lines between. Is there a function that I can use to achieve this, or perhaps a command I can use to manipulate the animatedline function?
Alternatively, I would be fine with continuing to use animatedline if there was a way to prevent the function from connecting the data point at position 8 in the (n)th row with the data point at position 1 in the n+1 row.
Thanks! Hi,
I’m trying to construct an animation for a 1200×8 array named ‘ppdtrace’ that returns the entire row data in a stepwise manner. I’m hoping to track the evolution of these data at points 1:8 across 1200 time steps. So, it would read in the data from row 1 and plot the return values along the y-plane with whole numbers [1:8] on the x-plane. What I have currently uses the animatedline function and plots it with:
h=animatedline(‘MaximumNumPoints’,100);
for i=1:1200
for l=1:8
addpoints(h,l,ppdtrace(i,l));
drawnow;
end
end
Which evolves as I was predicting, but I would prefer to have only data points denoted as ‘o’ , ‘x’ , or something of this manner, without the lines between. Is there a function that I can use to achieve this, or perhaps a command I can use to manipulate the animatedline function?
Alternatively, I would be fine with continuing to use animatedline if there was a way to prevent the function from connecting the data point at position 8 in the (n)th row with the data point at position 1 in the n+1 row.
Thanks! animation, animatedline MATLAB Answers — New Questions