Tag Archives: matlab
creating a satellite scenario manually vs from a TLE file
Hello,
I’m currently experimenting with the Satellite communication toolbox. I noticed that there seems to be a difference in the output between creating a satellite scenario and populating it using TLE data from a file (so using satellite(sc, tlefile)), versus defining the satellite scenario and adding the satellites’ parameters (which are extracted from the same TLE file using tleread() function) manually, despite having the same initial conditions (startTime, stopTime, and samplingTime)
For instance, with MATLAB’s TLE file ‘leoSatelliteConstellation.tle’, the following output is shown on the SatelliteViewer.
using the manual method based on tleread() and satellite(scenario,semimajoraxis,eccentricity,inclination,RAAN,argofperiapsis,trueanomaly):
and using satellite(scenario,file):
shouldn’t they have the same output?
When using actual TLE data of Iridium satellites, for instance, loading the constellation using the manual method produced an erroneous output!Hello,
I’m currently experimenting with the Satellite communication toolbox. I noticed that there seems to be a difference in the output between creating a satellite scenario and populating it using TLE data from a file (so using satellite(sc, tlefile)), versus defining the satellite scenario and adding the satellites’ parameters (which are extracted from the same TLE file using tleread() function) manually, despite having the same initial conditions (startTime, stopTime, and samplingTime)
For instance, with MATLAB’s TLE file ‘leoSatelliteConstellation.tle’, the following output is shown on the SatelliteViewer.
using the manual method based on tleread() and satellite(scenario,semimajoraxis,eccentricity,inclination,RAAN,argofperiapsis,trueanomaly):
and using satellite(scenario,file):
shouldn’t they have the same output?
When using actual TLE data of Iridium satellites, for instance, loading the constellation using the manual method produced an erroneous output! Hello,
I’m currently experimenting with the Satellite communication toolbox. I noticed that there seems to be a difference in the output between creating a satellite scenario and populating it using TLE data from a file (so using satellite(sc, tlefile)), versus defining the satellite scenario and adding the satellites’ parameters (which are extracted from the same TLE file using tleread() function) manually, despite having the same initial conditions (startTime, stopTime, and samplingTime)
For instance, with MATLAB’s TLE file ‘leoSatelliteConstellation.tle’, the following output is shown on the SatelliteViewer.
using the manual method based on tleread() and satellite(scenario,semimajoraxis,eccentricity,inclination,RAAN,argofperiapsis,trueanomaly):
and using satellite(scenario,file):
shouldn’t they have the same output?
When using actual TLE data of Iridium satellites, for instance, loading the constellation using the manual method produced an erroneous output! satellite, tle data, satellitescenario MATLAB Answers — New Questions
I am trying to run spm12 with matlab 2023b on my macOS but I got this error when I type spm and I have already installed xcode14 from App Store
>> spm
Error using spm_check_installation>check_basic
SPM uses a number of MEX files, which are compiled functions.
These need to be compiled for the various platforms on which SPM
is run. It seems that the compiled files for your computer platform
are missing or not compatible. See
https://en.wikibooks.org/wiki/SPM/Installation_on_64bit_Mac_OS_(Intel)
for information about how to compile MEX files for MACA64
in MATLAB 23.2.0.2391609 (R2023b) Update 2.>> spm
Error using spm_check_installation>check_basic
SPM uses a number of MEX files, which are compiled functions.
These need to be compiled for the various platforms on which SPM
is run. It seems that the compiled files for your computer platform
are missing or not compatible. See
https://en.wikibooks.org/wiki/SPM/Installation_on_64bit_Mac_OS_(Intel)
for information about how to compile MEX files for MACA64
in MATLAB 23.2.0.2391609 (R2023b) Update 2. >> spm
Error using spm_check_installation>check_basic
SPM uses a number of MEX files, which are compiled functions.
These need to be compiled for the various platforms on which SPM
is run. It seems that the compiled files for your computer platform
are missing or not compatible. See
https://en.wikibooks.org/wiki/SPM/Installation_on_64bit_Mac_OS_(Intel)
for information about how to compile MEX files for MACA64
in MATLAB 23.2.0.2391609 (R2023b) Update 2. spm12 MATLAB Answers — New Questions
Optimization Live Editor task Error “Your objective function must return a scalar value”
Hi,I’m trying to maximize a function with genetic algorithm or patternsearch using Optimization Live Editor task. But it confuses me that an Error "Your objective function must return a scalar value" always occurs, and I have alreay checked out the output of my objective function. Can somebody tell me how to fix this problem? Would appreciate any help!
I checked out the the output of my objective function as follows:
input = [0 0.5];
MaxSidelobe = FindBestPlacingGA(input);
TF = isscalar(MaxSidelobe);
disp(TF);
The objective function and other functions needed:
function MaxSidelobe= FindBestPlacingGA(input)
input(1) = deg2rad(input(1));
mic_pos = [0 0.24 0
-0.2078 -0.12 0
0.2078 -0.12 0];
mic_pos = [Array3N(input(1),input(2));mic_pos];
MaxSidelobe= FPSF_Function(mic_pos,500,0:1:80);
end
function mic_pos = Array3N(theta,rho)
theta3N = [theta+pi/2;theta+pi*7/6;theta+pi*11/6];
mic_pos = zeros(3,3);
mic_pos(:,3) = 0;
[mic_pos(:,1),mic_pos(:,2)] = pol2cart(theta3N,rho);
end
function MSL= FPSF_Function(mic_pos,f,El)
Num_mic = size(mic_pos,1);
Az = -180:1: 180;
c = 343;
k0 = [0 0 -1];
numAz = length(Az);
numEl = length(El);
K = zeros(3, numAz, numEl);
for i = 1:numAz
for j = 1:numEl
az_rad = deg2rad(Az(i));
el_rad = deg2rad(El(j));
x = cos(az_rad) * sin(el_rad);
y = sin(az_rad) * sin(el_rad);
z = cos(el_rad);
K(:, i, j) = [x; y; z];
end
end
W = zeros(numAz,numEl);
for p = 1:numAz
for q = 1:numEl
for n = 1:Num_mic
W(p,q) = exp(-1i*dot(K(:,p,q)’-k0,mic_pos(n,:))*2*pi*f/c) + W(p,q);
end
end
end
W = W/Num_mic;
Y = 10*log10((abs(W)).^2);
local_max = imregionalmax(Y);
max_values = Y(local_max);
Mainlobe = max(max_values(:));
sidelobes = max_values(max_values~=Mainlobe);
MSL = Mainlobe – max(sidelobes(:));
endHi,I’m trying to maximize a function with genetic algorithm or patternsearch using Optimization Live Editor task. But it confuses me that an Error "Your objective function must return a scalar value" always occurs, and I have alreay checked out the output of my objective function. Can somebody tell me how to fix this problem? Would appreciate any help!
I checked out the the output of my objective function as follows:
input = [0 0.5];
MaxSidelobe = FindBestPlacingGA(input);
TF = isscalar(MaxSidelobe);
disp(TF);
The objective function and other functions needed:
function MaxSidelobe= FindBestPlacingGA(input)
input(1) = deg2rad(input(1));
mic_pos = [0 0.24 0
-0.2078 -0.12 0
0.2078 -0.12 0];
mic_pos = [Array3N(input(1),input(2));mic_pos];
MaxSidelobe= FPSF_Function(mic_pos,500,0:1:80);
end
function mic_pos = Array3N(theta,rho)
theta3N = [theta+pi/2;theta+pi*7/6;theta+pi*11/6];
mic_pos = zeros(3,3);
mic_pos(:,3) = 0;
[mic_pos(:,1),mic_pos(:,2)] = pol2cart(theta3N,rho);
end
function MSL= FPSF_Function(mic_pos,f,El)
Num_mic = size(mic_pos,1);
Az = -180:1: 180;
c = 343;
k0 = [0 0 -1];
numAz = length(Az);
numEl = length(El);
K = zeros(3, numAz, numEl);
for i = 1:numAz
for j = 1:numEl
az_rad = deg2rad(Az(i));
el_rad = deg2rad(El(j));
x = cos(az_rad) * sin(el_rad);
y = sin(az_rad) * sin(el_rad);
z = cos(el_rad);
K(:, i, j) = [x; y; z];
end
end
W = zeros(numAz,numEl);
for p = 1:numAz
for q = 1:numEl
for n = 1:Num_mic
W(p,q) = exp(-1i*dot(K(:,p,q)’-k0,mic_pos(n,:))*2*pi*f/c) + W(p,q);
end
end
end
W = W/Num_mic;
Y = 10*log10((abs(W)).^2);
local_max = imregionalmax(Y);
max_values = Y(local_max);
Mainlobe = max(max_values(:));
sidelobes = max_values(max_values~=Mainlobe);
MSL = Mainlobe – max(sidelobes(:));
end Hi,I’m trying to maximize a function with genetic algorithm or patternsearch using Optimization Live Editor task. But it confuses me that an Error "Your objective function must return a scalar value" always occurs, and I have alreay checked out the output of my objective function. Can somebody tell me how to fix this problem? Would appreciate any help!
I checked out the the output of my objective function as follows:
input = [0 0.5];
MaxSidelobe = FindBestPlacingGA(input);
TF = isscalar(MaxSidelobe);
disp(TF);
The objective function and other functions needed:
function MaxSidelobe= FindBestPlacingGA(input)
input(1) = deg2rad(input(1));
mic_pos = [0 0.24 0
-0.2078 -0.12 0
0.2078 -0.12 0];
mic_pos = [Array3N(input(1),input(2));mic_pos];
MaxSidelobe= FPSF_Function(mic_pos,500,0:1:80);
end
function mic_pos = Array3N(theta,rho)
theta3N = [theta+pi/2;theta+pi*7/6;theta+pi*11/6];
mic_pos = zeros(3,3);
mic_pos(:,3) = 0;
[mic_pos(:,1),mic_pos(:,2)] = pol2cart(theta3N,rho);
end
function MSL= FPSF_Function(mic_pos,f,El)
Num_mic = size(mic_pos,1);
Az = -180:1: 180;
c = 343;
k0 = [0 0 -1];
numAz = length(Az);
numEl = length(El);
K = zeros(3, numAz, numEl);
for i = 1:numAz
for j = 1:numEl
az_rad = deg2rad(Az(i));
el_rad = deg2rad(El(j));
x = cos(az_rad) * sin(el_rad);
y = sin(az_rad) * sin(el_rad);
z = cos(el_rad);
K(:, i, j) = [x; y; z];
end
end
W = zeros(numAz,numEl);
for p = 1:numAz
for q = 1:numEl
for n = 1:Num_mic
W(p,q) = exp(-1i*dot(K(:,p,q)’-k0,mic_pos(n,:))*2*pi*f/c) + W(p,q);
end
end
end
W = W/Num_mic;
Y = 10*log10((abs(W)).^2);
local_max = imregionalmax(Y);
max_values = Y(local_max);
Mainlobe = max(max_values(:));
sidelobes = max_values(max_values~=Mainlobe);
MSL = Mainlobe – max(sidelobes(:));
end optimization live editor task, error, scalar value MATLAB Answers — New Questions
Why is the suspension displacement so low?
hello everyone,
I designed an active suspension system but there is something I don’t understand. While the bump in my road profile is 0.07, I see the suspension movement as 10^-7. Of course I expect improvement, but isn’t this too much. Please I am waiting for your comments.hello everyone,
I designed an active suspension system but there is something I don’t understand. While the bump in my road profile is 0.07, I see the suspension movement as 10^-7. Of course I expect improvement, but isn’t this too much. Please I am waiting for your comments. hello everyone,
I designed an active suspension system but there is something I don’t understand. While the bump in my road profile is 0.07, I see the suspension movement as 10^-7. Of course I expect improvement, but isn’t this too much. Please I am waiting for your comments. transferred MATLAB Answers — New Questions
HDL Coder FPGA resources report
Hello,
In the HDL Coder workflow, is any way to size the FPGA requirements? In a way to be able to precisly select the FPGA that will be able to run the model simulation. Or may be a way to try seveal FPGA chips that will report utilization, without physically having the device?
We dont have neither Matlab and obviously HDL Coder, but we are considering it and after a lot of research, given that we can generate the code and even program the FPGA from Matlab, we just wonder how can we select the right FPGA chip… we are considering usning Xilinx/AMD chips… we have also considered the speedgoat options and other alternatives like NI Veristand, but that is overkill for what we are looking,… our model can be simplified to 1 DI, 2 AO and 1 AI…
And another question, the above idea, does it work only for Simulink models or it can work also for Simscape Electrical models?
ThanksHello,
In the HDL Coder workflow, is any way to size the FPGA requirements? In a way to be able to precisly select the FPGA that will be able to run the model simulation. Or may be a way to try seveal FPGA chips that will report utilization, without physically having the device?
We dont have neither Matlab and obviously HDL Coder, but we are considering it and after a lot of research, given that we can generate the code and even program the FPGA from Matlab, we just wonder how can we select the right FPGA chip… we are considering usning Xilinx/AMD chips… we have also considered the speedgoat options and other alternatives like NI Veristand, but that is overkill for what we are looking,… our model can be simplified to 1 DI, 2 AO and 1 AI…
And another question, the above idea, does it work only for Simulink models or it can work also for Simscape Electrical models?
Thanks Hello,
In the HDL Coder workflow, is any way to size the FPGA requirements? In a way to be able to precisly select the FPGA that will be able to run the model simulation. Or may be a way to try seveal FPGA chips that will report utilization, without physically having the device?
We dont have neither Matlab and obviously HDL Coder, but we are considering it and after a lot of research, given that we can generate the code and even program the FPGA from Matlab, we just wonder how can we select the right FPGA chip… we are considering usning Xilinx/AMD chips… we have also considered the speedgoat options and other alternatives like NI Veristand, but that is overkill for what we are looking,… our model can be simplified to 1 DI, 2 AO and 1 AI…
And another question, the above idea, does it work only for Simulink models or it can work also for Simscape Electrical models?
Thanks hdl coder, fpga size MATLAB Answers — New Questions
Is a matrix with a condition number of 1e20 definitely more ill-conditioned than a matrix with a condition number of 1e19?
I am working with some ill-conditioned matrices, trying to find the relationship between the matrix’s ill-conditioning and the results. However, I have noticed that the condition numbers of some matrices are extremely large, with the smallest singular values even smaller than eps. Does this mean that the condition numbers I got might be inaccurate? Or is a matrix with a condition number of 1e20 definitely more ill-conditioned than a matrix with a condition number of 1e19?I am working with some ill-conditioned matrices, trying to find the relationship between the matrix’s ill-conditioning and the results. However, I have noticed that the condition numbers of some matrices are extremely large, with the smallest singular values even smaller than eps. Does this mean that the condition numbers I got might be inaccurate? Or is a matrix with a condition number of 1e20 definitely more ill-conditioned than a matrix with a condition number of 1e19? I am working with some ill-conditioned matrices, trying to find the relationship between the matrix’s ill-conditioning and the results. However, I have noticed that the condition numbers of some matrices are extremely large, with the smallest singular values even smaller than eps. Does this mean that the condition numbers I got might be inaccurate? Or is a matrix with a condition number of 1e20 definitely more ill-conditioned than a matrix with a condition number of 1e19? matrix MATLAB Answers — New Questions
How to access state-space matrices of a power-system simlink model?
Hello everyone,
I’m currently working on a project where I need to access the state-space matrices (A, B, C, D) of a synchronous machine model in Simulink. I’ve built a model of a synchronous machine connected to an RLC branch.
While I can successfully simulate the model and observe the output current, I need to extract the A, B, C, D matrices that define the synchronous machine’s internal dynamics.
I’ve explored the `powergui` block and its functionalities, but I haven’t been able to pinpoint the exact steps to obtain these matrices. Could anyone please guide me on how to access and export the A, B, C, D matrices of the synchronous machine model in Simulink?
Any help or suggestions would be greatly appreciated. Thank you!Hello everyone,
I’m currently working on a project where I need to access the state-space matrices (A, B, C, D) of a synchronous machine model in Simulink. I’ve built a model of a synchronous machine connected to an RLC branch.
While I can successfully simulate the model and observe the output current, I need to extract the A, B, C, D matrices that define the synchronous machine’s internal dynamics.
I’ve explored the `powergui` block and its functionalities, but I haven’t been able to pinpoint the exact steps to obtain these matrices. Could anyone please guide me on how to access and export the A, B, C, D matrices of the synchronous machine model in Simulink?
Any help or suggestions would be greatly appreciated. Thank you! Hello everyone,
I’m currently working on a project where I need to access the state-space matrices (A, B, C, D) of a synchronous machine model in Simulink. I’ve built a model of a synchronous machine connected to an RLC branch.
While I can successfully simulate the model and observe the output current, I need to extract the A, B, C, D matrices that define the synchronous machine’s internal dynamics.
I’ve explored the `powergui` block and its functionalities, but I haven’t been able to pinpoint the exact steps to obtain these matrices. Could anyone please guide me on how to access and export the A, B, C, D matrices of the synchronous machine model in Simulink?
Any help or suggestions would be greatly appreciated. Thank you! simpowersystems MATLAB Answers — New Questions
How to generate vector with non-linear spacing?
Hello,
I am attempting to generate an array with non-linear spacing between the elements but struggling to figure out a way to impliment this. I need an array x of points spaced from a real, negative value a to a real, positive value b. Ideally the spacing should follow a Gaussian distribution such that many points are clustered about x=0 in the vicinity of some finite width d. Conversely the spacing should be large at the boundaries. More generally it doesn’t have to be Gaussian but some guidance on a scheme where I can specify a length d<<|b-a| across which many points should be distributed would be really appreciated.
I tried to work out an algorithm of sorts from pen and paper but it didn’t really work and resulted in something that did not appear to be immediately solveable.
ThanksHello,
I am attempting to generate an array with non-linear spacing between the elements but struggling to figure out a way to impliment this. I need an array x of points spaced from a real, negative value a to a real, positive value b. Ideally the spacing should follow a Gaussian distribution such that many points are clustered about x=0 in the vicinity of some finite width d. Conversely the spacing should be large at the boundaries. More generally it doesn’t have to be Gaussian but some guidance on a scheme where I can specify a length d<<|b-a| across which many points should be distributed would be really appreciated.
I tried to work out an algorithm of sorts from pen and paper but it didn’t really work and resulted in something that did not appear to be immediately solveable.
Thanks Hello,
I am attempting to generate an array with non-linear spacing between the elements but struggling to figure out a way to impliment this. I need an array x of points spaced from a real, negative value a to a real, positive value b. Ideally the spacing should follow a Gaussian distribution such that many points are clustered about x=0 in the vicinity of some finite width d. Conversely the spacing should be large at the boundaries. More generally it doesn’t have to be Gaussian but some guidance on a scheme where I can specify a length d<<|b-a| across which many points should be distributed would be really appreciated.
I tried to work out an algorithm of sorts from pen and paper but it didn’t really work and resulted in something that did not appear to be immediately solveable.
Thanks array, vector MATLAB Answers — New Questions
Link between ansys workbench and matlab
How can i link between ansys workbench and matlab ?How can i link between ansys workbench and matlab ? How can i link between ansys workbench and matlab ? ansys workbench, matlab MATLAB Answers — New Questions
selstruc(): How to avoid hitting “Return” in command window?
I’m building a little App (.mlapp) for System Identification based on this example: https://www.mathworks.com/help/ident/gs/identify-linear-models-using-the-command-line.html
I’m using selstruc(arxstruc(…)) to estimate model parameter but after selection, it’s not sufficient to close with the "Close" button, but I have to switch to main Matlab command window and hit return, as mentioned in the dialog.
Is there any way to avoid this and continue directly after pressing "Close"?I’m building a little App (.mlapp) for System Identification based on this example: https://www.mathworks.com/help/ident/gs/identify-linear-models-using-the-command-line.html
I’m using selstruc(arxstruc(…)) to estimate model parameter but after selection, it’s not sufficient to close with the "Close" button, but I have to switch to main Matlab command window and hit return, as mentioned in the dialog.
Is there any way to avoid this and continue directly after pressing "Close"? I’m building a little App (.mlapp) for System Identification based on this example: https://www.mathworks.com/help/ident/gs/identify-linear-models-using-the-command-line.html
I’m using selstruc(arxstruc(…)) to estimate model parameter but after selection, it’s not sufficient to close with the "Close" button, but I have to switch to main Matlab command window and hit return, as mentioned in the dialog.
Is there any way to avoid this and continue directly after pressing "Close"? system identification, selstruc MATLAB Answers — New Questions
how can I download my licenses
how can I download my licenseshow can I download my licenses how can I download my licenses download licenses MATLAB Answers — New Questions
Error in DNG Server Login Configuration
We are trying to configure DNG Server Login Configuration, but we found error "Domain name not resolved: our-domain.com".
From our investigation, we think that the error occur in function rmiut.InputUtils.validateDomainName().
Below is our suspects.
Fact: our domain name is private domain and it cannot be resolved by DNS.
Fact: current we are using host file to solve this domain name.
We think that function rmiut.InputUtils.validateDomainName() do not use information in host file when it validate the domain name.
This domain use self-signed cert and we don’t have .crt of it too, but we think the error occur at validation step, not load the web yet.
Could you please confirm our suspect and suggest the solution.
Thank you.We are trying to configure DNG Server Login Configuration, but we found error "Domain name not resolved: our-domain.com".
From our investigation, we think that the error occur in function rmiut.InputUtils.validateDomainName().
Below is our suspects.
Fact: our domain name is private domain and it cannot be resolved by DNS.
Fact: current we are using host file to solve this domain name.
We think that function rmiut.InputUtils.validateDomainName() do not use information in host file when it validate the domain name.
This domain use self-signed cert and we don’t have .crt of it too, but we think the error occur at validation step, not load the web yet.
Could you please confirm our suspect and suggest the solution.
Thank you. We are trying to configure DNG Server Login Configuration, but we found error "Domain name not resolved: our-domain.com".
From our investigation, we think that the error occur in function rmiut.InputUtils.validateDomainName().
Below is our suspects.
Fact: our domain name is private domain and it cannot be resolved by DNS.
Fact: current we are using host file to solve this domain name.
We think that function rmiut.InputUtils.validateDomainName() do not use information in host file when it validate the domain name.
This domain use self-signed cert and we don’t have .crt of it too, but we think the error occur at validation step, not load the web yet.
Could you please confirm our suspect and suggest the solution.
Thank you. simulink requirements, slreq.dngconfigure MATLAB Answers — New Questions
How to generate a TLC file for a MEX file externally obtained?
Hello,
I have a Simulink simulation utilizing an S-Function block tied to an externally generated MEX file, which I am trying to make code generation compatible.
I have reviewed these articles about the topic:
Use Level-2 MATLAB S-function: https://www.mathworks.com/help/simulink/slref/level2matlabsfunction.html
TLC Files: https://www.mathworks.com/help/rtw/tlc/tlc-files.html
However, I was wondering how I would generate a TLC file if the MEX was auto-generated by an external modeling software. Do I need access to the source C Code before MEX file generation? Is there a way to manually build it without knowledge of how the MEX is built?
Just looking for information on what information/access I would need.
Thanks!Hello,
I have a Simulink simulation utilizing an S-Function block tied to an externally generated MEX file, which I am trying to make code generation compatible.
I have reviewed these articles about the topic:
Use Level-2 MATLAB S-function: https://www.mathworks.com/help/simulink/slref/level2matlabsfunction.html
TLC Files: https://www.mathworks.com/help/rtw/tlc/tlc-files.html
However, I was wondering how I would generate a TLC file if the MEX was auto-generated by an external modeling software. Do I need access to the source C Code before MEX file generation? Is there a way to manually build it without knowledge of how the MEX is built?
Just looking for information on what information/access I would need.
Thanks! Hello,
I have a Simulink simulation utilizing an S-Function block tied to an externally generated MEX file, which I am trying to make code generation compatible.
I have reviewed these articles about the topic:
Use Level-2 MATLAB S-function: https://www.mathworks.com/help/simulink/slref/level2matlabsfunction.html
TLC Files: https://www.mathworks.com/help/rtw/tlc/tlc-files.html
However, I was wondering how I would generate a TLC file if the MEX was auto-generated by an external modeling software. Do I need access to the source C Code before MEX file generation? Is there a way to manually build it without knowledge of how the MEX is built?
Just looking for information on what information/access I would need.
Thanks! simulink, tlc, matlab, code generation, mex, simulink compiler MATLAB Answers — New Questions
Interpret CNN classification model for EEG signals.
I have a CNN model for EEG signals classification, I built the model, train and test it. I want to interpret the decision-making process of the CNN model , How can I do that ? Should I use on of the attached methodes?I have a CNN model for EEG signals classification, I built the model, train and test it. I want to interpret the decision-making process of the CNN model , How can I do that ? Should I use on of the attached methodes? I have a CNN model for EEG signals classification, I built the model, train and test it. I want to interpret the decision-making process of the CNN model , How can I do that ? Should I use on of the attached methodes? eeg, interpretability, cnn, imagelime MATLAB Answers — New Questions
Array of SimulationInput objects gets modified upon running with sim command
I am creating an array of SimulationInput objects, ‘simIn’. If I try to run a single simulation, for example using simOut(1) = sim(simIn(1)) to run the first case, why does simIn lose all other array elementes. It changes to a 1×1 SimulationInput object, whereas before the sim command it was a 1×28 object
for casenumber = 1:NumFile
if ~isempty(char(file{FileIdx(casenumber),1}))
if exist(strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”), ‘file’)
%% Setup parallel Simulation
simIn(casenumber)=Simulink.SimulationInput(‘XWB_MSL_EEC’);
simIn(casenumber) = simIn(casenumber).setVariable(‘Experiment’,Experiment);
simIn(casenumber) = simIn(casenumber).setVariable(‘Enable_MSL_Validation_Logging’,Enable_MSL_Validation_Logging);
simIn(casenumber) = simIn(casenumber).setVariable(‘SimStartTime’,0);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode1’,TimeMode1);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode2’,TimeMode2);
simIn(casenumber) = simIn(casenumber).setVariable(‘parallel_casenumber’,casenumber);
simIn(casenumber) = simIn(casenumber).setVariable(‘ModelPath’,ModelPath);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolGitStatus’,toolGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitStatus’,configGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolConfigVersion’,toolConfigVersion);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitInfo’,configGitInfo);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchBatchMode’,switchBatchMode);
simIn(casenumber) = simIn(casenumber).setVariable(‘resultsDir’,resultsDir);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchExportDataToPhobos’,switchExportDataToPhobos);
if ~isempty(Suffix)
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,sprintf(‘%s_%s’,file{FileIdx(casenumber),1},Suffix));
else
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,file{FileIdx(casenumber),1});
end
% Use a temporary variable for the SimIn element to avoid runaway memory usage when using a preSimFcn with parsim
tmpSimIn = simIn(casenumber);
preSimFcnInputs = {file{FileIdx(casenumber)}, tmpSimIn};
simIn(casenumber)=simIn(casenumber).setPreSimFcn(@(x) parsimMSLPreSimFcn(preSimFcnInputs));
simIn(casenumber) = simIn(casenumber).setPostSimFcn(@(y) parsimMSLPostSimFcn(y, tmpSimIn));
else
error([‘Could not find Case "’,strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”),’"!’])
end
end
endI am creating an array of SimulationInput objects, ‘simIn’. If I try to run a single simulation, for example using simOut(1) = sim(simIn(1)) to run the first case, why does simIn lose all other array elementes. It changes to a 1×1 SimulationInput object, whereas before the sim command it was a 1×28 object
for casenumber = 1:NumFile
if ~isempty(char(file{FileIdx(casenumber),1}))
if exist(strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”), ‘file’)
%% Setup parallel Simulation
simIn(casenumber)=Simulink.SimulationInput(‘XWB_MSL_EEC’);
simIn(casenumber) = simIn(casenumber).setVariable(‘Experiment’,Experiment);
simIn(casenumber) = simIn(casenumber).setVariable(‘Enable_MSL_Validation_Logging’,Enable_MSL_Validation_Logging);
simIn(casenumber) = simIn(casenumber).setVariable(‘SimStartTime’,0);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode1’,TimeMode1);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode2’,TimeMode2);
simIn(casenumber) = simIn(casenumber).setVariable(‘parallel_casenumber’,casenumber);
simIn(casenumber) = simIn(casenumber).setVariable(‘ModelPath’,ModelPath);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolGitStatus’,toolGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitStatus’,configGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolConfigVersion’,toolConfigVersion);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitInfo’,configGitInfo);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchBatchMode’,switchBatchMode);
simIn(casenumber) = simIn(casenumber).setVariable(‘resultsDir’,resultsDir);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchExportDataToPhobos’,switchExportDataToPhobos);
if ~isempty(Suffix)
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,sprintf(‘%s_%s’,file{FileIdx(casenumber),1},Suffix));
else
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,file{FileIdx(casenumber),1});
end
% Use a temporary variable for the SimIn element to avoid runaway memory usage when using a preSimFcn with parsim
tmpSimIn = simIn(casenumber);
preSimFcnInputs = {file{FileIdx(casenumber)}, tmpSimIn};
simIn(casenumber)=simIn(casenumber).setPreSimFcn(@(x) parsimMSLPreSimFcn(preSimFcnInputs));
simIn(casenumber) = simIn(casenumber).setPostSimFcn(@(y) parsimMSLPostSimFcn(y, tmpSimIn));
else
error([‘Could not find Case "’,strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”),’"!’])
end
end
end I am creating an array of SimulationInput objects, ‘simIn’. If I try to run a single simulation, for example using simOut(1) = sim(simIn(1)) to run the first case, why does simIn lose all other array elementes. It changes to a 1×1 SimulationInput object, whereas before the sim command it was a 1×28 object
for casenumber = 1:NumFile
if ~isempty(char(file{FileIdx(casenumber),1}))
if exist(strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”), ‘file’)
%% Setup parallel Simulation
simIn(casenumber)=Simulink.SimulationInput(‘XWB_MSL_EEC’);
simIn(casenumber) = simIn(casenumber).setVariable(‘Experiment’,Experiment);
simIn(casenumber) = simIn(casenumber).setVariable(‘Enable_MSL_Validation_Logging’,Enable_MSL_Validation_Logging);
simIn(casenumber) = simIn(casenumber).setVariable(‘SimStartTime’,0);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode1’,TimeMode1);
simIn(casenumber) = simIn(casenumber).setVariable(‘TimeMode2’,TimeMode2);
simIn(casenumber) = simIn(casenumber).setVariable(‘parallel_casenumber’,casenumber);
simIn(casenumber) = simIn(casenumber).setVariable(‘ModelPath’,ModelPath);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolGitStatus’,toolGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitStatus’,configGitStatus);
simIn(casenumber) = simIn(casenumber).setVariable(‘toolConfigVersion’,toolConfigVersion);
simIn(casenumber) = simIn(casenumber).setVariable(‘configGitInfo’,configGitInfo);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchBatchMode’,switchBatchMode);
simIn(casenumber) = simIn(casenumber).setVariable(‘resultsDir’,resultsDir);
simIn(casenumber) = simIn(casenumber).setVariable(‘switchExportDataToPhobos’,switchExportDataToPhobos);
if ~isempty(Suffix)
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,sprintf(‘%s_%s’,file{FileIdx(casenumber),1},Suffix));
else
simIn(casenumber) = simIn(casenumber).setVariable(‘CurveName’,file{FileIdx(casenumber),1});
end
% Use a temporary variable for the SimIn element to avoid runaway memory usage when using a preSimFcn with parsim
tmpSimIn = simIn(casenumber);
preSimFcnInputs = {file{FileIdx(casenumber)}, tmpSimIn};
simIn(casenumber)=simIn(casenumber).setPreSimFcn(@(x) parsimMSLPreSimFcn(preSimFcnInputs));
simIn(casenumber) = simIn(casenumber).setPostSimFcn(@(y) parsimMSLPostSimFcn(y, tmpSimIn));
else
error([‘Could not find Case "’,strrep(char(file{FileIdx(casenumber),1}), ‘;’, ”),’"!’])
end
end
end simulink MATLAB Answers — New Questions
Project export error while generating code using Simulink Coder Twincat target
I am experimenting creating a Simulink model for TwinCAT 3 but when generating the Simulink code it keeps showing the following error:
The call to TwinCatGrt_make_rtw_hook, during the after_make hook generated the following error: Project export failed The build process will terminate as a result.
Caused by:
Project export failed
I looked on the internet and seems there are only guides for fixing preparing projects but none for fixing project export. Does anyone know how to fix this error?I am experimenting creating a Simulink model for TwinCAT 3 but when generating the Simulink code it keeps showing the following error:
The call to TwinCatGrt_make_rtw_hook, during the after_make hook generated the following error: Project export failed The build process will terminate as a result.
Caused by:
Project export failed
I looked on the internet and seems there are only guides for fixing preparing projects but none for fixing project export. Does anyone know how to fix this error? I am experimenting creating a Simulink model for TwinCAT 3 but when generating the Simulink code it keeps showing the following error:
The call to TwinCatGrt_make_rtw_hook, during the after_make hook generated the following error: Project export failed The build process will terminate as a result.
Caused by:
Project export failed
I looked on the internet and seems there are only guides for fixing preparing projects but none for fixing project export. Does anyone know how to fix this error? simulink, twincat3, tccom MATLAB Answers — New Questions
How to extract 50Hz fundamental frequency components or DC components with less delay in Simulink?
I want to extract the 50Hz fundamental frequency component or DC component of the voltage at the shunt point in a double closed loop control of an inverter. As far as I know, a low pass filter or a notch filter can be used. But the lower the cutoff frequency, the greater the signal delay between input and output. Is there a good way to solve the delay problem?I want to extract the 50Hz fundamental frequency component or DC component of the voltage at the shunt point in a double closed loop control of an inverter. As far as I know, a low pass filter or a notch filter can be used. But the lower the cutoff frequency, the greater the signal delay between input and output. Is there a good way to solve the delay problem? I want to extract the 50Hz fundamental frequency component or DC component of the voltage at the shunt point in a double closed loop control of an inverter. As far as I know, a low pass filter or a notch filter can be used. But the lower the cutoff frequency, the greater the signal delay between input and output. Is there a good way to solve the delay problem? closed-loop control, power_electronics_control, signal processing MATLAB Answers — New Questions
Connect USRP-2974 using Wireless Testbench
Hi, MATLAB Community,
I wonder if the NI USRP-2974 is compatatible with Wireless Testbench Toolbox.
Although NI says that USRP-2974 is X310 with an on-board computer, I failed to run WT examples. I noticed that Wireless Testbench supports NI USRP-295x (X310 with specific daughterboards, I tested with another USRP-2952) but it seems 2974 is not supported.
An error message says Unable to find a compatible radio, ‘USRP X310’
Thanks in advanceHi, MATLAB Community,
I wonder if the NI USRP-2974 is compatatible with Wireless Testbench Toolbox.
Although NI says that USRP-2974 is X310 with an on-board computer, I failed to run WT examples. I noticed that Wireless Testbench supports NI USRP-295x (X310 with specific daughterboards, I tested with another USRP-2952) but it seems 2974 is not supported.
An error message says Unable to find a compatible radio, ‘USRP X310’
Thanks in advance Hi, MATLAB Community,
I wonder if the NI USRP-2974 is compatatible with Wireless Testbench Toolbox.
Although NI says that USRP-2974 is X310 with an on-board computer, I failed to run WT examples. I noticed that Wireless Testbench supports NI USRP-295x (X310 with specific daughterboards, I tested with another USRP-2952) but it seems 2974 is not supported.
An error message says Unable to find a compatible radio, ‘USRP X310’
Thanks in advance ni usrp MATLAB Answers — New Questions
Where Can I Download the PID Controller Tuning for a Buck Converter Example?
Hello,
I’m interested in learning how to tune the gains of a PID controller for a buck converter using Simscape Electrical™. I came across a video that demonstrates this process and explains the new frequency response-based PID tuning method introduced in R2017b.
Here is the link to the video: PID Controller Tuning for a Buck Converter
I would like to download the example file or model used in the video. Could anyone provide guidance on where I can find this example? Is it available for download directly from MATLAB Central, or should I look elsewhere?
Thank you for your help!Hello,
I’m interested in learning how to tune the gains of a PID controller for a buck converter using Simscape Electrical™. I came across a video that demonstrates this process and explains the new frequency response-based PID tuning method introduced in R2017b.
Here is the link to the video: PID Controller Tuning for a Buck Converter
I would like to download the example file or model used in the video. Could anyone provide guidance on where I can find this example? Is it available for download directly from MATLAB Central, or should I look elsewhere?
Thank you for your help! Hello,
I’m interested in learning how to tune the gains of a PID controller for a buck converter using Simscape Electrical™. I came across a video that demonstrates this process and explains the new frequency response-based PID tuning method introduced in R2017b.
Here is the link to the video: PID Controller Tuning for a Buck Converter
I would like to download the example file or model used in the video. Could anyone provide guidance on where I can find this example? Is it available for download directly from MATLAB Central, or should I look elsewhere?
Thank you for your help! power_electronics_control MATLAB Answers — New Questions
image processing
ive managed to successfully use variables and measure the perimeter of 2 images i have scanned from my flat bed scanner
refer :
http://www.mathworks.com/matlabcentral/answers/5133-image-processing-calculate-perimeter
however now my question is to combine this as a program in which i can scan the images and compare. image uploading has already been completed in .net . now from the database i need to access these images and calculate their perimeters individually . how do i do this. any other questions do let me know.
a recap : need to write an individual program to read the scanned images into the code and calculate their perimeters respectilvely
thanksive managed to successfully use variables and measure the perimeter of 2 images i have scanned from my flat bed scanner
refer :
http://www.mathworks.com/matlabcentral/answers/5133-image-processing-calculate-perimeter
however now my question is to combine this as a program in which i can scan the images and compare. image uploading has already been completed in .net . now from the database i need to access these images and calculate their perimeters individually . how do i do this. any other questions do let me know.
a recap : need to write an individual program to read the scanned images into the code and calculate their perimeters respectilvely
thanks ive managed to successfully use variables and measure the perimeter of 2 images i have scanned from my flat bed scanner
refer :
http://www.mathworks.com/matlabcentral/answers/5133-image-processing-calculate-perimeter
however now my question is to combine this as a program in which i can scan the images and compare. image uploading has already been completed in .net . now from the database i need to access these images and calculate their perimeters individually . how do i do this. any other questions do let me know.
a recap : need to write an individual program to read the scanned images into the code and calculate their perimeters respectilvely
thanks image processing, .net, programming, code generation MATLAB Answers — New Questions