## Tag Archives: matlab

## undefined symbol xcb_shm_id when trying to startup MatLab

When trying to start up MatLab, I get

> ./bin/matlab

MATLAB is selecting SOFTWARE rendering.

/home/pblase/.MathWorks/ServiceHost/clr-df9a0cbb6bd34e079ef626671d1a7b7c/_tmp_MSHI_5363-9225-767d-e56f/mci/_tempinstaller_glnxa64/bin/glnxa64/InstallMathWorksServiceHost: symbol lookup error: /usr/lib64/libcairo.so.2: undefined symbol: xcb_shm_id

/home/pblase/.MathWorks/ServiceHost/clr-df9a0cbb6bd34e079ef626671d1a7b7c/_tmp_MSHI_5363-9225-767d-e56f/mci/_tempinstaller_glnxa64/bin/glnxa64/InstallMathWorksServiceHost: symbol lookup error: /usr/lib64/libcairo.so.2: undefined symbol: xcb_shm_id

Unexpected exception: ‘N7mwboost10wrapexceptINS_16exception_detail39current_exception_std_exception_wrapperISt13runtime_errorEEEE: Error loading /home/pblase/matlab/bin/glnxa64/matlab_startup_plugins/matlab_graphics_ui/mwuixloader.so. /usr/lib64/libXt.so.6: undefined symbol: SmcModifyCallbacks: Success: Success’ in createMVMAndCallParser phase ‘Creating local MVM’When trying to start up MatLab, I get

> ./bin/matlab

MATLAB is selecting SOFTWARE rendering.

/home/pblase/.MathWorks/ServiceHost/clr-df9a0cbb6bd34e079ef626671d1a7b7c/_tmp_MSHI_5363-9225-767d-e56f/mci/_tempinstaller_glnxa64/bin/glnxa64/InstallMathWorksServiceHost: symbol lookup error: /usr/lib64/libcairo.so.2: undefined symbol: xcb_shm_id

/home/pblase/.MathWorks/ServiceHost/clr-df9a0cbb6bd34e079ef626671d1a7b7c/_tmp_MSHI_5363-9225-767d-e56f/mci/_tempinstaller_glnxa64/bin/glnxa64/InstallMathWorksServiceHost: symbol lookup error: /usr/lib64/libcairo.so.2: undefined symbol: xcb_shm_id

Unexpected exception: ‘N7mwboost10wrapexceptINS_16exception_detail39current_exception_std_exception_wrapperISt13runtime_errorEEEE: Error loading /home/pblase/matlab/bin/glnxa64/matlab_startup_plugins/matlab_graphics_ui/mwuixloader.so. /usr/lib64/libXt.so.6: undefined symbol: SmcModifyCallbacks: Success: Success’ in createMVMAndCallParser phase ‘Creating local MVM’ When trying to start up MatLab, I get

> ./bin/matlab

MATLAB is selecting SOFTWARE rendering.

/home/pblase/.MathWorks/ServiceHost/clr-df9a0cbb6bd34e079ef626671d1a7b7c/_tmp_MSHI_5363-9225-767d-e56f/mci/_tempinstaller_glnxa64/bin/glnxa64/InstallMathWorksServiceHost: symbol lookup error: /usr/lib64/libcairo.so.2: undefined symbol: xcb_shm_id

/home/pblase/.MathWorks/ServiceHost/clr-df9a0cbb6bd34e079ef626671d1a7b7c/_tmp_MSHI_5363-9225-767d-e56f/mci/_tempinstaller_glnxa64/bin/glnxa64/InstallMathWorksServiceHost: symbol lookup error: /usr/lib64/libcairo.so.2: undefined symbol: xcb_shm_id

Unexpected exception: ‘N7mwboost10wrapexceptINS_16exception_detail39current_exception_std_exception_wrapperISt13runtime_errorEEEE: Error loading /home/pblase/matlab/bin/glnxa64/matlab_startup_plugins/matlab_graphics_ui/mwuixloader.so. /usr/lib64/libXt.so.6: undefined symbol: SmcModifyCallbacks: Success: Success’ in createMVMAndCallParser phase ‘Creating local MVM’ libcairo MATLAB Answers — New Questions

## Intro to matlab lab and I have no idea how this works

<</matlabcentral/answers/uploaded_files/1765134/Screenshot%202024-09-02%20at%206.21.33%E2%80%AFPM.png>>

I don’t know what I am supposed to do with the second part of question 3 and also don’t know what to do with #4. This is my first time ever taking a class about coding so I’m super lost.<</matlabcentral/answers/uploaded_files/1765134/Screenshot%202024-09-02%20at%206.21.33%E2%80%AFPM.png>>

I don’t know what I am supposed to do with the second part of question 3 and also don’t know what to do with #4. This is my first time ever taking a class about coding so I’m super lost. <</matlabcentral/answers/uploaded_files/1765134/Screenshot%202024-09-02%20at%206.21.33%E2%80%AFPM.png>>

I don’t know what I am supposed to do with the second part of question 3 and also don’t know what to do with #4. This is my first time ever taking a class about coding so I’m super lost. vector, vectors, variable MATLAB Answers — New Questions

## Poor performance of linprog in practice

I have to solve a dynamic programming problem using a linear programming approach. For details, please see this paper. The LP that I want to solve is:

min c’*v

s.t.

A*v>=u,

where c is n*1, v is n*1, A is n^2*n, u is n^2*1.

The min is with respect to v, the value function of the original DP problem. I have a moderate number of variables, n=300 and m=n^2*n=90000 linear inequalities as constraints. No bound constraints on v.

I use the Matlab function linprog which in turn is based on the solver HIGHS (since R2024a). The code is slow for my purposes (i.e. a brute-force value iteration is much faster). Moreover, linprog gives correct results only if I set the option ‘Algorithm’,’dual-simplex-highs’. With other algorithms, it gets stuck.

After profiling the code, it turns out that the bottleneck is line 377 of linprog:

[x, fval, exitflag, output, lambda] = run(algorithm, problem);

I was wondering if there is a way to speed up the code. Any help or suggestion is greatly appreciated! I put below a MWE to illustrate the problem.

clear,clc,close all

%% Set parameters

crra = 2;

alpha = 0.36;

beta = 0.95;

delta = 0.1;

%% Grid for capital

k_ss = ((1-beta*(1-delta))/(alpha*beta))^(1/(alpha-1));

n_k = 300;

k_grid = linspace(0.1*k_ss,1.5*k_ss,n_k)’;

%% Build current return matrix, U(k’,k)

cons = k_grid’.^alpha+(1-delta)*k_grid’-k_grid;

U_mat = f_util(cons,crra);

U_mat(cons<=0) = -inf;

%% Using LINEAR PROGRAMMING

% min c’*v

% s.t.

% A*v>=u, where c is n*1, v is n*1, A is n^2*n, u is n^2*1

n = length(k_grid);

c_vec = ones(n,1);

u_vec = U_mat(:); %% U(k’,k), stack columnwise

%% Build A matrix using cell-based method

tic

A = cell(n,1);

bigI = (-beta)*speye(n);

for i=1:n

temp = bigI;

temp(:,i) = temp(:,i)+1;

A{i} = temp;

end

A = vertcat(A{:});

disp(‘Time to build A matrix with cell method:’)

toc

%% Call linprog

% ‘dual-simplex-highs’ (default and by far the best)

options = optimoptions(‘linprog’,’Algorithm’,’dual-simplex-highs’);

tic

[V_lin,fval,exitflag,output] = linprog(c_vec,-A,-u_vec,[],[],[],[],options);

disp(‘Time linear programming:’)

toc

if exitflag<=0

warning(‘linprog did not find a solution’)

fprintf(‘exitflag = %d n’,exitflag)

end

%% Now that we solved for V, compute policy function

RHS_mat = U_mat+beta*V_lin; % (k’,k)

[V1,pol_k_ind] = max(RHS_mat,[],1);

pol_k = k_grid(pol_k_ind);

% Plots

figure

plot(k_grid,V1)

figure

plot(k_grid,k_grid,’–‘,k_grid,pol_k)

function util = f_util(c,crra)

util = c.^(1-crra)/(1-crra);

end

PROFILEI have to solve a dynamic programming problem using a linear programming approach. For details, please see this paper. The LP that I want to solve is:

min c’*v

s.t.

A*v>=u,

where c is n*1, v is n*1, A is n^2*n, u is n^2*1.

The min is with respect to v, the value function of the original DP problem. I have a moderate number of variables, n=300 and m=n^2*n=90000 linear inequalities as constraints. No bound constraints on v.

I use the Matlab function linprog which in turn is based on the solver HIGHS (since R2024a). The code is slow for my purposes (i.e. a brute-force value iteration is much faster). Moreover, linprog gives correct results only if I set the option ‘Algorithm’,’dual-simplex-highs’. With other algorithms, it gets stuck.

After profiling the code, it turns out that the bottleneck is line 377 of linprog:

[x, fval, exitflag, output, lambda] = run(algorithm, problem);

I was wondering if there is a way to speed up the code. Any help or suggestion is greatly appreciated! I put below a MWE to illustrate the problem.

clear,clc,close all

%% Set parameters

crra = 2;

alpha = 0.36;

beta = 0.95;

delta = 0.1;

%% Grid for capital

k_ss = ((1-beta*(1-delta))/(alpha*beta))^(1/(alpha-1));

n_k = 300;

k_grid = linspace(0.1*k_ss,1.5*k_ss,n_k)’;

%% Build current return matrix, U(k’,k)

cons = k_grid’.^alpha+(1-delta)*k_grid’-k_grid;

U_mat = f_util(cons,crra);

U_mat(cons<=0) = -inf;

%% Using LINEAR PROGRAMMING

% min c’*v

% s.t.

% A*v>=u, where c is n*1, v is n*1, A is n^2*n, u is n^2*1

n = length(k_grid);

c_vec = ones(n,1);

