Author: PuTI
Can I solve a symetric system using only the lower triangular portion of the matrix?
I have a sparse, complex-valued symmetric matrix, Afull, where I have stored only the lower triangular component (and diagonal) as matrix A.
spy(A) looks like:
mldivide of A is poorly conditioned:
>> u=Ab;
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 7.011677e-19.
I get the same error when I specify that the matrix is lower-triangular in LINSOLVE:
>> opts.LT=true;u=linsolve(full(A),b,opts);
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
RCOND = 7.011677e-19.
When I re-build the full matrix from the LT(+diagonal) component A:
>> Afull=A+A’;
>> for ii=1:size(A,1)
Afull(ii,ii)=A(ii,ii);
end
spy(Afull) looks like:
>> ufull=Afullb;
>>
The matrix condition is now fine.
Is it possible to get Matlab to solve the système with ONLY the lower component (A)?I have a sparse, complex-valued symmetric matrix, Afull, where I have stored only the lower triangular component (and diagonal) as matrix A.
spy(A) looks like:
mldivide of A is poorly conditioned:
>> u=Ab;
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 7.011677e-19.
I get the same error when I specify that the matrix is lower-triangular in LINSOLVE:
>> opts.LT=true;u=linsolve(full(A),b,opts);
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
RCOND = 7.011677e-19.
When I re-build the full matrix from the LT(+diagonal) component A:
>> Afull=A+A’;
>> for ii=1:size(A,1)
Afull(ii,ii)=A(ii,ii);
end
spy(Afull) looks like:
>> ufull=Afullb;
>>
The matrix condition is now fine.
Is it possible to get Matlab to solve the système with ONLY the lower component (A)? I have a sparse, complex-valued symmetric matrix, Afull, where I have stored only the lower triangular component (and diagonal) as matrix A.
spy(A) looks like:
mldivide of A is poorly conditioned:
>> u=Ab;
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 7.011677e-19.
I get the same error when I specify that the matrix is lower-triangular in LINSOLVE:
>> opts.LT=true;u=linsolve(full(A),b,opts);
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
RCOND = 7.011677e-19.
When I re-build the full matrix from the LT(+diagonal) component A:
>> Afull=A+A’;
>> for ii=1:size(A,1)
Afull(ii,ii)=A(ii,ii);
end
spy(Afull) looks like:
>> ufull=Afullb;
>>
The matrix condition is now fine.
Is it possible to get Matlab to solve the système with ONLY the lower component (A)? sparse matrix, symmetric, complex valued, lower triangular, upper triangular, mldivide, linsolve MATLAB Answers — New Questions
Clock domain crossing in hdl coder
I have an application where i’m generating HDL in a cyclone V for an MII interface to an Ethernet PHY. I read the documentation about using a triggered subystem as a separate clock ( https://www.mathworks.com/help/hdlcoder/ug/use-triggered-subsystem-for-asynchronous-clock-domain.html ) and I noticed the verilog code does treat the RXC signal as a true clock. However, I’m having trouble getting the CDC logic to convert properly. It seems even when I use a Dual Rate Dual Port RAM with different sample rates, it still uses a single clock with clock enables to derive the different rates rather than using RXC as the clock for port A and IPCORE_CLK for port B. I also see no option to use an asynchronous FIFO (dcfifo) in the libraray browser. How can i properly implement CDC logic using simulink tools?I have an application where i’m generating HDL in a cyclone V for an MII interface to an Ethernet PHY. I read the documentation about using a triggered subystem as a separate clock ( https://www.mathworks.com/help/hdlcoder/ug/use-triggered-subsystem-for-asynchronous-clock-domain.html ) and I noticed the verilog code does treat the RXC signal as a true clock. However, I’m having trouble getting the CDC logic to convert properly. It seems even when I use a Dual Rate Dual Port RAM with different sample rates, it still uses a single clock with clock enables to derive the different rates rather than using RXC as the clock for port A and IPCORE_CLK for port B. I also see no option to use an asynchronous FIFO (dcfifo) in the libraray browser. How can i properly implement CDC logic using simulink tools? I have an application where i’m generating HDL in a cyclone V for an MII interface to an Ethernet PHY. I read the documentation about using a triggered subystem as a separate clock ( https://www.mathworks.com/help/hdlcoder/ug/use-triggered-subsystem-for-asynchronous-clock-domain.html ) and I noticed the verilog code does treat the RXC signal as a true clock. However, I’m having trouble getting the CDC logic to convert properly. It seems even when I use a Dual Rate Dual Port RAM with different sample rates, it still uses a single clock with clock enables to derive the different rates rather than using RXC as the clock for port A and IPCORE_CLK for port B. I also see no option to use an asynchronous FIFO (dcfifo) in the libraray browser. How can i properly implement CDC logic using simulink tools? hdl coder MATLAB Answers — New Questions
How to call kummerU for a stand alone program
Can someone help me with the question how to call the Matlab function kummerU used in an application which I want to compile for stand alone use?
Thanks in advance,
Ed Veling
Matlab, R2025aCan someone help me with the question how to call the Matlab function kummerU used in an application which I want to compile for stand alone use?
Thanks in advance,
Ed Veling
Matlab, R2025a Can someone help me with the question how to call the Matlab function kummerU used in an application which I want to compile for stand alone use?
Thanks in advance,
Ed Veling
Matlab, R2025a kummeru MATLAB Answers — New Questions
‘untitled_cgxe.mexw64’ removed
I’m learning real-time audio processing with the webinar "Real-time Audio Processing for Algorithm Prototyping and Custom Measurements" (https://se.mathworks.com/videos/real-time-audio-processing-for-algorithm-prototyping-and-custom-measurements-121075.html) videos and scripts.
The scripts work well in Matlab, but when I try to run the simulink model as described in the video,
I got the following errors:
### Build procedure for model: ‘untitled’ aborted due to an error.
Problem creating simulation target for the model ‘untitled’.
Component:Simulink | Category:Model error
Error(s) encountered while building simulation target MEX-file for model ‘untitled’.
Caused by:
F:codematlab_dspmyrealtimeslprj_cgxeuntitledsrc>"D:Matlab 2018bsyslcc64lcc64binlccmake.exe" -f untitled_cgxe.lmk
cannot open 2018bexternlibwin64microsoft
"D:Matlab 2018bsyslcc64lcc64binlcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -nodeclspec -I"D:Matlab 2018bexterninclude" -I"D:Matlab 2018bsimulinkinclude" -I"D:Matlab 2018brtwcsrc" -I"F:研究生可听化codematlab_dspmyrealtime" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cprj" -I"D:Matlab 2018bsyslcc64lcc64include64" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cgxeuntitledsrc" -I"D:Matlab 2018btoolboxsharedspcsrc_mlexterninclude" "untitled_cgxe.c"
"D:Matlab 2018bsyslcc64lcc64binlcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -nodeclspec -I"D:Matlab 2018bexterninclude" -I"D:Matlab 2018bsimulinkinclude" -I"D:Matlab 2018brtwcsrc" -I"F:研究生可听化codematlab_dspmyrealtime" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cprj" -I"D:Matlab 2018bsyslcc64lcc64include64" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cgxeuntitledsrc" -I"D:Matlab 2018btoolboxsharedspcsrc_mlexterninclude" "m_Gylj7rInPPNWHHI52iOhLH.c"
"D:Matlab 2018bsyslcc64lcc64binlcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -nodeclspec -I"D:Matlab 2018bexterninclude" -I"D:Matlab 2018bsimulinkinclude" -I"D:Matlab 2018brtwcsrc" -I"F:研究生可听化codematlab_dspmyrealtime" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cprj" -I"D:Matlab 2018bsyslcc64lcc64include64" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cgxeuntitledsrc" -I"D:Matlab 2018btoolboxsharedspcsrc_mlexterninclude" "untitled_cgxe_registry.c"
"D:Matlab 2018bsyslcc64lcc64binlcclnk64.exe" -s -dll -L"D:Matlab 2018bsyslcc64lcc64lib64" -entry LibMain -map sfun.map -o untitled_cgxe.mexw64 @untitled_cgxe.lmko
D:Matlab 2018bsyslcc64lcc64binlccmake.exe: Error code 1
D:Matlab 2018bsyslcc64lcc64binlccmake.exe: ‘untitled_cgxe.mexw64’ removed.
Thank you!I’m learning real-time audio processing with the webinar "Real-time Audio Processing for Algorithm Prototyping and Custom Measurements" (https://se.mathworks.com/videos/real-time-audio-processing-for-algorithm-prototyping-and-custom-measurements-121075.html) videos and scripts.
The scripts work well in Matlab, but when I try to run the simulink model as described in the video,
I got the following errors:
### Build procedure for model: ‘untitled’ aborted due to an error.
Problem creating simulation target for the model ‘untitled’.
Component:Simulink | Category:Model error
Error(s) encountered while building simulation target MEX-file for model ‘untitled’.
Caused by:
F:codematlab_dspmyrealtimeslprj_cgxeuntitledsrc>"D:Matlab 2018bsyslcc64lcc64binlccmake.exe" -f untitled_cgxe.lmk
cannot open 2018bexternlibwin64microsoft
"D:Matlab 2018bsyslcc64lcc64binlcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -nodeclspec -I"D:Matlab 2018bexterninclude" -I"D:Matlab 2018bsimulinkinclude" -I"D:Matlab 2018brtwcsrc" -I"F:研究生可听化codematlab_dspmyrealtime" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cprj" -I"D:Matlab 2018bsyslcc64lcc64include64" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cgxeuntitledsrc" -I"D:Matlab 2018btoolboxsharedspcsrc_mlexterninclude" "untitled_cgxe.c"
"D:Matlab 2018bsyslcc64lcc64binlcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -nodeclspec -I"D:Matlab 2018bexterninclude" -I"D:Matlab 2018bsimulinkinclude" -I"D:Matlab 2018brtwcsrc" -I"F:研究生可听化codematlab_dspmyrealtime" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cprj" -I"D:Matlab 2018bsyslcc64lcc64include64" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cgxeuntitledsrc" -I"D:Matlab 2018btoolboxsharedspcsrc_mlexterninclude" "m_Gylj7rInPPNWHHI52iOhLH.c"
"D:Matlab 2018bsyslcc64lcc64binlcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -nodeclspec -I"D:Matlab 2018bexterninclude" -I"D:Matlab 2018bsimulinkinclude" -I"D:Matlab 2018brtwcsrc" -I"F:研究生可听化codematlab_dspmyrealtime" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cprj" -I"D:Matlab 2018bsyslcc64lcc64include64" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cgxeuntitledsrc" -I"D:Matlab 2018btoolboxsharedspcsrc_mlexterninclude" "untitled_cgxe_registry.c"
"D:Matlab 2018bsyslcc64lcc64binlcclnk64.exe" -s -dll -L"D:Matlab 2018bsyslcc64lcc64lib64" -entry LibMain -map sfun.map -o untitled_cgxe.mexw64 @untitled_cgxe.lmko
D:Matlab 2018bsyslcc64lcc64binlccmake.exe: Error code 1
D:Matlab 2018bsyslcc64lcc64binlccmake.exe: ‘untitled_cgxe.mexw64’ removed.
Thank you! I’m learning real-time audio processing with the webinar "Real-time Audio Processing for Algorithm Prototyping and Custom Measurements" (https://se.mathworks.com/videos/real-time-audio-processing-for-algorithm-prototyping-and-custom-measurements-121075.html) videos and scripts.
The scripts work well in Matlab, but when I try to run the simulink model as described in the video,
I got the following errors:
### Build procedure for model: ‘untitled’ aborted due to an error.
Problem creating simulation target for the model ‘untitled’.
Component:Simulink | Category:Model error
Error(s) encountered while building simulation target MEX-file for model ‘untitled’.
Caused by:
F:codematlab_dspmyrealtimeslprj_cgxeuntitledsrc>"D:Matlab 2018bsyslcc64lcc64binlccmake.exe" -f untitled_cgxe.lmk
cannot open 2018bexternlibwin64microsoft
"D:Matlab 2018bsyslcc64lcc64binlcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -nodeclspec -I"D:Matlab 2018bexterninclude" -I"D:Matlab 2018bsimulinkinclude" -I"D:Matlab 2018brtwcsrc" -I"F:研究生可听化codematlab_dspmyrealtime" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cprj" -I"D:Matlab 2018bsyslcc64lcc64include64" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cgxeuntitledsrc" -I"D:Matlab 2018btoolboxsharedspcsrc_mlexterninclude" "untitled_cgxe.c"
"D:Matlab 2018bsyslcc64lcc64binlcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -nodeclspec -I"D:Matlab 2018bexterninclude" -I"D:Matlab 2018bsimulinkinclude" -I"D:Matlab 2018brtwcsrc" -I"F:研究生可听化codematlab_dspmyrealtime" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cprj" -I"D:Matlab 2018bsyslcc64lcc64include64" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cgxeuntitledsrc" -I"D:Matlab 2018btoolboxsharedspcsrc_mlexterninclude" "m_Gylj7rInPPNWHHI52iOhLH.c"
"D:Matlab 2018bsyslcc64lcc64binlcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -nodeclspec -I"D:Matlab 2018bexterninclude" -I"D:Matlab 2018bsimulinkinclude" -I"D:Matlab 2018brtwcsrc" -I"F:研究生可听化codematlab_dspmyrealtime" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cprj" -I"D:Matlab 2018bsyslcc64lcc64include64" -I"F:研究生可听化codematlab_dspmyrealtimeslprj_cgxeuntitledsrc" -I"D:Matlab 2018btoolboxsharedspcsrc_mlexterninclude" "untitled_cgxe_registry.c"
"D:Matlab 2018bsyslcc64lcc64binlcclnk64.exe" -s -dll -L"D:Matlab 2018bsyslcc64lcc64lib64" -entry LibMain -map sfun.map -o untitled_cgxe.mexw64 @untitled_cgxe.lmko
D:Matlab 2018bsyslcc64lcc64binlccmake.exe: Error code 1
D:Matlab 2018bsyslcc64lcc64binlccmake.exe: ‘untitled_cgxe.mexw64’ removed.
Thank you! audio MATLAB Answers — New Questions
Parameter stability testing for Austria
Dear all,
I am having a major issue at testing for parameter stability, using ESS procedure, developed by Inoue and Rossi. For Slovenia and Italy, I obtain perfect result, a positive SupLR value, that is result of Andrews (1993) QLR test. However, for Austria, the value is negative! If I make a modification to the formula for Chow test, than the SupLR value becomes positive, however, I can’t change the methodology for consistency reasons.
Does anyone have any idea what is wrong with Austria?
Thank you so much!
Here is the formula, line 53 in attached file:
original with minus in the beginning:
chow=-2* (L-(L1*(t2/T)+(1-t2/T)*L2));
2. modified without minus in the beginning:
chow=2* (L-(L1*(t2/T)+(1-t2/T)*L2));Dear all,
I am having a major issue at testing for parameter stability, using ESS procedure, developed by Inoue and Rossi. For Slovenia and Italy, I obtain perfect result, a positive SupLR value, that is result of Andrews (1993) QLR test. However, for Austria, the value is negative! If I make a modification to the formula for Chow test, than the SupLR value becomes positive, however, I can’t change the methodology for consistency reasons.
Does anyone have any idea what is wrong with Austria?
Thank you so much!
Here is the formula, line 53 in attached file:
original with minus in the beginning:
chow=-2* (L-(L1*(t2/T)+(1-t2/T)*L2));
2. modified without minus in the beginning:
chow=2* (L-(L1*(t2/T)+(1-t2/T)*L2)); Dear all,
I am having a major issue at testing for parameter stability, using ESS procedure, developed by Inoue and Rossi. For Slovenia and Italy, I obtain perfect result, a positive SupLR value, that is result of Andrews (1993) QLR test. However, for Austria, the value is negative! If I make a modification to the formula for Chow test, than the SupLR value becomes positive, however, I can’t change the methodology for consistency reasons.
Does anyone have any idea what is wrong with Austria?
Thank you so much!
Here is the formula, line 53 in attached file:
original with minus in the beginning:
chow=-2* (L-(L1*(t2/T)+(1-t2/T)*L2));
2. modified without minus in the beginning:
chow=2* (L-(L1*(t2/T)+(1-t2/T)*L2)); parameter stability testing MATLAB Answers — New Questions
como utilizar a licença MatLab 2023b
Olá tenho um modelo feito no MatLab 2023b, mas não abre no MatLab 2026a, gostaria de obter a licença trial para acessar o meu modelo.Olá tenho um modelo feito no MatLab 2023b, mas não abre no MatLab 2026a, gostaria de obter a licença trial para acessar o meu modelo. Olá tenho um modelo feito no MatLab 2023b, mas não abre no MatLab 2026a, gostaria de obter a licença trial para acessar o meu modelo. matlab, r2023b, simulink MATLAB Answers — New Questions
How do I perform Image segmentation in an RGB image using pattern?
I want to create 2 segment in the attached RGB interference image. 1 segment would be the horseshoe pattern as can be observed in the image and the other segment would be rest of the image. So far I have tried: Edge detection using Canny, Kmeans cluster, imsegkmeans.
The clustering is almost working, but I get cluster within a cluster due to the RGB values. I want to avoid that and have just two segments from the image.I want to create 2 segment in the attached RGB interference image. 1 segment would be the horseshoe pattern as can be observed in the image and the other segment would be rest of the image. So far I have tried: Edge detection using Canny, Kmeans cluster, imsegkmeans.
The clustering is almost working, but I get cluster within a cluster due to the RGB values. I want to avoid that and have just two segments from the image. I want to create 2 segment in the attached RGB interference image. 1 segment would be the horseshoe pattern as can be observed in the image and the other segment would be rest of the image. So far I have tried: Edge detection using Canny, Kmeans cluster, imsegkmeans.
The clustering is almost working, but I get cluster within a cluster due to the RGB values. I want to avoid that and have just two segments from the image. image processing, image segmentation MATLAB Answers — New Questions
how to prepare numeric data for classification of faults to import in deep network designer app in matlab
how to prepare numeric data for classification of faults in MMC to import in deep network designer app in matlabhow to prepare numeric data for classification of faults in MMC to import in deep network designer app in matlab how to prepare numeric data for classification of faults in MMC to import in deep network designer app in matlab numeric data MATLAB Answers — New Questions
How to speed up Simscape Electrical + Thermal simulation?
Hi everyone,
I’m trying to simulate a detailed DAB converter model on MATLAB simulink using simscape electrical components. I got the reference design from the mathworks page. I changed the component parameters based on my design and i also imported mosfet and diode datasheet values onto the ideal mosfet switches. Till now the simulation was running smoothly. Since i wanted to see a more realistic efficiency value, i turned on the thermal port, after this the simulation started to lag.
The simulation currently takes more than 5 mins to run for 0.5 seconds. I tried playing with different solvers, the best one i could find was ode23t. I also tried to match the relative tolerance and absolute tolerance. Tried playing with max step size as well (multiples of 1/fsw). One other thing i tried was enabling minimal zero crossing impact integration in the configuration parameters. I also commented out all the scopes and displays and instead used the log signal option. All this did help speed the simulation a little bit, but not enough.
I ran the solver profiler to identify the underlying issue, it gives a lot of zero crossing erros, like there’s one zero crossing per switching cycle per switch. I don’t see an option to turn the ZC detection off on the mosfet model. Then there’s ZOH resets in the gate driver signals, I’m not sure how to fix this issue. One other major issue is the integrator block in my gate singal logic which is slowing down my simulation a lot. All the other components are in discrete domain so this continous block integrator is the real culprit here i believe. I tried using a discrete integrator block, but since it doesn’t have a wrap state option I wasn’t getting the right input. I also tried generating sawtooth waveforms using the repeating sequence block but even this was giving the same problem since it has a continous domain clock when looked under the mask.
I want to add more components to the simulation and make a detailed heatsink model, but since the simulation is lagging so much I can’t do much. Could you take a look at my simulation file and tell me how i can optimize the model and how to make it faster? Also how do i find the best tolerance value for my configuration setting?
Thank you so much for the help!Hi everyone,
I’m trying to simulate a detailed DAB converter model on MATLAB simulink using simscape electrical components. I got the reference design from the mathworks page. I changed the component parameters based on my design and i also imported mosfet and diode datasheet values onto the ideal mosfet switches. Till now the simulation was running smoothly. Since i wanted to see a more realistic efficiency value, i turned on the thermal port, after this the simulation started to lag.
The simulation currently takes more than 5 mins to run for 0.5 seconds. I tried playing with different solvers, the best one i could find was ode23t. I also tried to match the relative tolerance and absolute tolerance. Tried playing with max step size as well (multiples of 1/fsw). One other thing i tried was enabling minimal zero crossing impact integration in the configuration parameters. I also commented out all the scopes and displays and instead used the log signal option. All this did help speed the simulation a little bit, but not enough.
I ran the solver profiler to identify the underlying issue, it gives a lot of zero crossing erros, like there’s one zero crossing per switching cycle per switch. I don’t see an option to turn the ZC detection off on the mosfet model. Then there’s ZOH resets in the gate driver signals, I’m not sure how to fix this issue. One other major issue is the integrator block in my gate singal logic which is slowing down my simulation a lot. All the other components are in discrete domain so this continous block integrator is the real culprit here i believe. I tried using a discrete integrator block, but since it doesn’t have a wrap state option I wasn’t getting the right input. I also tried generating sawtooth waveforms using the repeating sequence block but even this was giving the same problem since it has a continous domain clock when looked under the mask.
I want to add more components to the simulation and make a detailed heatsink model, but since the simulation is lagging so much I can’t do much. Could you take a look at my simulation file and tell me how i can optimize the model and how to make it faster? Also how do i find the best tolerance value for my configuration setting?
Thank you so much for the help! Hi everyone,
I’m trying to simulate a detailed DAB converter model on MATLAB simulink using simscape electrical components. I got the reference design from the mathworks page. I changed the component parameters based on my design and i also imported mosfet and diode datasheet values onto the ideal mosfet switches. Till now the simulation was running smoothly. Since i wanted to see a more realistic efficiency value, i turned on the thermal port, after this the simulation started to lag.
The simulation currently takes more than 5 mins to run for 0.5 seconds. I tried playing with different solvers, the best one i could find was ode23t. I also tried to match the relative tolerance and absolute tolerance. Tried playing with max step size as well (multiples of 1/fsw). One other thing i tried was enabling minimal zero crossing impact integration in the configuration parameters. I also commented out all the scopes and displays and instead used the log signal option. All this did help speed the simulation a little bit, but not enough.
I ran the solver profiler to identify the underlying issue, it gives a lot of zero crossing erros, like there’s one zero crossing per switching cycle per switch. I don’t see an option to turn the ZC detection off on the mosfet model. Then there’s ZOH resets in the gate driver signals, I’m not sure how to fix this issue. One other major issue is the integrator block in my gate singal logic which is slowing down my simulation a lot. All the other components are in discrete domain so this continous block integrator is the real culprit here i believe. I tried using a discrete integrator block, but since it doesn’t have a wrap state option I wasn’t getting the right input. I also tried generating sawtooth waveforms using the repeating sequence block but even this was giving the same problem since it has a continous domain clock when looked under the mask.
I want to add more components to the simulation and make a detailed heatsink model, but since the simulation is lagging so much I can’t do much. Could you take a look at my simulation file and tell me how i can optimize the model and how to make it faster? Also how do i find the best tolerance value for my configuration setting?
Thank you so much for the help! simscape, converter, optimization, dualactivebridge MATLAB Answers — New Questions
STFT for state of polarization data
For my master’s thesis, I have a lot of data of state of polarization of light (particularly S1 parameter) from undersea fibre optic cables. Now I want to perform anomaly detection on this data so that I can flag any external events like fibre tampering, nearby vessels or earthquakes. The data is unlabelled and I don’t have any idea what an anomaly can look like. So I decided to preprocess the signals and generate the typical FFT, STFT plots. The following plot is obtained for one file (~60 seconds of data sampled at 44.1KHz). I used the log scale to see the entire frequency distribution properly. Any tips on what to infer from this data and how to move forward would be much appreciated. PS: I am completely new to signal processing domain.For my master’s thesis, I have a lot of data of state of polarization of light (particularly S1 parameter) from undersea fibre optic cables. Now I want to perform anomaly detection on this data so that I can flag any external events like fibre tampering, nearby vessels or earthquakes. The data is unlabelled and I don’t have any idea what an anomaly can look like. So I decided to preprocess the signals and generate the typical FFT, STFT plots. The following plot is obtained for one file (~60 seconds of data sampled at 44.1KHz). I used the log scale to see the entire frequency distribution properly. Any tips on what to infer from this data and how to move forward would be much appreciated. PS: I am completely new to signal processing domain. For my master’s thesis, I have a lot of data of state of polarization of light (particularly S1 parameter) from undersea fibre optic cables. Now I want to perform anomaly detection on this data so that I can flag any external events like fibre tampering, nearby vessels or earthquakes. The data is unlabelled and I don’t have any idea what an anomaly can look like. So I decided to preprocess the signals and generate the typical FFT, STFT plots. The following plot is obtained for one file (~60 seconds of data sampled at 44.1KHz). I used the log scale to see the entire frequency distribution properly. Any tips on what to infer from this data and how to move forward would be much appreciated. PS: I am completely new to signal processing domain. fft, signal processing, digital signal processing, signal, matlab MATLAB Answers — New Questions
How to calculate the average value of a vector in MATLAB?
I am a first-year engineering student learning MATLAB for programming course. Recently, I started studying vectors and basic statistical operations, and I am trying to calculate the averaage value of a set of numbers.
I created a vector containing several numerical values and would like to find the mean of all elements in the vector. I understand that the average can be calculated by summing all values and dividing by the number of elements. However, I am not sure what the recommended MATLAB approach is, and whether there is a built-in function that should be used instead of performing the calculation manually.
The vector I am working with is:
A = [10 20 30 40 50];
My goal is to obtain the average value of the numbers stored in this vector.
I have considered calculating the result manually by adding all elements together and dividing by the total number of elements, but I would like to know if there is a more efficient or standard MATLAB method.
Could someone explain how to calculate the average value of this vector in MATLAB and describe the function that should be used? I would also like to understand whether the same method works for vectors with different sizes and larger datasets.
Any explanation suitable for a beginner would be greatly appreciated.I am a first-year engineering student learning MATLAB for programming course. Recently, I started studying vectors and basic statistical operations, and I am trying to calculate the averaage value of a set of numbers.
I created a vector containing several numerical values and would like to find the mean of all elements in the vector. I understand that the average can be calculated by summing all values and dividing by the number of elements. However, I am not sure what the recommended MATLAB approach is, and whether there is a built-in function that should be used instead of performing the calculation manually.
The vector I am working with is:
A = [10 20 30 40 50];
My goal is to obtain the average value of the numbers stored in this vector.
I have considered calculating the result manually by adding all elements together and dividing by the total number of elements, but I would like to know if there is a more efficient or standard MATLAB method.
Could someone explain how to calculate the average value of this vector in MATLAB and describe the function that should be used? I would also like to understand whether the same method works for vectors with different sizes and larger datasets.
Any explanation suitable for a beginner would be greatly appreciated. I am a first-year engineering student learning MATLAB for programming course. Recently, I started studying vectors and basic statistical operations, and I am trying to calculate the averaage value of a set of numbers.
I created a vector containing several numerical values and would like to find the mean of all elements in the vector. I understand that the average can be calculated by summing all values and dividing by the number of elements. However, I am not sure what the recommended MATLAB approach is, and whether there is a built-in function that should be used instead of performing the calculation manually.
The vector I am working with is:
A = [10 20 30 40 50];
My goal is to obtain the average value of the numbers stored in this vector.
I have considered calculating the result manually by adding all elements together and dividing by the total number of elements, but I would like to know if there is a more efficient or standard MATLAB method.
Could someone explain how to calculate the average value of this vector in MATLAB and describe the function that should be used? I would also like to understand whether the same method works for vectors with different sizes and larger datasets.
Any explanation suitable for a beginner would be greatly appreciated. matlab MATLAB Answers — New Questions
Does Matlab Take Full Advantage of the BLAS Routines?
It’s my understanding that Matlab uses BLAS routines under the hood for many matrix algebra operations. Is that correct?
If so, how does Matlab handle an expression like
C = alpha*A’*B’ + beta*C
where A, B, and C are double, real matrices of compatible dimensions and alpha and beta are real scalars?
This assignment can be handled with a single call to LAPACK: dgemm. Is that what Matlab does? Or is the right hand side evaluated with a sequence of calls to @doc:mtimes and @doc:plus?
Based on this discussion I don’t expect either transpose to be formed explicitly. Now I’m wondering about just how far the parser can take such optimizations to minimimize temporary storage and the number of operations, and the impact of such optimization on the documented order of operations.It’s my understanding that Matlab uses BLAS routines under the hood for many matrix algebra operations. Is that correct?
If so, how does Matlab handle an expression like
C = alpha*A’*B’ + beta*C
where A, B, and C are double, real matrices of compatible dimensions and alpha and beta are real scalars?
This assignment can be handled with a single call to LAPACK: dgemm. Is that what Matlab does? Or is the right hand side evaluated with a sequence of calls to @doc:mtimes and @doc:plus?
Based on this discussion I don’t expect either transpose to be formed explicitly. Now I’m wondering about just how far the parser can take such optimizations to minimimize temporary storage and the number of operations, and the impact of such optimization on the documented order of operations. It’s my understanding that Matlab uses BLAS routines under the hood for many matrix algebra operations. Is that correct?
If so, how does Matlab handle an expression like
C = alpha*A’*B’ + beta*C
where A, B, and C are double, real matrices of compatible dimensions and alpha and beta are real scalars?
This assignment can be handled with a single call to LAPACK: dgemm. Is that what Matlab does? Or is the right hand side evaluated with a sequence of calls to @doc:mtimes and @doc:plus?
Based on this discussion I don’t expect either transpose to be formed explicitly. Now I’m wondering about just how far the parser can take such optimizations to minimimize temporary storage and the number of operations, and the impact of such optimization on the documented order of operations. blas, optimization MATLAB Answers — New Questions
How do I check if my MATLAB Associate Certificate is valid?
How do I check if my MATLAB Associate Certificate is valid?How do I check if my MATLAB Associate Certificate is valid? How do I check if my MATLAB Associate Certificate is valid? MATLAB Answers — New Questions
How can I reduce compilation time for a Simulink model that uses the Computer Vision Toolbox “Deep Learning Object Detector” block with GPU acceleration enabled in MATLAB R2025b?
I am using MATLAB R2025b with Simulink and Computer Vision Toolbox. My model includes a “Deep Learning Object Detector” block with GPU acceleration enabled.
The model takes several minutes to compile, especially during propagating data types and while compiling “MATLAB Function” block code. This can happen even when there are no structural changes to the model, or when I modify blocks that do not directly interact with the object detection block.
Is there a way to reduce the compilation time?I am using MATLAB R2025b with Simulink and Computer Vision Toolbox. My model includes a “Deep Learning Object Detector” block with GPU acceleration enabled.
The model takes several minutes to compile, especially during propagating data types and while compiling “MATLAB Function” block code. This can happen even when there are no structural changes to the model, or when I modify blocks that do not directly interact with the object detection block.
Is there a way to reduce the compilation time? I am using MATLAB R2025b with Simulink and Computer Vision Toolbox. My model includes a “Deep Learning Object Detector” block with GPU acceleration enabled.
The model takes several minutes to compile, especially during propagating data types and while compiling “MATLAB Function” block code. This can happen even when there are no structural changes to the model, or when I modify blocks that do not directly interact with the object detection block.
Is there a way to reduce the compilation time? detectobjectblock, matlabfunctionblock, gpuacceleration, deeplearning, inherited, slowcompilation, propagatingdatatypes MATLAB Answers — New Questions
Control Design without using s ”acker , place.
i have a LTI system and i want to state feedback controller in matlap but i must not use acker and place functions.how i can this solution?i have a LTI system and i want to state feedback controller in matlap but i must not use acker and place functions.how i can this solution? i have a LTI system and i want to state feedback controller in matlap but i must not use acker and place functions.how i can this solution? control theory MATLAB Answers — New Questions
Build Failed : “Compilation failure for command” with PX4
Hello,
I am trying to test a flight controller algorithm on PX4 Host Target on my Simulink but I get the following error. Does anyone know the solution ?
Top model targets built:
Model Action Rebuild Reason
=========================================================================
attitude_cont Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 22.477s
Compilation failure for command "C:PX4run-console_Simulink.bat "cd C:/PX4/home/Firmware/build/px4_sitl_default; bash
/cygdrive/c/ProgramData/MATLAB/SupportPackages/R2023a/toolbox/target/supportpackages/px4/lib/scripts/executeBashCmdCygwin.sh /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/generateHostTargetObj.txt"" with error "/cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/generateHostTargetObj.txtHello,
I am trying to test a flight controller algorithm on PX4 Host Target on my Simulink but I get the following error. Does anyone know the solution ?
Top model targets built:
Model Action Rebuild Reason
=========================================================================
attitude_cont Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 22.477s
Compilation failure for command "C:PX4run-console_Simulink.bat "cd C:/PX4/home/Firmware/build/px4_sitl_default; bash
/cygdrive/c/ProgramData/MATLAB/SupportPackages/R2023a/toolbox/target/supportpackages/px4/lib/scripts/executeBashCmdCygwin.sh /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/generateHostTargetObj.txt"" with error "/cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/generateHostTargetObj.txt Hello,
I am trying to test a flight controller algorithm on PX4 Host Target on my Simulink but I get the following error. Does anyone know the solution ?
Top model targets built:
Model Action Rebuild Reason
=========================================================================
attitude_cont Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 22.477s
Compilation failure for command "C:PX4run-console_Simulink.bat "cd C:/PX4/home/Firmware/build/px4_sitl_default; bash
/cygdrive/c/ProgramData/MATLAB/SupportPackages/R2023a/toolbox/target/supportpackages/px4/lib/scripts/executeBashCmdCygwin.sh /cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/generateHostTargetObj.txt"" with error "/cygdrive/c/PX4/home/Firmware/build/px4_sitl_default/generateHostTargetObj.txt uav toolbox support for px4 autopilots MATLAB Answers — New Questions
missing axes after copy
I have a UIAxes in an app that I want to save as a .fig file so I’m using this:
placeholder=figure();
placeax=copyobj(app.UIAxes,placeholder,"legacy");
savefig(placeax,[app.folder,’Results’,app.model,’ – nodeview.fig’]);
The new figure is created and the graph is copied across but I can’t see it. What I mean by that is when hovering my mouse over I can see that the axes and the points are there but the graphic doesn’t show up.
Any suggestions as to why I can’t see the graph?I have a UIAxes in an app that I want to save as a .fig file so I’m using this:
placeholder=figure();
placeax=copyobj(app.UIAxes,placeholder,"legacy");
savefig(placeax,[app.folder,’Results’,app.model,’ – nodeview.fig’]);
The new figure is created and the graph is copied across but I can’t see it. What I mean by that is when hovering my mouse over I can see that the axes and the points are there but the graphic doesn’t show up.
Any suggestions as to why I can’t see the graph? I have a UIAxes in an app that I want to save as a .fig file so I’m using this:
placeholder=figure();
placeax=copyobj(app.UIAxes,placeholder,"legacy");
savefig(placeax,[app.folder,’Results’,app.model,’ – nodeview.fig’]);
The new figure is created and the graph is copied across but I can’t see it. What I mean by that is when hovering my mouse over I can see that the axes and the points are there but the graphic doesn’t show up.
Any suggestions as to why I can’t see the graph? appdesigner, figure, graph, graphics MATLAB Answers — New Questions
Download MATLAB 2023b for Windows off the network
Where can I find Off-line (Closed LAB) MATLAB 2023b to download for the Windows 10?Where can I find Off-line (Closed LAB) MATLAB 2023b to download for the Windows 10? Where can I find Off-line (Closed LAB) MATLAB 2023b to download for the Windows 10? closed lab has no network MATLAB Answers — New Questions
How do I reinstall MATLAB on my Windows 10 D: drive?
I have MATLAB R2025b installed on the C: drive of a Windows 10 laptop. I’m running out of space on C:. Can I reinstall it on D:, where I have more space? If so, how? Apologies if this has already been answered.I have MATLAB R2025b installed on the C: drive of a Windows 10 laptop. I’m running out of space on C:. Can I reinstall it on D:, where I have more space? If so, how? Apologies if this has already been answered. I have MATLAB R2025b installed on the C: drive of a Windows 10 laptop. I’m running out of space on C:. Can I reinstall it on D:, where I have more space? If so, how? Apologies if this has already been answered. windows 10, reinstall MATLAB Answers — New Questions
Adding Context to Training Data
Hi all,
I want to make an anomaly detector for insertion loss data (S21) over frequency. I have multiple cable types (varying in length, connector types, pitch, etc). Can I give this information to the detector or should I not? I have around 120,000 signals worth of data to train it on.Hi all,
I want to make an anomaly detector for insertion loss data (S21) over frequency. I have multiple cable types (varying in length, connector types, pitch, etc). Can I give this information to the detector or should I not? I have around 120,000 signals worth of data to train it on. Hi all,
I want to make an anomaly detector for insertion loss data (S21) over frequency. I have multiple cable types (varying in length, connector types, pitch, etc). Can I give this information to the detector or should I not? I have around 120,000 signals worth of data to train it on. frequency domain, anomaly detector, machine learning MATLAB Answers — New Questions