u_vec = U_mat(:); %% U(k’,k), stack columnwise

%% Build A matrix using cell-based method

tic

A = cell(n,1);

bigI = (-beta)*speye(n);

for i=1:n

temp = bigI;

temp(:,i) = temp(:,i)+1;

A{i} = temp;

end

A = vertcat(A{:});

disp(‘Time to build A matrix with cell method:’)

toc

%% Call linprog

% ‘dual-simplex-highs’ (default and by far the best)

options = optimoptions(‘linprog’,’Algorithm’,’dual-simplex-highs’);

tic

[V_lin,fval,exitflag,output] = linprog(c_vec,-A,-u_vec,[],[],[],[],options);

disp(‘Time linear programming:’)

toc

if exitflag<=0

warning(‘linprog did not find a solution’)

fprintf(‘exitflag = %d n’,exitflag)

end

%% Now that we solved for V, compute policy function

RHS_mat = U_mat+beta*V_lin; % (k’,k)

[V1,pol_k_ind] = max(RHS_mat,[],1);

pol_k = k_grid(pol_k_ind);

% Plots

figure

plot(k_grid,V1)

figure

plot(k_grid,k_grid,’–‘,k_grid,pol_k)

function util = f_util(c,crra)

util = c.^(1-crra)/(1-crra);

end

PROFILE I have to solve a dynamic programming problem using a linear programming approach. For details, please see this paper. The LP that I want to solve is:

min c’*v

s.t.

A*v>=u,

where c is n*1, v is n*1, A is n^2*n, u is n^2*1.

The min is with respect to v, the value function of the original DP problem. I have a moderate number of variables, n=300 and m=n^2*n=90000 linear inequalities as constraints. No bound constraints on v.

I use the Matlab function linprog which in turn is based on the solver HIGHS (since R2024a). The code is slow for my purposes (i.e. a brute-force value iteration is much faster). Moreover, linprog gives correct results only if I set the option ‘Algorithm’,’dual-simplex-highs’. With other algorithms, it gets stuck.

After profiling the code, it turns out that the bottleneck is line 377 of linprog:

[x, fval, exitflag, output, lambda] = run(algorithm, problem);

I was wondering if there is a way to speed up the code. Any help or suggestion is greatly appreciated! I put below a MWE to illustrate the problem.

clear,clc,close all

%% Set parameters

crra = 2;

alpha = 0.36;

beta = 0.95;

delta = 0.1;

%% Grid for capital

k_ss = ((1-beta*(1-delta))/(alpha*beta))^(1/(alpha-1));

n_k = 300;

k_grid = linspace(0.1*k_ss,1.5*k_ss,n_k)’;

%% Build current return matrix, U(k’,k)

cons = k_grid’.^alpha+(1-delta)*k_grid’-k_grid;

U_mat = f_util(cons,crra);

U_mat(cons<=0) = -inf;

%% Using LINEAR PROGRAMMING

% min c’*v

% s.t.

% A*v>=u, where c is n*1, v is n*1, A is n^2*n, u is n^2*1

n = length(k_grid);

c_vec = ones(n,1);

u_vec = U_mat(:); %% U(k’,k), stack columnwise

%% Build A matrix using cell-based method

tic

A = cell(n,1);

bigI = (-beta)*speye(n);

for i=1:n

temp = bigI;

temp(:,i) = temp(:,i)+1;

A{i} = temp;

end

A = vertcat(A{:});

disp(‘Time to build A matrix with cell method:’)

toc

%% Call linprog

% ‘dual-simplex-highs’ (default and by far the best)

options = optimoptions(‘linprog’,’Algorithm’,’dual-simplex-highs’);

tic

[V_lin,fval,exitflag,output] = linprog(c_vec,-A,-u_vec,[],[],[],[],options);

disp(‘Time linear programming:’)

toc

if exitflag<=0

warning(‘linprog did not find a solution’)

fprintf(‘exitflag = %d n’,exitflag)

end

%% Now that we solved for V, compute policy function

RHS_mat = U_mat+beta*V_lin; % (k’,k)

[V1,pol_k_ind] = max(RHS_mat,[],1);

pol_k = k_grid(pol_k_ind);

% Plots

figure

plot(k_grid,V1)

figure

plot(k_grid,k_grid,’–‘,k_grid,pol_k)

function util = f_util(c,crra)

util = c.^(1-crra)/(1-crra);

end

PROFILE linprog, performance MATLAB Answers — New Questions

## How to import .EEG or text or excel file to EEGlab

Hi all I’ve 1-hour EEG data with a sampling frequency 291hz.I’ve installed EEGlab v14.1.1 version and tried to load my data files of ‘.EEG file’,’text’ and ‘excel’formats, but none of them are loading to EEGlab.It’s showing the following error. Please help me to slove this issue since I’m new to this EEGlab softwareHi all I’ve 1-hour EEG data with a sampling frequency 291hz.I’ve installed EEGlab v14.1.1 version and tried to load my data files of ‘.EEG file’,’text’ and ‘excel’formats, but none of them are loading to EEGlab.It’s showing the following error. Please help me to slove this issue since I’m new to this EEGlab software Hi all I’ve 1-hour EEG data with a sampling frequency 291hz.I’ve installed EEGlab v14.1.1 version and tried to load my data files of ‘.EEG file’,’text’ and ‘excel’formats, but none of them are loading to EEGlab.It’s showing the following error. Please help me to slove this issue since I’m new to this EEGlab software eeg, eeglab, signal processing MATLAB Answers — New Questions

## Using symbolic solver, I seem to not be able to get a system of equations that give me a desired answer. Does a solution not exist?

syms V1 V2 Vp Vn Vxp Vxn Vpx Vnx

syms Rp Rx Rn positive

Ison=((Vp/((Rp*68220)/(Rp+68220)))-(Vxp/((Rx*68220)/(Rx+68220))));

equ1=Vp==(V1+V2)-Ison*Rn;

Isop=((Vn/((Rn*68220)/(Rn+68220)))-(Vxn/((Rx*68220)/(Rx+68220))));

equ2=Vn==(V1+V2)-Isop*Rp;

Isox=((Vnx/((Rn*68220)/(Rn+68220)))-(Vpx/((Rp*68220)/(Rp+68220))));

equ3= Vpx==V1+Rx*Isox;

[Rn, Rp, Rx] = solve([equ1, equ2,equ3],[Rn , Rp, Rx]);

simplify(Rn)

simplify(Rp)

simplify(Rx)

Rn=vpa(subs(Rn,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))

Rp=vpa(subs(Rp,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))

Rx=vpa(subs(Rx,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))

So I am trying to find values for Rn,Rx and Rp. I have three equations and three unknowns. When I use solve to find symbolic equation, I get equations for each variable. But when I sub real values in, I get an answer that is wrong or doesnt make sense. Adding assume doesnt seem to change anything and the return conditions is the same as the equations. The real values of Rn, Rp and Rx should be 2e6,1.5e6 and 700k. If you were to put these values in the original equations, you can verify that these values are correct. How do I get a system of equations that will give me the desired answer?syms V1 V2 Vp Vn Vxp Vxn Vpx Vnx

syms Rp Rx Rn positive

Ison=((Vp/((Rp*68220)/(Rp+68220)))-(Vxp/((Rx*68220)/(Rx+68220))));

equ1=Vp==(V1+V2)-Ison*Rn;

Isop=((Vn/((Rn*68220)/(Rn+68220)))-(Vxn/((Rx*68220)/(Rx+68220))));

equ2=Vn==(V1+V2)-Isop*Rp;

Isox=((Vnx/((Rn*68220)/(Rn+68220)))-(Vpx/((Rp*68220)/(Rp+68220))));

equ3= Vpx==V1+Rx*Isox;

[Rn, Rp, Rx] = solve([equ1, equ2,equ3],[Rn , Rp, Rx]);

simplify(Rn)

simplify(Rp)

simplify(Rx)

Rn=vpa(subs(Rn,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))

Rp=vpa(subs(Rp,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))

Rx=vpa(subs(Rx,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))

So I am trying to find values for Rn,Rx and Rp. I have three equations and three unknowns. When I use solve to find symbolic equation, I get equations for each variable. But when I sub real values in, I get an answer that is wrong or doesnt make sense. Adding assume doesnt seem to change anything and the return conditions is the same as the equations. The real values of Rn, Rp and Rx should be 2e6,1.5e6 and 700k. If you were to put these values in the original equations, you can verify that these values are correct. How do I get a system of equations that will give me the desired answer? syms V1 V2 Vp Vn Vxp Vxn Vpx Vnx

syms Rp Rx Rn positive

Ison=((Vp/((Rp*68220)/(Rp+68220)))-(Vxp/((Rx*68220)/(Rx+68220))));

equ1=Vp==(V1+V2)-Ison*Rn;

Isop=((Vn/((Rn*68220)/(Rn+68220)))-(Vxn/((Rx*68220)/(Rx+68220))));

equ2=Vn==(V1+V2)-Isop*Rp;

Isox=((Vnx/((Rn*68220)/(Rn+68220)))-(Vpx/((Rp*68220)/(Rp+68220))));

equ3= Vpx==V1+Rx*Isox;

[Rn, Rp, Rx] = solve([equ1, equ2,equ3],[Rn , Rp, Rx]);

simplify(Rn)

simplify(Rp)

simplify(Rx)

Rn=vpa(subs(Rn,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))

Rp=vpa(subs(Rp,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))

Rx=vpa(subs(Rx,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))

So I am trying to find values for Rn,Rx and Rp. I have three equations and three unknowns. When I use solve to find symbolic equation, I get equations for each variable. But when I sub real values in, I get an answer that is wrong or doesnt make sense. Adding assume doesnt seem to change anything and the return conditions is the same as the equations. The real values of Rn, Rp and Rx should be 2e6,1.5e6 and 700k. If you were to put these values in the original equations, you can verify that these values are correct. How do I get a system of equations that will give me the desired answer? solve, symbolic MATLAB Answers — New Questions

## filtfilt provides excessive transient

I observed that ‘filtfilt’ suffers from an undesired behavior when I provide IIR bandpass filters having steep transition bands. Specifically, the output signal exhibits excessive transient response; nevertheless, this behaviour does not emerge if I use a ‘home-made’ version of zerophase filtering based on ‘filter’. I guess that it is not a numerical issue involving the filter coefficients or structure, nor the ‘filter’ function.

% design bandpass filter having transition bandwidth of 200 Hz (Fs = 8000)

bp = designfilt(‘bandpassiir’, ‘StopbandFrequency1’, 50, ‘PassbandFrequency1’, 250,…

‘PassbandFrequency2’, 3600, ‘StopbandFrequency2’, 3700, ‘StopbandAttenuation1’, 30,…

‘PassbandRipple’, 0.1, ‘StopbandAttenuation2’, 30, ‘SampleRate’, 8000, ‘DesignMethod’, ‘cheby2’);

% check stability

assert(isstable(bp),’Unstable filter’);

% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient

x = randn(2^20,1);

y = filtfilt(bp,x);

% apply ‘home-made’ filtfilt to the same input; output signal shows a more accptable transient

y2 = flipud(filter(bp,flipud(filter(bp,x))));

% compare effects

figure; semilogy(abs(y-y2));

As a rule of thumb, the effect grows as the transition bands get narrower, while it tends to vanish as they get broader.

Where is the problem? Have I missed some recommendations or hints in the function’s help?I observed that ‘filtfilt’ suffers from an undesired behavior when I provide IIR bandpass filters having steep transition bands. Specifically, the output signal exhibits excessive transient response; nevertheless, this behaviour does not emerge if I use a ‘home-made’ version of zerophase filtering based on ‘filter’. I guess that it is not a numerical issue involving the filter coefficients or structure, nor the ‘filter’ function.

% design bandpass filter having transition bandwidth of 200 Hz (Fs = 8000)

bp = designfilt(‘bandpassiir’, ‘StopbandFrequency1’, 50, ‘PassbandFrequency1’, 250,…

‘PassbandFrequency2’, 3600, ‘StopbandFrequency2’, 3700, ‘StopbandAttenuation1’, 30,…

‘PassbandRipple’, 0.1, ‘StopbandAttenuation2’, 30, ‘SampleRate’, 8000, ‘DesignMethod’, ‘cheby2’);

% check stability

assert(isstable(bp),’Unstable filter’);

% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient

x = randn(2^20,1);

y = filtfilt(bp,x);

% apply ‘home-made’ filtfilt to the same input; output signal shows a more accptable transient

y2 = flipud(filter(bp,flipud(filter(bp,x))));

% compare effects

figure; semilogy(abs(y-y2));

As a rule of thumb, the effect grows as the transition bands get narrower, while it tends to vanish as they get broader.

Where is the problem? Have I missed some recommendations or hints in the function’s help? I observed that ‘filtfilt’ suffers from an undesired behavior when I provide IIR bandpass filters having steep transition bands. Specifically, the output signal exhibits excessive transient response; nevertheless, this behaviour does not emerge if I use a ‘home-made’ version of zerophase filtering based on ‘filter’. I guess that it is not a numerical issue involving the filter coefficients or structure, nor the ‘filter’ function.

% design bandpass filter having transition bandwidth of 200 Hz (Fs = 8000)

bp = designfilt(‘bandpassiir’, ‘StopbandFrequency1’, 50, ‘PassbandFrequency1’, 250,…

‘PassbandFrequency2’, 3600, ‘StopbandFrequency2’, 3700, ‘StopbandAttenuation1’, 30,…

‘PassbandRipple’, 0.1, ‘StopbandAttenuation2’, 30, ‘SampleRate’, 8000, ‘DesignMethod’, ‘cheby2’);

% check stability

assert(isstable(bp),’Unstable filter’);

% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient

x = randn(2^20,1);

y = filtfilt(bp,x);

% apply ‘home-made’ filtfilt to the same input; output signal shows a more accptable transient

y2 = flipud(filter(bp,flipud(filter(bp,x))));

% compare effects

figure; semilogy(abs(y-y2));

As a rule of thumb, the effect grows as the transition bands get narrower, while it tends to vanish as they get broader.

Where is the problem? Have I missed some recommendations or hints in the function’s help? filtfilt, numerical stability, transient effects MATLAB Answers — New Questions

## Reading Bytes from Arduino to MATLAB

I’ve been trying to read data from ESP32S-Dev module to MATLAB sending over the data in bytes to make the transmission quicker. As seen below, I convert float data into bytes and then write the data. MATLAB sees the data and then creates a 1×8 array for each float value instead of just 1 value for each float. I’ve tried other methods, shown in 2nd part of MATLAB code, and it creates 1 value for each float but their wildly off (7-34 orders of magnitude)

I’ve tried different baud rates and even asked for help from the almighty ChatGPT but have not been able to crack the code. Any thoughts.

Arduino IDE code:

#include <SPI.h>

const int CS_SiPM_pot = 34;

void setup() {

// put your setup code here, to run once:

Serial.begin(115200); //Starting

delay(1000);

SPI.begin();

pinMode(CS_SiPM_pot, OUTPUT);

}

void loop() {

for (int d_pot2 = 55; d_pot2 <= 55; d_pot2 = d_pot2 + 1) //57

{

digitalWrite(CS_SiPM_pot, LOW); //LOW

delay(10); //10

SPI.transfer(d_pot2);

digitalWrite(CS_SiPM_pot, HIGH);

// put your main code here, to run repeatedly:

float newTmp[4] = { 01.00, 02.00, 03.00, 04.00 };

for (int i = 0; i < 4; i++) {

byte *byteData = (byte *)&newTmp[i];

Serial.write(byteData, sizeof(float)); // Send each float as 4 bytes

delay(10);

}

}

}

MATLAB code:

esp = serialport(‘COM5’,152000);

%%

flush(esp)

% Read 16 bytes of data (4 floats * 4 bytes per float)

numBytes = 16;

data = read(esp, numBytes, ‘uint8’);

% Convert each 4-byte sequence to a float

float1 = typecast(data(1:4)), ‘single’);

float2 = typecast(data(5:8), ‘single’);

float3 = typecast(data(9:12), ‘single’);

float4 = typecast(data(13:16), ‘single’);

disp([float1, float2, float3, float4]);

% Convert the bytes back to float values

floatValues = typecast(uint8(data), ‘single’);

% Display the result

disp(‘Float values:’);

disp(floatValues);

disp(‘Raw bytes received:’);

disp(data); % Print the raw bytes

Results from MATLAB:

Float1: 0 0 0 0 0 0 0 0

Float2: 0 3.7480 0 0 0 0 0 0

Float3: 0 2.1250 0 3.7480 0 0 0 0

Float4: 0 0 0 0 0 3.7480 0 0

data: 0 0 0 0 255 0 0 0 3 255 0 0 0 0 255 0I’ve been trying to read data from ESP32S-Dev module to MATLAB sending over the data in bytes to make the transmission quicker. As seen below, I convert float data into bytes and then write the data. MATLAB sees the data and then creates a 1×8 array for each float value instead of just 1 value for each float. I’ve tried other methods, shown in 2nd part of MATLAB code, and it creates 1 value for each float but their wildly off (7-34 orders of magnitude)

I’ve tried different baud rates and even asked for help from the almighty ChatGPT but have not been able to crack the code. Any thoughts.

Arduino IDE code:

#include <SPI.h>

const int CS_SiPM_pot = 34;

void setup() {

// put your setup code here, to run once:

Serial.begin(115200); //Starting

delay(1000);

SPI.begin();

pinMode(CS_SiPM_pot, OUTPUT);

}

void loop() {

for (int d_pot2 = 55; d_pot2 <= 55; d_pot2 = d_pot2 + 1) //57

{

digitalWrite(CS_SiPM_pot, LOW); //LOW

delay(10); //10

SPI.transfer(d_pot2);

digitalWrite(CS_SiPM_pot, HIGH);

// put your main code here, to run repeatedly:

float newTmp[4] = { 01.00, 02.00, 03.00, 04.00 };

for (int i = 0; i < 4; i++) {

byte *byteData = (byte *)&newTmp[i];

Serial.write(byteData, sizeof(float)); // Send each float as 4 bytes

delay(10);

}

}

}

MATLAB code:

esp = serialport(‘COM5’,152000);

%%

flush(esp)

% Read 16 bytes of data (4 floats * 4 bytes per float)

numBytes = 16;

data = read(esp, numBytes, ‘uint8’);

% Convert each 4-byte sequence to a float

float1 = typecast(data(1:4)), ‘single’);

float2 = typecast(data(5:8), ‘single’);

float3 = typecast(data(9:12), ‘single’);

float4 = typecast(data(13:16), ‘single’);

disp([float1, float2, float3, float4]);

% Convert the bytes back to float values

floatValues = typecast(uint8(data), ‘single’);

% Display the result

disp(‘Float values:’);

disp(floatValues);

disp(‘Raw bytes received:’);

disp(data); % Print the raw bytes

Results from MATLAB:

Float1: 0 0 0 0 0 0 0 0

Float2: 0 3.7480 0 0 0 0 0 0

Float3: 0 2.1250 0 3.7480 0 0 0 0

Float4: 0 0 0 0 0 3.7480 0 0

data: 0 0 0 0 255 0 0 0 3 255 0 0 0 0 255 0 I’ve been trying to read data from ESP32S-Dev module to MATLAB sending over the data in bytes to make the transmission quicker. As seen below, I convert float data into bytes and then write the data. MATLAB sees the data and then creates a 1×8 array for each float value instead of just 1 value for each float. I’ve tried other methods, shown in 2nd part of MATLAB code, and it creates 1 value for each float but their wildly off (7-34 orders of magnitude)

I’ve tried different baud rates and even asked for help from the almighty ChatGPT but have not been able to crack the code. Any thoughts.

Arduino IDE code:

#include <SPI.h>

const int CS_SiPM_pot = 34;

void setup() {

// put your setup code here, to run once:

Serial.begin(115200); //Starting

delay(1000);

SPI.begin();

pinMode(CS_SiPM_pot, OUTPUT);

}

void loop() {

for (int d_pot2 = 55; d_pot2 <= 55; d_pot2 = d_pot2 + 1) //57

{

digitalWrite(CS_SiPM_pot, LOW); //LOW

delay(10); //10

SPI.transfer(d_pot2);

digitalWrite(CS_SiPM_pot, HIGH);

// put your main code here, to run repeatedly:

float newTmp[4] = { 01.00, 02.00, 03.00, 04.00 };

for (int i = 0; i < 4; i++) {

byte *byteData = (byte *)&newTmp[i];

Serial.write(byteData, sizeof(float)); // Send each float as 4 bytes

delay(10);

}

}

}

MATLAB code:

esp = serialport(‘COM5’,152000);

%%

flush(esp)

% Read 16 bytes of data (4 floats * 4 bytes per float)

numBytes = 16;

data = read(esp, numBytes, ‘uint8’);

% Convert each 4-byte sequence to a float

float1 = typecast(data(1:4)), ‘single’);

float2 = typecast(data(5:8), ‘single’);

float3 = typecast(data(9:12), ‘single’);

float4 = typecast(data(13:16), ‘single’);

disp([float1, float2, float3, float4]);

% Convert the bytes back to float values

floatValues = typecast(uint8(data), ‘single’);

% Display the result

disp(‘Float values:’);

disp(floatValues);

disp(‘Raw bytes received:’);

disp(data); % Print the raw bytes

Results from MATLAB:

Float1: 0 0 0 0 0 0 0 0

Float2: 0 3.7480 0 0 0 0 0 0

Float3: 0 2.1250 0 3.7480 0 0 0 0

Float4: 0 0 0 0 0 3.7480 0 0

data: 0 0 0 0 255 0 0 0 3 255 0 0 0 0 255 0 arduino, esp32, matlab, serialport, float-to-bytes MATLAB Answers — New Questions

## When the orientation of the object changed, how to measure the force on each support point?

Thank you for your interest in my question.

If we assume that there is a box with x, y, z-axis lengths of [1, 0.5, 0.2] (m) , weight is m=100kg,

and set the center point as the origin frame. At this time, if we support the force of m*g/4 at each of the four points [0.5, 0.25, -0.1], [0.5, -0.25, -0.1], [-0.5, -0.25, -0.1], [-0.5, 0.25, -0.1], the object will stay statically.

Then, if the box rotates 30 degrees about the x-axis, I can’t measure the force applied at the four corners of the box.

As the box rotates, the coordinate frame of the corner also rotates.

If the box rotates 45 degrees for y-axis after rotating 30 degree for the x-axis,

how should we apply force to each point so that the box stays still?Thank you for your interest in my question.

If we assume that there is a box with x, y, z-axis lengths of [1, 0.5, 0.2] (m) , weight is m=100kg,

and set the center point as the origin frame. At this time, if we support the force of m*g/4 at each of the four points [0.5, 0.25, -0.1], [0.5, -0.25, -0.1], [-0.5, -0.25, -0.1], [-0.5, 0.25, -0.1], the object will stay statically.

Then, if the box rotates 30 degrees about the x-axis, I can’t measure the force applied at the four corners of the box.

As the box rotates, the coordinate frame of the corner also rotates.

If the box rotates 45 degrees for y-axis after rotating 30 degree for the x-axis,

how should we apply force to each point so that the box stays still? Thank you for your interest in my question.

If we assume that there is a box with x, y, z-axis lengths of [1, 0.5, 0.2] (m) , weight is m=100kg,

and set the center point as the origin frame. At this time, if we support the force of m*g/4 at each of the four points [0.5, 0.25, -0.1], [0.5, -0.25, -0.1], [-0.5, -0.25, -0.1], [-0.5, 0.25, -0.1], the object will stay statically.

Then, if the box rotates 30 degrees about the x-axis, I can’t measure the force applied at the four corners of the box.

As the box rotates, the coordinate frame of the corner also rotates.

If the box rotates 45 degrees for y-axis after rotating 30 degree for the x-axis,

how should we apply force to each point so that the box stays still? force, gravity compensation MATLAB Answers — New Questions

## Hi! I created a bad script a long time ago (months) and it has essentially destroyed my Matlab Online. I cannot run any other script without that old error occurring

The Summery is essentially it. I created a script four months ago and accidentially used the wrong syntax (&&) and it has corrupted my Matlab Online. I can run scripts with only comments, but as soon as I add anything else I get the errors back.

Help? I am so confused

Script I am running:

%% Problem 1

k1 = 10;

k2 = 5;

k3 = 8;

k4 = 10;

k5 = 20;

L1 = [1 0 0 0;

0 1 0 0]

Error Message:

Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to

reduce operands to logical scalar values.

Error in internal.matlab.variableeditor.Actions.struct.EditActionBase/UpdateActionState (line 33)

editable = height(sRows) == 1 && (sRows(2)-sRows(1)+1 == 1);

Error in internal.matlab.variableeditor.VEActionDataService/updateActionStates (line 138)

action.UpdateActionState();

Error in internal.matlab.variableeditor.VEActionDataService/enableListenersAndUpdateActionStates (line 84)

this.updateActionStates();

Error in internal.matlab.variableeditor.VEActionDataService/initActionStates (line 54)

this.enableListenersAndUpdateActionStates();

Error in internal.matlab.datatoolsservices.actiondataservice.ActionManager/initActions (line 55)

this.ActionDataService.initActionStates();

Error in internal.matlab.variableeditor.peer.RemoteManager/callInitActionOnIdle (line 376)

ActionManager.initActions(startPath, classType);

Error in internal.matlab.variableeditor.peer.RemoteManager>@()this.callInitActionOnIdle(actionNamespace,startPath,classType,ActionManager) (line 121)

builtin(‘_dtcallback’, @() this.callInitActionOnIdle(actionNamespace, startPath, classType, ActionManager), …The Summery is essentially it. I created a script four months ago and accidentially used the wrong syntax (&&) and it has corrupted my Matlab Online. I can run scripts with only comments, but as soon as I add anything else I get the errors back.

Help? I am so confused

Script I am running:

%% Problem 1

k1 = 10;

k2 = 5;

k3 = 8;

k4 = 10;

k5 = 20;

L1 = [1 0 0 0;

0 1 0 0]

Error Message:

Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to

reduce operands to logical scalar values.

Error in internal.matlab.variableeditor.Actions.struct.EditActionBase/UpdateActionState (line 33)

editable = height(sRows) == 1 && (sRows(2)-sRows(1)+1 == 1);

Error in internal.matlab.variableeditor.VEActionDataService/updateActionStates (line 138)

action.UpdateActionState();

Error in internal.matlab.variableeditor.VEActionDataService/enableListenersAndUpdateActionStates (line 84)

this.updateActionStates();

Error in internal.matlab.variableeditor.VEActionDataService/initActionStates (line 54)

this.enableListenersAndUpdateActionStates();

Error in internal.matlab.datatoolsservices.actiondataservice.ActionManager/initActions (line 55)

this.ActionDataService.initActionStates();

Error in internal.matlab.variableeditor.peer.RemoteManager/callInitActionOnIdle (line 376)

ActionManager.initActions(startPath, classType);

Error in internal.matlab.variableeditor.peer.RemoteManager>@()this.callInitActionOnIdle(actionNamespace,startPath,classType,ActionManager) (line 121)

builtin(‘_dtcallback’, @() this.callInitActionOnIdle(actionNamespace, startPath, classType, ActionManager), … The Summery is essentially it. I created a script four months ago and accidentially used the wrong syntax (&&) and it has corrupted my Matlab Online. I can run scripts with only comments, but as soon as I add anything else I get the errors back.

Help? I am so confused

Script I am running:

%% Problem 1

k1 = 10;

k2 = 5;

k3 = 8;

k4 = 10;

k5 = 20;

L1 = [1 0 0 0;

0 1 0 0]

Error Message:

Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to

reduce operands to logical scalar values.

Error in internal.matlab.variableeditor.Actions.struct.EditActionBase/UpdateActionState (line 33)

editable = height(sRows) == 1 && (sRows(2)-sRows(1)+1 == 1);

Error in internal.matlab.variableeditor.VEActionDataService/updateActionStates (line 138)

action.UpdateActionState();

Error in internal.matlab.variableeditor.VEActionDataService/enableListenersAndUpdateActionStates (line 84)

this.updateActionStates();

Error in internal.matlab.variableeditor.VEActionDataService/initActionStates (line 54)

this.enableListenersAndUpdateActionStates();

Error in internal.matlab.datatoolsservices.actiondataservice.ActionManager/initActions (line 55)

this.ActionDataService.initActionStates();

Error in internal.matlab.variableeditor.peer.RemoteManager/callInitActionOnIdle (line 376)

ActionManager.initActions(startPath, classType);

Error in internal.matlab.variableeditor.peer.RemoteManager>@()this.callInitActionOnIdle(actionNamespace,startPath,classType,ActionManager) (line 121)

builtin(‘_dtcallback’, @() this.callInitActionOnIdle(actionNamespace, startPath, classType, ActionManager), … help, persistent error, have i broken matlab? MATLAB Answers — New Questions

## HTML file to PDF file, deal with base64,svg picture problem solution.

HTML file to PDF file, error when processing base64,svg imagesHTML file to PDF file, error when processing base64,svg images HTML file to PDF file, error when processing base64,svg images html, simulink, pdf MATLAB Answers — New Questions

## Include rows containing specific value

I have a 1400*9 table (1400 rows and 9 columns) in MATLAB workspace. Each column has a different name. I want to select rows containing specific value. For example, how can I create a new table containig all rows with value of 0.456 in the column named "Biology"? I tried to use following code, but it gave error.

newData=[Data(find(Data.Biology == 0.456, :))]I have a 1400*9 table (1400 rows and 9 columns) in MATLAB workspace. Each column has a different name. I want to select rows containing specific value. For example, how can I create a new table containig all rows with value of 0.456 in the column named "Biology"? I tried to use following code, but it gave error.

newData=[Data(find(Data.Biology == 0.456, :))] I have a 1400*9 table (1400 rows and 9 columns) in MATLAB workspace. Each column has a different name. I want to select rows containing specific value. For example, how can I create a new table containig all rows with value of 0.456 in the column named "Biology"? I tried to use following code, but it gave error.

newData=[Data(find(Data.Biology == 0.456, :))] table, find MATLAB Answers — New Questions

## Force saved figure to use a specific number of pixels

I am saving different maps, I need to compare some specific pixels, but Matlab somehow adds a line at the bottom (3 pixels) for example when I save my image, which kills everything I try to do later. Is there any method to force exportgraphics to use X pixels horizontally and Y vertically (I mean height and width)? Or when I call my figure to be X and Y dimensions? Force it not to add this line. I tried exportgraphics/export_fig they both fail at it.

It is not random, as only some specific files get the line added and always even if I try to replot, I still did not figure out why this happens, my data have the same resolution/grid.I am saving different maps, I need to compare some specific pixels, but Matlab somehow adds a line at the bottom (3 pixels) for example when I save my image, which kills everything I try to do later. Is there any method to force exportgraphics to use X pixels horizontally and Y vertically (I mean height and width)? Or when I call my figure to be X and Y dimensions? Force it not to add this line. I tried exportgraphics/export_fig they both fail at it.

It is not random, as only some specific files get the line added and always even if I try to replot, I still did not figure out why this happens, my data have the same resolution/grid. I am saving different maps, I need to compare some specific pixels, but Matlab somehow adds a line at the bottom (3 pixels) for example when I save my image, which kills everything I try to do later. Is there any method to force exportgraphics to use X pixels horizontally and Y vertically (I mean height and width)? Or when I call my figure to be X and Y dimensions? Force it not to add this line. I tried exportgraphics/export_fig they both fail at it.

It is not random, as only some specific files get the line added and always even if I try to replot, I still did not figure out why this happens, my data have the same resolution/grid. image-processing, exportgraphics MATLAB Answers — New Questions

## Working in Excel with live on MATLAB

On matlab, I am going to import an Excel file and work on it live in real time.

If I change the value in Excel, I want to reflect it in real time in MATLAB.

However, as far as I know, if you modify it without saving the Excel, it cannot be applied in MATLAB right away.

Is there a way to solve this?On matlab, I am going to import an Excel file and work on it live in real time.

If I change the value in Excel, I want to reflect it in real time in MATLAB.

However, as far as I know, if you modify it without saving the Excel, it cannot be applied in MATLAB right away.

Is there a way to solve this? On matlab, I am going to import an Excel file and work on it live in real time.

If I change the value in Excel, I want to reflect it in real time in MATLAB.

However, as far as I know, if you modify it without saving the Excel, it cannot be applied in MATLAB right away.

Is there a way to solve this? excel, live MATLAB Answers — New Questions

## Logging cmd in multiple diary

Hi,

i’m facing an issue in logging using the matlab ‘diary’ functionality. In the below pseudo-code i have 2 tools and both use diary to log the command window output and one is calling other. The diary off for 2nd tool is terminating the diary for the 1st tool as well due to which the remaining cmd display is not getting logged anywhere.

Here is how the logs are:

Is there a way to use ‘diary’ or some other functionality that would help is logging the command window output for the beow example ?

logger1();

function logger1()

logName = fullfile(pwd, ‘log1.txt’);

diary(logName);

fprintf(‘Initialzing logger 1n’);

fprintf(‘Display Message 1n’);

logger2;

fprintf(‘Display Message 2n’);

fprintf(‘End Logn’);

diary off

end

function logger2()

logName = fullfile(pwd, ‘log2.txt’);

diary(logName);

fprintf(‘Initialzing logger 2n’);

fprintf(‘Display Message 1n’);

fprintf(‘End Logn’);

diary off

endHi,

i’m facing an issue in logging using the matlab ‘diary’ functionality. In the below pseudo-code i have 2 tools and both use diary to log the command window output and one is calling other. The diary off for 2nd tool is terminating the diary for the 1st tool as well due to which the remaining cmd display is not getting logged anywhere.

Here is how the logs are:

Is there a way to use ‘diary’ or some other functionality that would help is logging the command window output for the beow example ?

logger1();

function logger1()

logName = fullfile(pwd, ‘log1.txt’);

diary(logName);

fprintf(‘Initialzing logger 1n’);

fprintf(‘Display Message 1n’);

logger2;

fprintf(‘Display Message 2n’);

fprintf(‘End Logn’);

diary off

end

function logger2()

logName = fullfile(pwd, ‘log2.txt’);

diary(logName);

fprintf(‘Initialzing logger 2n’);

fprintf(‘Display Message 1n’);

fprintf(‘End Logn’);

diary off

end Hi,

i’m facing an issue in logging using the matlab ‘diary’ functionality. In the below pseudo-code i have 2 tools and both use diary to log the command window output and one is calling other. The diary off for 2nd tool is terminating the diary for the 1st tool as well due to which the remaining cmd display is not getting logged anywhere.

Here is how the logs are:

Is there a way to use ‘diary’ or some other functionality that would help is logging the command window output for the beow example ?

logger1();

function logger1()

logName = fullfile(pwd, ‘log1.txt’);

diary(logName);

fprintf(‘Initialzing logger 1n’);

fprintf(‘Display Message 1n’);

logger2;

fprintf(‘Display Message 2n’);

fprintf(‘End Logn’);

diary off

end

function logger2()

logName = fullfile(pwd, ‘log2.txt’);

diary(logName);

fprintf(‘Initialzing logger 2n’);

fprintf(‘Display Message 1n’);

fprintf(‘End Logn’);

diary off

end diary, logging MATLAB Answers — New Questions

## Handling memory when working with very huge data (.mat) files.

I am working with two 5D arrays (A5D and B5D) saved in a big_mat_file.mat file. The size of these arrays is specified in the code below. I want to perform three simple operations on these matrices, as shown in the code. I have access to my university’s computing cluster. When I run the following code with 120 workers and 400GB of memory, I receive the following error

In distcomp/remoteparfor/handleIntervalErrorResult (line 245) In distcomp/remoteparfor/getCompleteIntervals (line 395) In parallel_function>distributed_execution (line 746) In parallel_function (line 578)

Can someone please help me understanding what is causing this error. Is it because of low memory? It there anyother way to do the following operattions?

clear; clc;

load("big_mat_file.mat");

% it has two very huge 5D arrays "A5D" and "B5D", and two small arrays "as" and "bs"

% size of both A5D and B5D is [41 16 8 80 82]

% size of "as" is [1 80] and size of "bs" is [1 82]

xs = -12:0.1:12;

NX = length(xs);

ys = 0:0.4:12;

NY = length(ys);

total_iterations = NX * NY;

results = zeros(total_iterations , 41 , 16, 8);

XXs = zeros(total_iterations, 1);

YYs = zeros(total_iterations, 1);

parfor idx = 1:total_iterations

[ix, iy] = ind2sub([NX, NY], idx);

x = xs(ix);

y = ys(iy);

term1 = 1./(exp(1/y*(A5D-x)) + 10); %operation 1

to_integrate = B5D.*term1; %operation 2

XXs(idx) = x;

YYs(idx) = y;

results(idx, :, :, 🙂 = trapz(as,trapz(bs,to_integrate,5),4); %operation 3

end

XXs = reshape(XXs, [NX, NY]);

YYs = reshape(YYs, [NX, NY]);

results = reshape(results, [NX, NY, 41, 16, 8]);

clear A5D B5D

save(‘saved_data.mat’,’-v7.3′);I am working with two 5D arrays (A5D and B5D) saved in a big_mat_file.mat file. The size of these arrays is specified in the code below. I want to perform three simple operations on these matrices, as shown in the code. I have access to my university’s computing cluster. When I run the following code with 120 workers and 400GB of memory, I receive the following error

In distcomp/remoteparfor/handleIntervalErrorResult (line 245) In distcomp/remoteparfor/getCompleteIntervals (line 395) In parallel_function>distributed_execution (line 746) In parallel_function (line 578)

Can someone please help me understanding what is causing this error. Is it because of low memory? It there anyother way to do the following operattions?

clear; clc;

load("big_mat_file.mat");

% it has two very huge 5D arrays "A5D" and "B5D", and two small arrays "as" and "bs"

% size of both A5D and B5D is [41 16 8 80 82]

% size of "as" is [1 80] and size of "bs" is [1 82]

xs = -12:0.1:12;

NX = length(xs);

ys = 0:0.4:12;

NY = length(ys);

total_iterations = NX * NY;

results = zeros(total_iterations , 41 , 16, 8);

XXs = zeros(total_iterations, 1);

YYs = zeros(total_iterations, 1);

parfor idx = 1:total_iterations

[ix, iy] = ind2sub([NX, NY], idx);

x = xs(ix);

y = ys(iy);

term1 = 1./(exp(1/y*(A5D-x)) + 10); %operation 1

to_integrate = B5D.*term1; %operation 2

XXs(idx) = x;

YYs(idx) = y;

results(idx, :, :, 🙂 = trapz(as,trapz(bs,to_integrate,5),4); %operation 3

end

XXs = reshape(XXs, [NX, NY]);

YYs = reshape(YYs, [NX, NY]);

results = reshape(results, [NX, NY, 41, 16, 8]);

clear A5D B5D

save(‘saved_data.mat’,’-v7.3′); I am working with two 5D arrays (A5D and B5D) saved in a big_mat_file.mat file. The size of these arrays is specified in the code below. I want to perform three simple operations on these matrices, as shown in the code. I have access to my university’s computing cluster. When I run the following code with 120 workers and 400GB of memory, I receive the following error

In distcomp/remoteparfor/handleIntervalErrorResult (line 245) In distcomp/remoteparfor/getCompleteIntervals (line 395) In parallel_function>distributed_execution (line 746) In parallel_function (line 578)

Can someone please help me understanding what is causing this error. Is it because of low memory? It there anyother way to do the following operattions?

clear; clc;

load("big_mat_file.mat");

% it has two very huge 5D arrays "A5D" and "B5D", and two small arrays "as" and "bs"

% size of both A5D and B5D is [41 16 8 80 82]

% size of "as" is [1 80] and size of "bs" is [1 82]

xs = -12:0.1:12;

NX = length(xs);

ys = 0:0.4:12;

NY = length(ys);

total_iterations = NX * NY;

results = zeros(total_iterations , 41 , 16, 8);

XXs = zeros(total_iterations, 1);

YYs = zeros(total_iterations, 1);

parfor idx = 1:total_iterations

[ix, iy] = ind2sub([NX, NY], idx);

x = xs(ix);

y = ys(iy);

term1 = 1./(exp(1/y*(A5D-x)) + 10); %operation 1

to_integrate = B5D.*term1; %operation 2

XXs(idx) = x;

YYs(idx) = y;

results(idx, :, :, 🙂 = trapz(as,trapz(bs,to_integrate,5),4); %operation 3

end

XXs = reshape(XXs, [NX, NY]);

YYs = reshape(YYs, [NX, NY]);

results = reshape(results, [NX, NY, 41, 16, 8]);

clear A5D B5D

save(‘saved_data.mat’,’-v7.3′); parfor, for loop, performance MATLAB Answers — New Questions

## MATLAB code for multi-step differential transform method (MsDTM) for solving system of differential equations

By starting from the standard DTM from this link

https://www.mathworks.com/matlabcentral/answers/2107386-how-to-solve-sir-model-with-using-dtm-differential-transform-method?s_tid=srchtitle

Can anyone help me to adapt the code to MsDTM? Thank youBy starting from the standard DTM from this link

https://www.mathworks.com/matlabcentral/answers/2107386-how-to-solve-sir-model-with-using-dtm-differential-transform-method?s_tid=srchtitle

Can anyone help me to adapt the code to MsDTM? Thank you By starting from the standard DTM from this link

https://www.mathworks.com/matlabcentral/answers/2107386-how-to-solve-sir-model-with-using-dtm-differential-transform-method?s_tid=srchtitle

Can anyone help me to adapt the code to MsDTM? Thank you dtm, differential transform method, differential equations MATLAB Answers — New Questions

## Error using CosimWizardPkg.CosimWizardData/populateHdlHierarchy

I uses cosimulationConfiguration to create a HDL cosimulation block.

I get the following errors

Error using CosimWizardPkg.CosimWizardData/populateHdlHierarchy

Socket connection was closed by the other side

Error in CosimWizardPkg.CosimWizardData/autoFillAllModulesParameters

Error in CosimWizardPkg.ModuleSelection/onNext

Error in CosimWizardPkg.CosimWizardDlg/onNext

Error in cosimulationConfiguration/l_Step4

Error in cosimulationConfiguration/runWorkflow

Error in CosimCommandLineSimulink (line 56)

runWorkflow(c);

Scripts are as follows

%% CosimCommandLineSimulink.m

%% Configure Cosimulation Workflow

% Create a cosimulation configuration object.

%%

c = cosimulationConfiguration(‘Xcelium’,’Simulink’,’top’);

%%

% Set up the HDL file.

%%

c.HDLFiles = {…

‘./src/top.v’, ‘Verilog’,…

‘./src/model.v’, ‘Verilog’,…

};

%%

% Compilation Command

%%

c.HDLCompilationCommand ="xmsc -64bit ./src/model.cpp;" + …

"xmvlog -64bit ./src/top.v ./src/model.v;" + …

"g++ -m64 -o model.o -DNCSC -DCADENCE -D_GLIBCXX_USE_CXX11_ABI=1 " + …

"-DLNX86 -I -I /tools/cds/xceliummain_22.09.004_Linux//tools/systemc/include_pch/64bit " + …

"-I ${TOOL_PATH}/tools/systemc/include/ " + …

"-I ${TOOL_PATH}/tools.lnx86/include " + …

"-I ${TOOL_PATH}/tools/tbsc/include " + …

"-I ${TOOL_PATH}/tools/vic/include " + …

"-c -Wall ./src/*.cpp -fPIC;"+ …

"g++ -m64 -shared -Wl,-G "+ …

"-o systemc.so *.o "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoSim_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoroutines_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libsystemc_sh.so;"+ …

"g++ -m64 -shared -Wl,-G "+ …

"-o systemc.so *.o "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoSim_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoroutines_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libsystemc_sh.so";

%%

% Elaboration

%%

c.HDLElaborationOptions = ‘-64bit -access +wc -messages -loadsc ${PATH}/systemc’;

%%

% Set the clock to a period of 20 ns, and set the reset duration to 15 ns.

%%

specifyClock(c,’clk’,Period=20)

specifyReset(c,’reset’,Duration=15)

specifyInput(c,{‘clk_enable’,’data’,’inv’});

specifyOutput(c,{‘out’});

%%

% Display the port table. It reflects the

% settings just made for output, clock, and reset attributes. The other

% design ports will take on default attributes.

%%

portInterface(c);

%% Generate HDL Cosimulation Block

% Run the workflow to generate an HDL Cosimulation block and the

% accompanying files.

%%

runWorkflow(c);

Complete output when running CosimCommandLineSimulink.m

>> CosimCommandLineSimulink

—– Input Data Ports —–

3×1 table

Name

______________

{‘clk_enable’}

{‘data’ }

{‘inv’ }

—– Output Data Ports —–

2×5 table

Name SampleTime DataType Signed FractionLength

_____________________________ __________ ___________ ______ ______________

{‘default_output_definition’} 1 {‘Inherit’} true 0

{‘out’ } 1 {‘Inherit’} true 0

—– Clock Ports —–

2×3 table

Name Edge Period

____________________________ __________ ______

{‘default_clock_definition’} {‘Rising’} 10

{‘clk’ } {‘Rising’} 20

—– Reset Ports —–

2×3 table

Name InitialValue Duration

____________________________ ____________ ________

{‘default_reset_definition’} 1 8

{‘reset’ } 1 15

—– Unused Ports —–

0×1 empty table

——————– Step 1——————

Select the type of cosimulation you want to do. If the HDL simulator executable you want to use is not on the system path in your environment, you must specify its location.

——————– Step 2——————

Add all VHDL, Verilog, and/or script files to be used in cosimulation to the following table. If the file type cannot be automatically detected or the detection result is incorrect, specify the correct file type in the table. If possible, we will determine the compilation order automatically using HDL simulator provided functionality. Then the HDL files can be added in any order.

——————– Step 3——————

HDL Verifier has automatically generated the following HDL compilation commands. You can customize these commands with optional parameters as specified in the HDL simulator documentation but they are sufficient as shown to compile your HDL code for cosimulation. The HDL files will be compiled when you click Next.

Compiling HDL files. Please wait …

### Compiling HDL design

xmsc(64): 22.09-s004: (c) Copyright 1995-2022 Cadence Design Systems, Inc.

xmsc: [TOOL PATH]/tools/cdsgcc/gcc/9.3/bin/g++ -DNCSC -DCADENCE -DLNX86 -D_GLIBCXX_USE_CXX11_ABI=1 -I[TOOL PATH]/systemc/include_pch/64bit -I[TOOL PATH]/tools/systemc/include/tlm2 -I[TOOL PATH]/tools/systemc/include/cci -I[TOOL PATH]/tools/tbsc/include -I[TOOL PATH]/tools/vic/include -c -Wall ./src/model.cpp

xmvlog(64): 22.09-s004: (c) Copyright 1995-2022 Cadence Design Systems, Inc.

g++: warning: [TOOL PATH]/tools/systemc/include_pch/64bit: linker input file unused because linking not done

…done

——————– Step 4——————

Specify the name of the HDL module for cosimulation. The Cosimulation Wizard will launch the HDL simulator, load the specified module, and populate the port list of that HDL module before the next step. Use "Shared Memory" communication method if your firewall policy does not allow TCP/IP socket communication.

Elaborating and Loading HDL simulation image. Please wait …

### Elaborating HDL design

### Elaboration command: xmelab -64bit -access +wc -messages -loadsc [PATH]/systemc top

xmelab(64): 22.09-s004: (c) Copyright 1995-2022 Cadence Design Systems, Inc.

Elaborating the design hierarchy:

Caching library ‘worklib’ ……. Done

The SystemC(r) Code included in this Product is Copyright 1996 – 2016 by all Contributors. All rights reserved.

The SystemC Code included in this Product has been modified by Cadence Design Systems, Inc. and CoWare, Inc. All such modifications are Copyright (c) 2004-2016 Cadence Design Systems, Inc. and Copyright (c) 2004 CoWare, Inc. All Rights Reserved.

SystemC(r) is a registered trademark of Accellera Systems Initiative, Inc. in the United States and other countries and is used with permission.

Building instance overlay tables: ……………….. Done

Building instance specific data structures.

Loading native compiled code: ……………….. Done

Design hierarchy summary:

Instances Unique

Modules: 2 2

Scalar wires: 6 –

Simulation timescale: 1ns

SystemC Design Summary:

Instances

sc_modules: 1

sc_ports: 5

sc_methods: 1

Writing initial simulation snapshot: worklib.top:module

Waiting for HDL Simulator to startup …

120 seconds to time-out …

To stop this process, press Ctrl+C in MATLAB console.

Waiting for HDL Simulator to startup …

119 seconds to time-out …

To stop this process, press Ctrl+C in MATLAB console.

…done

Error using CosimWizardPkg.CosimWizardData/populateHdlHierarchy

Socket connection was closed by the other side

Error in CosimWizardPkg.CosimWizardData/autoFillAllModulesParameters

Error in CosimWizardPkg.ModuleSelection/onNext

Error in CosimWizardPkg.CosimWizardDlg/onNext

Error in cosimulationConfiguration/l_Step4

Error in cosimulationConfiguration/runWorkflow

Error in CosimCommandLineSimulink (line 56)

runWorkflow(c);

Do you have any idea what is reason?

Note: paths of tools and files are hidden in this question.I uses cosimulationConfiguration to create a HDL cosimulation block.

I get the following errors

Error using CosimWizardPkg.CosimWizardData/populateHdlHierarchy

Socket connection was closed by the other side

Error in CosimWizardPkg.CosimWizardData/autoFillAllModulesParameters

Error in CosimWizardPkg.ModuleSelection/onNext

Error in CosimWizardPkg.CosimWizardDlg/onNext

Error in cosimulationConfiguration/l_Step4

Error in cosimulationConfiguration/runWorkflow

Error in CosimCommandLineSimulink (line 56)

runWorkflow(c);

Scripts are as follows

%% CosimCommandLineSimulink.m

%% Configure Cosimulation Workflow

% Create a cosimulation configuration object.

%%

c = cosimulationConfiguration(‘Xcelium’,’Simulink’,’top’);

%%

% Set up the HDL file.

%%

c.HDLFiles = {…

‘./src/top.v’, ‘Verilog’,…

‘./src/model.v’, ‘Verilog’,…

};

%%

% Compilation Command

%%

c.HDLCompilationCommand ="xmsc -64bit ./src/model.cpp;" + …

"xmvlog -64bit ./src/top.v ./src/model.v;" + …

"g++ -m64 -o model.o -DNCSC -DCADENCE -D_GLIBCXX_USE_CXX11_ABI=1 " + …

"-DLNX86 -I -I /tools/cds/xceliummain_22.09.004_Linux//tools/systemc/include_pch/64bit " + …

"-I ${TOOL_PATH}/tools/systemc/include/ " + …

"-I ${TOOL_PATH}/tools.lnx86/include " + …

"-I ${TOOL_PATH}/tools/tbsc/include " + …

"-I ${TOOL_PATH}/tools/vic/include " + …

"-c -Wall ./src/*.cpp -fPIC;"+ …

"g++ -m64 -shared -Wl,-G "+ …

"-o systemc.so *.o "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoSim_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoroutines_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libsystemc_sh.so;"+ …

"g++ -m64 -shared -Wl,-G "+ …

"-o systemc.so *.o "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoSim_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoroutines_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libsystemc_sh.so";

%%

% Elaboration

%%

c.HDLElaborationOptions = ‘-64bit -access +wc -messages -loadsc ${PATH}/systemc’;

%%

% Set the clock to a period of 20 ns, and set the reset duration to 15 ns.

%%

specifyClock(c,’clk’,Period=20)

specifyReset(c,’reset’,Duration=15)

specifyInput(c,{‘clk_enable’,’data’,’inv’});

specifyOutput(c,{‘out’});

%%

% Display the port table. It reflects the

% settings just made for output, clock, and reset attributes. The other

% design ports will take on default attributes.

%%

portInterface(c);

%% Generate HDL Cosimulation Block

% Run the workflow to generate an HDL Cosimulation block and the

% accompanying files.

%%

runWorkflow(c);

Complete output when running CosimCommandLineSimulink.m

>> CosimCommandLineSimulink

—– Input Data Ports —–

3×1 table

Name

______________

{‘clk_enable’}

{‘data’ }

{‘inv’ }

—– Output Data Ports —–

2×5 table

Name SampleTime DataType Signed FractionLength

_____________________________ __________ ___________ ______ ______________

{‘default_output_definition’} 1 {‘Inherit’} true 0

{‘out’ } 1 {‘Inherit’} true 0

—– Clock Ports —–

2×3 table

Name Edge Period

____________________________ __________ ______

{‘default_clock_definition’} {‘Rising’} 10

{‘clk’ } {‘Rising’} 20

—– Reset Ports —–

2×3 table

Name InitialValue Duration

____________________________ ____________ ________

{‘default_reset_definition’} 1 8

{‘reset’ } 1 15

—– Unused Ports —–

0×1 empty table

——————– Step 1——————

Select the type of cosimulation you want to do. If the HDL simulator executable you want to use is not on the system path in your environment, you must specify its location.

——————– Step 2——————

Add all VHDL, Verilog, and/or script files to be used in cosimulation to the following table. If the file type cannot be automatically detected or the detection result is incorrect, specify the correct file type in the table. If possible, we will determine the compilation order automatically using HDL simulator provided functionality. Then the HDL files can be added in any order.

——————– Step 3——————

HDL Verifier has automatically generated the following HDL compilation commands. You can customize these commands with optional parameters as specified in the HDL simulator documentation but they are sufficient as shown to compile your HDL code for cosimulation. The HDL files will be compiled when you click Next.

Compiling HDL files. Please wait …

### Compiling HDL design

xmsc(64): 22.09-s004: (c) Copyright 1995-2022 Cadence Design Systems, Inc.

xmsc: [TOOL PATH]/tools/cdsgcc/gcc/9.3/bin/g++ -DNCSC -DCADENCE -DLNX86 -D_GLIBCXX_USE_CXX11_ABI=1 -I[TOOL PATH]/systemc/include_pch/64bit -I[TOOL PATH]/tools/systemc/include/tlm2 -I[TOOL PATH]/tools/systemc/include/cci -I[TOOL PATH]/tools/tbsc/include -I[TOOL PATH]/tools/vic/include -c -Wall ./src/model.cpp

xmvlog(64): 22.09-s004: (c) Copyright 1995-2022 Cadence Design Systems, Inc.

g++: warning: [TOOL PATH]/tools/systemc/include_pch/64bit: linker input file unused because linking not done

…done

——————– Step 4——————

Specify the name of the HDL module for cosimulation. The Cosimulation Wizard will launch the HDL simulator, load the specified module, and populate the port list of that HDL module before the next step. Use "Shared Memory" communication method if your firewall policy does not allow TCP/IP socket communication.

Elaborating and Loading HDL simulation image. Please wait …

### Elaborating HDL design

### Elaboration command: xmelab -64bit -access +wc -messages -loadsc [PATH]/systemc top

xmelab(64): 22.09-s004: (c) Copyright 1995-2022 Cadence Design Systems, Inc.

Elaborating the design hierarchy:

Caching library ‘worklib’ ……. Done

The SystemC(r) Code included in this Product is Copyright 1996 – 2016 by all Contributors. All rights reserved.

The SystemC Code included in this Product has been modified by Cadence Design Systems, Inc. and CoWare, Inc. All such modifications are Copyright (c) 2004-2016 Cadence Design Systems, Inc. and Copyright (c) 2004 CoWare, Inc. All Rights Reserved.

SystemC(r) is a registered trademark of Accellera Systems Initiative, Inc. in the United States and other countries and is used with permission.

Building instance overlay tables: ……………….. Done

Building instance specific data structures.

Loading native compiled code: ……………….. Done

Design hierarchy summary:

Instances Unique

Modules: 2 2

Scalar wires: 6 –

Simulation timescale: 1ns

SystemC Design Summary:

Instances

sc_modules: 1

sc_ports: 5

sc_methods: 1

Writing initial simulation snapshot: worklib.top:module

Waiting for HDL Simulator to startup …

120 seconds to time-out …

To stop this process, press Ctrl+C in MATLAB console.

Waiting for HDL Simulator to startup …

119 seconds to time-out …

To stop this process, press Ctrl+C in MATLAB console.

…done

Error using CosimWizardPkg.CosimWizardData/populateHdlHierarchy

Socket connection was closed by the other side

Error in CosimWizardPkg.CosimWizardData/autoFillAllModulesParameters

Error in CosimWizardPkg.ModuleSelection/onNext

Error in CosimWizardPkg.CosimWizardDlg/onNext

Error in cosimulationConfiguration/l_Step4

Error in cosimulationConfiguration/runWorkflow

Error in CosimCommandLineSimulink (line 56)

runWorkflow(c);

Do you have any idea what is reason?

Note: paths of tools and files are hidden in this question. I uses cosimulationConfiguration to create a HDL cosimulation block.

I get the following errors

Error using CosimWizardPkg.CosimWizardData/populateHdlHierarchy

Socket connection was closed by the other side

Error in CosimWizardPkg.CosimWizardData/autoFillAllModulesParameters

Error in CosimWizardPkg.ModuleSelection/onNext

Error in CosimWizardPkg.CosimWizardDlg/onNext

Error in cosimulationConfiguration/l_Step4

Error in cosimulationConfiguration/runWorkflow

Error in CosimCommandLineSimulink (line 56)

runWorkflow(c);

Scripts are as follows

%% CosimCommandLineSimulink.m

%% Configure Cosimulation Workflow

% Create a cosimulation configuration object.

%%

c = cosimulationConfiguration(‘Xcelium’,’Simulink’,’top’);

%%

% Set up the HDL file.

%%

c.HDLFiles = {…

‘./src/top.v’, ‘Verilog’,…

‘./src/model.v’, ‘Verilog’,…

};

%%

% Compilation Command

%%

c.HDLCompilationCommand ="xmsc -64bit ./src/model.cpp;" + …

"xmvlog -64bit ./src/top.v ./src/model.v;" + …

"g++ -m64 -o model.o -DNCSC -DCADENCE -D_GLIBCXX_USE_CXX11_ABI=1 " + …

"-DLNX86 -I -I /tools/cds/xceliummain_22.09.004_Linux//tools/systemc/include_pch/64bit " + …

"-I ${TOOL_PATH}/tools/systemc/include/ " + …

"-I ${TOOL_PATH}/tools.lnx86/include " + …

"-I ${TOOL_PATH}/tools/tbsc/include " + …

"-I ${TOOL_PATH}/tools/vic/include " + …

"-c -Wall ./src/*.cpp -fPIC;"+ …

"g++ -m64 -shared -Wl,-G "+ …

"-o systemc.so *.o "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoSim_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoroutines_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libsystemc_sh.so;"+ …

"g++ -m64 -shared -Wl,-G "+ …

"-o systemc.so *.o "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoSim_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libncscCoroutines_sh.so "+ …

"${TOOL_PATH}/tools/systemc/lib/64bit/libsystemc_sh.so";

%%

% Elaboration

%%

c.HDLElaborationOptions = ‘-64bit -access +wc -messages -loadsc ${PATH}/systemc’;

%%

% Set the clock to a period of 20 ns, and set the reset duration to 15 ns.

%%

specifyClock(c,’clk’,Period=20)

specifyReset(c,’reset’,Duration=15)

specifyInput(c,{‘clk_enable’,’data’,’inv’});

specifyOutput(c,{‘out’});

%%

% Display the port table. It reflects the

% settings just made for output, clock, and reset attributes. The other

% design ports will take on default attributes.

%%

portInterface(c);

%% Generate HDL Cosimulation Block

% Run the workflow to generate an HDL Cosimulation block and the

% accompanying files.

%%

runWorkflow(c);

Complete output when running CosimCommandLineSimulink.m

>> CosimCommandLineSimulink

—– Input Data Ports —–

3×1 table

Name

______________

{‘clk_enable’}

{‘data’ }

{‘inv’ }

—– Output Data Ports —–

2×5 table

Name SampleTime DataType Signed FractionLength

_____________________________ __________ ___________ ______ ______________

{‘default_output_definition’} 1 {‘Inherit’} true 0

{‘out’ } 1 {‘Inherit’} true 0

—– Clock Ports —–

2×3 table

Name Edge Period

____________________________ __________ ______

{‘default_clock_definition’} {‘Rising’} 10

{‘clk’ } {‘Rising’} 20

—– Reset Ports —–

2×3 table

Name InitialValue Duration

____________________________ ____________ ________

{‘default_reset_definition’} 1 8

{‘reset’ } 1 15

—– Unused Ports —–

0×1 empty table

——————– Step 1——————

Select the type of cosimulation you want to do. If the HDL simulator executable you want to use is not on the system path in your environment, you must specify its location.

——————– Step 2——————

Add all VHDL, Verilog, and/or script files to be used in cosimulation to the following table. If the file type cannot be automatically detected or the detection result is incorrect, specify the correct file type in the table. If possible, we will determine the compilation order automatically using HDL simulator provided functionality. Then the HDL files can be added in any order.

——————– Step 3——————

HDL Verifier has automatically generated the following HDL compilation commands. You can customize these commands with optional parameters as specified in the HDL simulator documentation but they are sufficient as shown to compile your HDL code for cosimulation. The HDL files will be compiled when you click Next.

Compiling HDL files. Please wait …

### Compiling HDL design

xmsc(64): 22.09-s004: (c) Copyright 1995-2022 Cadence Design Systems, Inc.

xmsc: [TOOL PATH]/tools/cdsgcc/gcc/9.3/bin/g++ -DNCSC -DCADENCE -DLNX86 -D_GLIBCXX_USE_CXX11_ABI=1 -I[TOOL PATH]/systemc/include_pch/64bit -I[TOOL PATH]/tools/systemc/include/tlm2 -I[TOOL PATH]/tools/systemc/include/cci -I[TOOL PATH]/tools/tbsc/include -I[TOOL PATH]/tools/vic/include -c -Wall ./src/model.cpp

xmvlog(64): 22.09-s004: (c) Copyright 1995-2022 Cadence Design Systems, Inc.

g++: warning: [TOOL PATH]/tools/systemc/include_pch/64bit: linker input file unused because linking not done

…done

——————– Step 4——————

Specify the name of the HDL module for cosimulation. The Cosimulation Wizard will launch the HDL simulator, load the specified module, and populate the port list of that HDL module before the next step. Use "Shared Memory" communication method if your firewall policy does not allow TCP/IP socket communication.

Elaborating and Loading HDL simulation image. Please wait …

### Elaborating HDL design

### Elaboration command: xmelab -64bit -access +wc -messages -loadsc [PATH]/systemc top

xmelab(64): 22.09-s004: (c) Copyright 1995-2022 Cadence Design Systems, Inc.

Elaborating the design hierarchy:

Caching library ‘worklib’ ……. Done

The SystemC(r) Code included in this Product is Copyright 1996 – 2016 by all Contributors. All rights reserved.

The SystemC Code included in this Product has been modified by Cadence Design Systems, Inc. and CoWare, Inc. All such modifications are Copyright (c) 2004-2016 Cadence Design Systems, Inc. and Copyright (c) 2004 CoWare, Inc. All Rights Reserved.

SystemC(r) is a registered trademark of Accellera Systems Initiative, Inc. in the United States and other countries and is used with permission.

Building instance overlay tables: ……………….. Done

Building instance specific data structures.

Loading native compiled code: ……………….. Done

Design hierarchy summary:

Instances Unique

Modules: 2 2

Scalar wires: 6 –

Simulation timescale: 1ns

SystemC Design Summary:

Instances

sc_modules: 1

sc_ports: 5

sc_methods: 1

Writing initial simulation snapshot: worklib.top:module

Waiting for HDL Simulator to startup …

120 seconds to time-out …

To stop this process, press Ctrl+C in MATLAB console.

Waiting for HDL Simulator to startup …

119 seconds to time-out …

To stop this process, press Ctrl+C in MATLAB console.

…done

Error using CosimWizardPkg.CosimWizardData/populateHdlHierarchy

Socket connection was closed by the other side

Error in CosimWizardPkg.CosimWizardData/autoFillAllModulesParameters

Error in CosimWizardPkg.ModuleSelection/onNext

Error in CosimWizardPkg.CosimWizardDlg/onNext

Error in cosimulationConfiguration/l_Step4

Error in cosimulationConfiguration/runWorkflow

Error in CosimCommandLineSimulink (line 56)

runWorkflow(c);

Do you have any idea what is reason?

Note: paths of tools and files are hidden in this question. hdlverifier, cosimulationconfiguration, simulink, cadence, xcelium MATLAB Answers — New Questions

## MATLAB standalone app installation without administrator

Hi,

I am trying to make some MATLAB apps for people without MATLAB licenses at work. I compiled them as standalone apps with the runtime libraries included in the package so they don’t have to be downloaded and installed separately. However, the app requires admin privileges to install. This isn’t very pleasant since we have to request IT for each installation.

Is there a way to eliminate the need for administrator privileges? I tried moving the installation directory to the user directory instead of Program Files but that didn’t help as well.

Thanks,

AbinavHi,

I am trying to make some MATLAB apps for people without MATLAB licenses at work. I compiled them as standalone apps with the runtime libraries included in the package so they don’t have to be downloaded and installed separately. However, the app requires admin privileges to install. This isn’t very pleasant since we have to request IT for each installation.

Is there a way to eliminate the need for administrator privileges? I tried moving the installation directory to the user directory instead of Program Files but that didn’t help as well.

Thanks,

Abinav Hi,

I am trying to make some MATLAB apps for people without MATLAB licenses at work. I compiled them as standalone apps with the runtime libraries included in the package so they don’t have to be downloaded and installed separately. However, the app requires admin privileges to install. This isn’t very pleasant since we have to request IT for each installation.

Is there a way to eliminate the need for administrator privileges? I tried moving the installation directory to the user directory instead of Program Files but that didn’t help as well.

Thanks,

Abinav matlab app, matlab compiler, administrator MATLAB Answers — New Questions

## Where are “files installed for your end user” are saved in the installation directory using compiler?

I have a few matrices that I want to load in the app using the load command.

Temporarily the files are saved like this:

load C:UserssepandDocumentsMATLABBY.mat;

what path should I set them to so that they would be accessible to the main program after compilation?I have a few matrices that I want to load in the app using the load command.

Temporarily the files are saved like this:

load C:UserssepandDocumentsMATLABBY.mat;

what path should I set them to so that they would be accessible to the main program after compilation? I have a few matrices that I want to load in the app using the load command.

Temporarily the files are saved like this:

load C:UserssepandDocumentsMATLABBY.mat;

what path should I set them to so that they would be accessible to the main program after compilation? matlab compiler MATLAB Answers — New Questions

## Confirming a confirmed track for GNN tracker

Hi, I am currently working with a GNN tracker with radar data. I have a tracker working for range and angle information.

After gettting the confirmed tracks, I would like to check make another check with some detections and then keep the old track alive. How can I achieve this? I saw that there is a trackStateLogic which is appended with a zero everytime a track does not get a detection. But I was uable to change it for a confirmed track.

Can someone please help me in this?Hi, I am currently working with a GNN tracker with radar data. I have a tracker working for range and angle information.

After gettting the confirmed tracks, I would like to check make another check with some detections and then keep the old track alive. How can I achieve this? I saw that there is a trackStateLogic which is appended with a zero everytime a track does not get a detection. But I was uable to change it for a confirmed track.

Can someone please help me in this? Hi, I am currently working with a GNN tracker with radar data. I have a tracker working for range and angle information.

After gettting the confirmed tracks, I would like to check make another check with some detections and then keep the old track alive. How can I achieve this? I saw that there is a trackStateLogic which is appended with a zero everytime a track does not get a detection. But I was uable to change it for a confirmed track.

Can someone please help me in this? gnn tracker MATLAB Answers — New Questions