Tag Archives: matlab
Hi, why aren’t these circuits working?
The three phase inverter only converts one period.The three phase inverter only converts one period. The three phase inverter only converts one period. #inverter MATLAB Answers — New Questions
Running the cloud-based MATLAB for an extended period of time
I have a code that can take between 1 up to 4 hours to finish. I want to run the code on the cloud-based platform. However, the problem is that after few minutes the MATLAB site requires some activity (like moving the pointer) in the page or it will log me out automatically.
How can I run the MATLAB code for an extended period of time without me having to be in front of the computer?I have a code that can take between 1 up to 4 hours to finish. I want to run the code on the cloud-based platform. However, the problem is that after few minutes the MATLAB site requires some activity (like moving the pointer) in the page or it will log me out automatically.
How can I run the MATLAB code for an extended period of time without me having to be in front of the computer? I have a code that can take between 1 up to 4 hours to finish. I want to run the code on the cloud-based platform. However, the problem is that after few minutes the MATLAB site requires some activity (like moving the pointer) in the page or it will log me out automatically.
How can I run the MATLAB code for an extended period of time without me having to be in front of the computer? cloud-based matlab MATLAB Answers — New Questions
How to solve dy/dt=A(t)*y where y is a vector (3 elements) and A is 3×3 matrix with time dependent elements.
The ODE is:
Initial values are Ao=(1,0,0). I have a subroutine that calculates Aij(t). Inputs to this subroutine are a vector of the times, (t(1),t(2)…..t(N)), and 2 vectors with parameters required to calculate R(i,j,t(k)). Please let me know what, if any, Matlab routines can be used for this purpose.
Thanks, Richard WittebortThe ODE is:
Initial values are Ao=(1,0,0). I have a subroutine that calculates Aij(t). Inputs to this subroutine are a vector of the times, (t(1),t(2)…..t(N)), and 2 vectors with parameters required to calculate R(i,j,t(k)). Please let me know what, if any, Matlab routines can be used for this purpose.
Thanks, Richard Wittebort The ODE is:
Initial values are Ao=(1,0,0). I have a subroutine that calculates Aij(t). Inputs to this subroutine are a vector of the times, (t(1),t(2)…..t(N)), and 2 vectors with parameters required to calculate R(i,j,t(k)). Please let me know what, if any, Matlab routines can be used for this purpose.
Thanks, Richard Wittebort matrix ode, time dependent coefficients MATLAB Answers — New Questions
Plotting two x axis in one plot, but both at the bottom.
Hi I am looking for a way to plot two x axis but both x-axis has to be in the bottom. Like shown here in the picture. The only thing I can find is where the two x-axis are on top and bottom of the plot, where I want them both on bottom.Hi I am looking for a way to plot two x axis but both x-axis has to be in the bottom. Like shown here in the picture. The only thing I can find is where the two x-axis are on top and bottom of the plot, where I want them both on bottom. Hi I am looking for a way to plot two x axis but both x-axis has to be in the bottom. Like shown here in the picture. The only thing I can find is where the two x-axis are on top and bottom of the plot, where I want them both on bottom. plot, multi axis MATLAB Answers — New Questions
Unexpected error referring pi_gene_mci_glnxa64
Receiving such error messages when starting a batch job on R2025a. However the job starts after about a minute.We don’t see such errors in older versions. Are there any major changes in R2025a that are causing these. How to remove/disable them
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci_glnxa64">Technical Support</a>.
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci">Technical Support</a>Receiving such error messages when starting a batch job on R2025a. However the job starts after about a minute.We don’t see such errors in older versions. Are there any major changes in R2025a that are causing these. How to remove/disable them
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci_glnxa64">Technical Support</a>.
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci">Technical Support</a> Receiving such error messages when starting a batch job on R2025a. However the job starts after about a minute.We don’t see such errors in older versions. Are there any major changes in R2025a that are causing these. How to remove/disable them
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci_glnxa64">Technical Support</a>.
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci">Technical Support</a> pi_gene_mci_glnxa64 MATLAB Answers — New Questions
symbolic substitution error and convert
syms x
series1(x)=sym(zeros(1));
series2(x)=sym(zeros(1));
U=zeros(1,2,’sym’);
syms x m z
alpha=15;
gamma=0.01;
U(1)=m;
U(2)=0;
A(1)=zeros(1,’sym’);
for k=1
U(k+2)=z;
A(1)=0;
for m=1:k
A(1)=A(1)+U(m)*(k-m+1)*(k-m+2)*U(k-m+3);
end
B=k*(k+1)*U(k+2)+alpha*A(1)-gamma*U(k)
D=simplify(solve(B,z))
U(k+2)=D
end
disp(U(3))
for k=1:3
series1(x)=simplify(series1(x)+U(k)*(power(x,k-1)));
end
series1
e1=subs(series1,x,1);
e=e1-1;
format long
accuracy=input(‘enter the accuracy’)
f=e(x)
g=inline(f)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c)
series2(x)=subs(series1,m,c)
toc
the synatx is correct but still the value of m is not substituted insyms x
series1(x)=sym(zeros(1));
series2(x)=sym(zeros(1));
U=zeros(1,2,’sym’);
syms x m z
alpha=15;
gamma=0.01;
U(1)=m;
U(2)=0;
A(1)=zeros(1,’sym’);
for k=1
U(k+2)=z;
A(1)=0;
for m=1:k
A(1)=A(1)+U(m)*(k-m+1)*(k-m+2)*U(k-m+3);
end
B=k*(k+1)*U(k+2)+alpha*A(1)-gamma*U(k)
D=simplify(solve(B,z))
U(k+2)=D
end
disp(U(3))
for k=1:3
series1(x)=simplify(series1(x)+U(k)*(power(x,k-1)));
end
series1
e1=subs(series1,x,1);
e=e1-1;
format long
accuracy=input(‘enter the accuracy’)
f=e(x)
g=inline(f)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c)
series2(x)=subs(series1,m,c)
toc
the synatx is correct but still the value of m is not substituted in syms x
series1(x)=sym(zeros(1));
series2(x)=sym(zeros(1));
U=zeros(1,2,’sym’);
syms x m z
alpha=15;
gamma=0.01;
U(1)=m;
U(2)=0;
A(1)=zeros(1,’sym’);
for k=1
U(k+2)=z;
A(1)=0;
for m=1:k
A(1)=A(1)+U(m)*(k-m+1)*(k-m+2)*U(k-m+3);
end
B=k*(k+1)*U(k+2)+alpha*A(1)-gamma*U(k)
D=simplify(solve(B,z))
U(k+2)=D
end
disp(U(3))
for k=1:3
series1(x)=simplify(series1(x)+U(k)*(power(x,k-1)));
end
series1
e1=subs(series1,x,1);
e=e1-1;
format long
accuracy=input(‘enter the accuracy’)
f=e(x)
g=inline(f)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c)
series2(x)=subs(series1,m,c)
toc
the synatx is correct but still the value of m is not substituted in mbolic computation MATLAB Answers — New Questions
Range-Doppler tracking radar against coherent ecm techniques
Hello everyone,
I aim to design a radar system with coherent tracking capability in MATLAB 2025b. As a representative scenario, I consider four aircraft approaching and receding from the radar. Among these four aircraft, two apply coherent electronic countermeasure (ECM) techniques against the radar in both the range and Doppler domains, while the remaining two do not perform coherent jamming with respect to the range–Doppler relationship.
The main objective is for the designed radar to first detect all four aircraft using its own transmitted and received signals, and to generate a target detection plot in the amplitude–time domain. Subsequently, the aircraft apply the specified jamming techniques against the radar. As a result of the jamming, the radar’s immunity to interference in terms of coherent tracking performance is evaluated, and the resulting tracking errors are presented as percentage error plots.
As an illustrative case, one of the aircraft applying coherent jamming may successfully deceive the radar, whereas the other may continue to be tracked with a certain level of tracking error. The remaining two aircraft, which do not employ coherent jamming, are expected to be identified by the radar as jamming sources, allowing the radar to reject the interference and continue tracking the true targets.
I have already developed a MATLAB code for this purpose; however, I have not been able to obtain the desired results. My primary goal is to apply different jamming parameter configurations against the radar, analyze the resulting tracking error rates, and investigate how these parameters affect the radar’s ability to maintain target tracking.
I would greatly appreciate any guidance or suggestions on how to approach this problem more effectively.Hello everyone,
I aim to design a radar system with coherent tracking capability in MATLAB 2025b. As a representative scenario, I consider four aircraft approaching and receding from the radar. Among these four aircraft, two apply coherent electronic countermeasure (ECM) techniques against the radar in both the range and Doppler domains, while the remaining two do not perform coherent jamming with respect to the range–Doppler relationship.
The main objective is for the designed radar to first detect all four aircraft using its own transmitted and received signals, and to generate a target detection plot in the amplitude–time domain. Subsequently, the aircraft apply the specified jamming techniques against the radar. As a result of the jamming, the radar’s immunity to interference in terms of coherent tracking performance is evaluated, and the resulting tracking errors are presented as percentage error plots.
As an illustrative case, one of the aircraft applying coherent jamming may successfully deceive the radar, whereas the other may continue to be tracked with a certain level of tracking error. The remaining two aircraft, which do not employ coherent jamming, are expected to be identified by the radar as jamming sources, allowing the radar to reject the interference and continue tracking the true targets.
I have already developed a MATLAB code for this purpose; however, I have not been able to obtain the desired results. My primary goal is to apply different jamming parameter configurations against the radar, analyze the resulting tracking error rates, and investigate how these parameters affect the radar’s ability to maintain target tracking.
I would greatly appreciate any guidance or suggestions on how to approach this problem more effectively. Hello everyone,
I aim to design a radar system with coherent tracking capability in MATLAB 2025b. As a representative scenario, I consider four aircraft approaching and receding from the radar. Among these four aircraft, two apply coherent electronic countermeasure (ECM) techniques against the radar in both the range and Doppler domains, while the remaining two do not perform coherent jamming with respect to the range–Doppler relationship.
The main objective is for the designed radar to first detect all four aircraft using its own transmitted and received signals, and to generate a target detection plot in the amplitude–time domain. Subsequently, the aircraft apply the specified jamming techniques against the radar. As a result of the jamming, the radar’s immunity to interference in terms of coherent tracking performance is evaluated, and the resulting tracking errors are presented as percentage error plots.
As an illustrative case, one of the aircraft applying coherent jamming may successfully deceive the radar, whereas the other may continue to be tracked with a certain level of tracking error. The remaining two aircraft, which do not employ coherent jamming, are expected to be identified by the radar as jamming sources, allowing the radar to reject the interference and continue tracking the true targets.
I have already developed a MATLAB code for this purpose; however, I have not been able to obtain the desired results. My primary goal is to apply different jamming parameter configurations against the radar, analyze the resulting tracking error rates, and investigate how these parameters affect the radar’s ability to maintain target tracking.
I would greatly appreciate any guidance or suggestions on how to approach this problem more effectively. radar, range-doppler, coherent tracking radar, ecm, range doppler coherency, coherent, kalman MATLAB Answers — New Questions
functionSignatures.json : specify filepath
I like the idea of Matlab function signatures.
How can I specify the file path to search in?
For example, I have a function LoadInputFile , and I want this to default to the directory C://Folder1/Folder2/Folder3, how do I do so? Can I do so both absolute and relative paths?
I have tried a lot of different attempts, all unfortunately failed.
keywords type / basePath , both failed
absolute, relative paths
forward or backward slashes
single or double slashes
Thank you
https://www.mathworks.com/help/matlab/matlab_prog/customize-code-suggestions-and-completions.html
"LoadInputFile": {
"_description": "Load a text input file",
"inputs": [
{
"name": "filename",
"kind": "optional",
"type": "filepath=Folder2/Folder3/*.txt",
"basePath": "C://Folder1/Folder2/Folder3/",
"purpose": "some file is now loaded"
}
]
},I like the idea of Matlab function signatures.
How can I specify the file path to search in?
For example, I have a function LoadInputFile , and I want this to default to the directory C://Folder1/Folder2/Folder3, how do I do so? Can I do so both absolute and relative paths?
I have tried a lot of different attempts, all unfortunately failed.
keywords type / basePath , both failed
absolute, relative paths
forward or backward slashes
single or double slashes
Thank you
https://www.mathworks.com/help/matlab/matlab_prog/customize-code-suggestions-and-completions.html
"LoadInputFile": {
"_description": "Load a text input file",
"inputs": [
{
"name": "filename",
"kind": "optional",
"type": "filepath=Folder2/Folder3/*.txt",
"basePath": "C://Folder1/Folder2/Folder3/",
"purpose": "some file is now loaded"
}
]
}, I like the idea of Matlab function signatures.
How can I specify the file path to search in?
For example, I have a function LoadInputFile , and I want this to default to the directory C://Folder1/Folder2/Folder3, how do I do so? Can I do so both absolute and relative paths?
I have tried a lot of different attempts, all unfortunately failed.
keywords type / basePath , both failed
absolute, relative paths
forward or backward slashes
single or double slashes
Thank you
https://www.mathworks.com/help/matlab/matlab_prog/customize-code-suggestions-and-completions.html
"LoadInputFile": {
"_description": "Load a text input file",
"inputs": [
{
"name": "filename",
"kind": "optional",
"type": "filepath=Folder2/Folder3/*.txt",
"basePath": "C://Folder1/Folder2/Folder3/",
"purpose": "some file is now loaded"
}
]
}, matlab, signature, functionsignatures MATLAB Answers — New Questions
CONVERT FREQUENCY DOMAIN DATA TO TIME DOMAIIN
i have .csv file which contains frequency (Hz), magnitude(dB), phase(degrees). these data are range from 20hz to 2000000Hz(2MHz) and these are non uniformly spaced. i want to convert these data in time domain. i have done ifft code for that. is it correct ?
% Load CSV data
data = readmatrix(filenames{file_idx});
% Extract columns (adjust indices if your CSV has different column order)
freq = data(:, 1); % Frequency in Hz
mag_dB = data(:, 2); % Magnitude in dB
phase_deg = data(:, 3); % Phase in degrees
% Convert to linear magnitude and radians
mag_linear = 10.^(mag_dB/20);
phase_rad = deg2rad(phase_deg);
% Store original data
results{file_idx}.freq_orig = freq;
results{file_idx}.mag_dB_orig = mag_dB;
results{file_idx}.phase_deg_orig = phase_deg;
% Determine frequency range
f_min = min(freq);
f_max = max(freq);
% Use power of 2 for efficient FFT
N_fft = 2^nextpow2(length(freq) * 8);
% Calculate number of positive frequency bins
n_pos = floor(N_fft/2) + 1;
% Create frequency vector for FFT bins
freq_fft_positive = linspace(f_min, f_max, n_pos);
% Interpolate magnitude and phase
mag_fft = interp1(freq, mag_linear, freq_fft_positive, ‘pchip’, ‘extrap’);
phase_fft = interp1(freq, (phase_rad), freq_fft_positive, ‘pchip’, ‘extrap’);
H_fft_pos = mag_fft .* exp(1j * phase_fft);
% Initialize full spectrum
H_full = zeros(1, N_fft);
% Place positive frequencies (DC to Nyquist)
H_full(1:n_pos) = H_fft_pos;
% Mirror for negative frequencies (conjugate symmetry)
if mod(N_fft, 2) == 0
H_full(n_pos+1:N_fft) = conj(H_fft_pos(end-1:-1:2));
else
H_full(n_pos+1:N_fft) = conj(H_fft_pos(end:-1:2));
end
% Perform IFFT
h_time = ifft(H_full, ‘symmetric’);
% Create time vector
fs = 2 * f_max;
dt = 1 / fs;
t = (0:N_fft-1) * dt;i have .csv file which contains frequency (Hz), magnitude(dB), phase(degrees). these data are range from 20hz to 2000000Hz(2MHz) and these are non uniformly spaced. i want to convert these data in time domain. i have done ifft code for that. is it correct ?
% Load CSV data
data = readmatrix(filenames{file_idx});
% Extract columns (adjust indices if your CSV has different column order)
freq = data(:, 1); % Frequency in Hz
mag_dB = data(:, 2); % Magnitude in dB
phase_deg = data(:, 3); % Phase in degrees
% Convert to linear magnitude and radians
mag_linear = 10.^(mag_dB/20);
phase_rad = deg2rad(phase_deg);
% Store original data
results{file_idx}.freq_orig = freq;
results{file_idx}.mag_dB_orig = mag_dB;
results{file_idx}.phase_deg_orig = phase_deg;
% Determine frequency range
f_min = min(freq);
f_max = max(freq);
% Use power of 2 for efficient FFT
N_fft = 2^nextpow2(length(freq) * 8);
% Calculate number of positive frequency bins
n_pos = floor(N_fft/2) + 1;
% Create frequency vector for FFT bins
freq_fft_positive = linspace(f_min, f_max, n_pos);
% Interpolate magnitude and phase
mag_fft = interp1(freq, mag_linear, freq_fft_positive, ‘pchip’, ‘extrap’);
phase_fft = interp1(freq, (phase_rad), freq_fft_positive, ‘pchip’, ‘extrap’);
H_fft_pos = mag_fft .* exp(1j * phase_fft);
% Initialize full spectrum
H_full = zeros(1, N_fft);
% Place positive frequencies (DC to Nyquist)
H_full(1:n_pos) = H_fft_pos;
% Mirror for negative frequencies (conjugate symmetry)
if mod(N_fft, 2) == 0
H_full(n_pos+1:N_fft) = conj(H_fft_pos(end-1:-1:2));
else
H_full(n_pos+1:N_fft) = conj(H_fft_pos(end:-1:2));
end
% Perform IFFT
h_time = ifft(H_full, ‘symmetric’);
% Create time vector
fs = 2 * f_max;
dt = 1 / fs;
t = (0:N_fft-1) * dt; i have .csv file which contains frequency (Hz), magnitude(dB), phase(degrees). these data are range from 20hz to 2000000Hz(2MHz) and these are non uniformly spaced. i want to convert these data in time domain. i have done ifft code for that. is it correct ?
% Load CSV data
data = readmatrix(filenames{file_idx});
% Extract columns (adjust indices if your CSV has different column order)
freq = data(:, 1); % Frequency in Hz
mag_dB = data(:, 2); % Magnitude in dB
phase_deg = data(:, 3); % Phase in degrees
% Convert to linear magnitude and radians
mag_linear = 10.^(mag_dB/20);
phase_rad = deg2rad(phase_deg);
% Store original data
results{file_idx}.freq_orig = freq;
results{file_idx}.mag_dB_orig = mag_dB;
results{file_idx}.phase_deg_orig = phase_deg;
% Determine frequency range
f_min = min(freq);
f_max = max(freq);
% Use power of 2 for efficient FFT
N_fft = 2^nextpow2(length(freq) * 8);
% Calculate number of positive frequency bins
n_pos = floor(N_fft/2) + 1;
% Create frequency vector for FFT bins
freq_fft_positive = linspace(f_min, f_max, n_pos);
% Interpolate magnitude and phase
mag_fft = interp1(freq, mag_linear, freq_fft_positive, ‘pchip’, ‘extrap’);
phase_fft = interp1(freq, (phase_rad), freq_fft_positive, ‘pchip’, ‘extrap’);
H_fft_pos = mag_fft .* exp(1j * phase_fft);
% Initialize full spectrum
H_full = zeros(1, N_fft);
% Place positive frequencies (DC to Nyquist)
H_full(1:n_pos) = H_fft_pos;
% Mirror for negative frequencies (conjugate symmetry)
if mod(N_fft, 2) == 0
H_full(n_pos+1:N_fft) = conj(H_fft_pos(end-1:-1:2));
else
H_full(n_pos+1:N_fft) = conj(H_fft_pos(end:-1:2));
end
% Perform IFFT
h_time = ifft(H_full, ‘symmetric’);
% Create time vector
fs = 2 * f_max;
dt = 1 / fs;
t = (0:N_fft-1) * dt; ifft MATLAB Answers — New Questions
TextScatter implementation does not expose the indices it chose for display when ‘TextDensityPercentage’ is used
rng(10) % for reproducibility
n=100;
x = randn(n,1);
y = randn(n,1);
seq = (1:n)’;
h=textscatter(x,y,string(seq), …
‘TextDensityPercentage’,20, …
‘DisplayName’,’text’)
I want to know the indexes of the unis which have been displayed by function textscatter from handle h (in this case 1, 4 and 22) or from findall, ancestor, ….
I wanted to use textscatter with geoaxes but it seems it is not supported. Therefore the idea is to project the map on cartesian axes and then retrieve the indexes of displayed units from textscatter with ‘Name’, Value ‘TextDensityPercentage’,20, but I need to know the indexes.
Any other idea is welcome (apart from "implementing my own label-selection rule" which labels points if they are not closer than a threshold) .
Copilot and ChatGPT claim it is not possible but I want to have your opinion.
Thank you in advancerng(10) % for reproducibility
n=100;
x = randn(n,1);
y = randn(n,1);
seq = (1:n)’;
h=textscatter(x,y,string(seq), …
‘TextDensityPercentage’,20, …
‘DisplayName’,’text’)
I want to know the indexes of the unis which have been displayed by function textscatter from handle h (in this case 1, 4 and 22) or from findall, ancestor, ….
I wanted to use textscatter with geoaxes but it seems it is not supported. Therefore the idea is to project the map on cartesian axes and then retrieve the indexes of displayed units from textscatter with ‘Name’, Value ‘TextDensityPercentage’,20, but I need to know the indexes.
Any other idea is welcome (apart from "implementing my own label-selection rule" which labels points if they are not closer than a threshold) .
Copilot and ChatGPT claim it is not possible but I want to have your opinion.
Thank you in advance rng(10) % for reproducibility
n=100;
x = randn(n,1);
y = randn(n,1);
seq = (1:n)’;
h=textscatter(x,y,string(seq), …
‘TextDensityPercentage’,20, …
‘DisplayName’,’text’)
I want to know the indexes of the unis which have been displayed by function textscatter from handle h (in this case 1, 4 and 22) or from findall, ancestor, ….
I wanted to use textscatter with geoaxes but it seems it is not supported. Therefore the idea is to project the map on cartesian axes and then retrieve the indexes of displayed units from textscatter with ‘Name’, Value ‘TextDensityPercentage’,20, but I need to know the indexes.
Any other idea is welcome (apart from "implementing my own label-selection rule" which labels points if they are not closer than a threshold) .
Copilot and ChatGPT claim it is not possible but I want to have your opinion.
Thank you in advance textscatter MATLAB Answers — New Questions
How adjust efficiency of chain drive block
How to adjust efficiency of a chain drive block and how to test it.How to adjust efficiency of a chain drive block and how to test it. How to adjust efficiency of a chain drive block and how to test it. simulink, simscape, simscape driveline, multibody MATLAB Answers — New Questions
[aerospace toolbox] Does the satelliteScenario allow to add custom vectors?
I am developing a simple simulator for a university project with the aim of using the sun sensor and a star tracker to perform attitude determination. I am using a method relying on two external reference vectors in the inertial frame and in the body frame, implemented on Simulink and using the aerospace toolbox on Matlab to visualize the satellite. Is it possible to add custom vectors (e.g. in the ECI frame that point to the Sun and to a known star) to the satellite scenario? Do you suggest, as an alternative, to do it in another way?
Thanks in advance.I am developing a simple simulator for a university project with the aim of using the sun sensor and a star tracker to perform attitude determination. I am using a method relying on two external reference vectors in the inertial frame and in the body frame, implemented on Simulink and using the aerospace toolbox on Matlab to visualize the satellite. Is it possible to add custom vectors (e.g. in the ECI frame that point to the Sun and to a known star) to the satellite scenario? Do you suggest, as an alternative, to do it in another way?
Thanks in advance. I am developing a simple simulator for a university project with the aim of using the sun sensor and a star tracker to perform attitude determination. I am using a method relying on two external reference vectors in the inertial frame and in the body frame, implemented on Simulink and using the aerospace toolbox on Matlab to visualize the satellite. Is it possible to add custom vectors (e.g. in the ECI frame that point to the Sun and to a known star) to the satellite scenario? Do you suggest, as an alternative, to do it in another way?
Thanks in advance. vectors, simulink MATLAB Answers — New Questions
How do I add summation to a symbolic equation in order to integrate across set bounds?
The goal is to integrate from a set number to infinity (or some larger number) for function GF-PDF, which is a lognormal distribution with a geometric mean GF (GFg) and spread (sigma). Each GF-PDF is specifically collected for/interpolated to a dry size (Dp) and the other distribution parameters (GFg, sigma) are fit to the data through a data inversion algorithm. For one mode in the distribution, the equation is:
The issue is that sometime there are multiple modes within one GF-PDF and so the equation becomes:
…where for each mode (k), there is a number fraction (f0,k), geometric mean GF (GFg,k), and spread (sigmak) that described each mode and the sum of all the modes is the distribution. The f0, GFg, and sigma are different for all the modes making up the GF-PDF.
The integration I’m trying to do is:
…where I can integrate above a specific value for GFc (that was calculated for a chosen Sc at a chosen Dp) and get the area/fraction of particles above that GFc since the GF-PDF is at unity. I know how to use trapz(), but integration as a whole has been confusing me. From what I have been reading, I need to input the GF-PDF as a symbolic function, but I’m uncertain on how to add the summation to the symbolic equation in the cases where 2 or more modes are present. I could create the single mode equation as a symbolic function, but I’m again not sure how to integrate across the summation of the equations.
Below are functions I created to create the GF-PDFs, but I know that they aren’t symbolic. I add some sample parameters and the range of GF too.
binsp = (exp(1/60)*0.7)-0.7; % logspace for GF range
gf_rng = 0.90:binsp:2.5; % range of GF in log-space for the GF-PDFs
% Example values for a bimodal (k = 2) GF-PDF:
g0s = [1.1,1.5]; % geometric mean GF
sig0s = [1.04,1.05]; % spread in GF
f0s = [0.4,0.6]; % number fraction of mode
% GF-PDF for GF range
gfpdf = GFPDFf(gf_rng,g0s,sig0s,f0s); % uses functions at bottom
% I could make a symbolic function for just the one lognormal mode, I’m not
% sure how to sum them both in it though…
gf_rng = sym(‘gf_rng’);
g0s = sym(‘g0s’);
sig0s = sym(‘sig0s’);
f0s = sym(‘f0s’);
GFPDF_1m = (f0s./sqrt(2.*pi.*(log(sig0s)).^2)).*exp((-0.5).*((log(gf_rng./g0s).^2)./((log(sig0s)).^2)))
% I’m uncertain where to go from here if I want to integrate from GFc to
% infinity for the bimodal curve…
GFc = 1.3; % random GFc value
% Functions for GF-PDF creations
% Calculating the GFPDF:
function npdf = GFPDFf(gf_rng,g0s,sig0s,f0s)
if width(g0s)>1
for i = 1:width(g0s)
pdf(i,:) = lnPDF(gf_rng,g0s(1,i),sig0s(1,i),f0s(1,i));
end
npdf = sum(pdf);
else
npdf = lnPDF(gf_rng,g0s,sig0s,f0s);
end
end
% Plotting Lognormal Modes:
function pdf = lnPDF(gf_rng,g0s,sig0s,f0s)
pdf = (f0s./sqrt(2.*pi.*(log(sig0s)).^2)).*exp((-0.5).*((log(gf_rng./g0s).^2)./((log(sig0s)).^2)));
endThe goal is to integrate from a set number to infinity (or some larger number) for function GF-PDF, which is a lognormal distribution with a geometric mean GF (GFg) and spread (sigma). Each GF-PDF is specifically collected for/interpolated to a dry size (Dp) and the other distribution parameters (GFg, sigma) are fit to the data through a data inversion algorithm. For one mode in the distribution, the equation is:
The issue is that sometime there are multiple modes within one GF-PDF and so the equation becomes:
…where for each mode (k), there is a number fraction (f0,k), geometric mean GF (GFg,k), and spread (sigmak) that described each mode and the sum of all the modes is the distribution. The f0, GFg, and sigma are different for all the modes making up the GF-PDF.
The integration I’m trying to do is:
…where I can integrate above a specific value for GFc (that was calculated for a chosen Sc at a chosen Dp) and get the area/fraction of particles above that GFc since the GF-PDF is at unity. I know how to use trapz(), but integration as a whole has been confusing me. From what I have been reading, I need to input the GF-PDF as a symbolic function, but I’m uncertain on how to add the summation to the symbolic equation in the cases where 2 or more modes are present. I could create the single mode equation as a symbolic function, but I’m again not sure how to integrate across the summation of the equations.
Below are functions I created to create the GF-PDFs, but I know that they aren’t symbolic. I add some sample parameters and the range of GF too.
binsp = (exp(1/60)*0.7)-0.7; % logspace for GF range
gf_rng = 0.90:binsp:2.5; % range of GF in log-space for the GF-PDFs
% Example values for a bimodal (k = 2) GF-PDF:
g0s = [1.1,1.5]; % geometric mean GF
sig0s = [1.04,1.05]; % spread in GF
f0s = [0.4,0.6]; % number fraction of mode
% GF-PDF for GF range
gfpdf = GFPDFf(gf_rng,g0s,sig0s,f0s); % uses functions at bottom
% I could make a symbolic function for just the one lognormal mode, I’m not
% sure how to sum them both in it though…
gf_rng = sym(‘gf_rng’);
g0s = sym(‘g0s’);
sig0s = sym(‘sig0s’);
f0s = sym(‘f0s’);
GFPDF_1m = (f0s./sqrt(2.*pi.*(log(sig0s)).^2)).*exp((-0.5).*((log(gf_rng./g0s).^2)./((log(sig0s)).^2)))
% I’m uncertain where to go from here if I want to integrate from GFc to
% infinity for the bimodal curve…
GFc = 1.3; % random GFc value
% Functions for GF-PDF creations
% Calculating the GFPDF:
function npdf = GFPDFf(gf_rng,g0s,sig0s,f0s)
if width(g0s)>1
for i = 1:width(g0s)
pdf(i,:) = lnPDF(gf_rng,g0s(1,i),sig0s(1,i),f0s(1,i));
end
npdf = sum(pdf);
else
npdf = lnPDF(gf_rng,g0s,sig0s,f0s);
end
end
% Plotting Lognormal Modes:
function pdf = lnPDF(gf_rng,g0s,sig0s,f0s)
pdf = (f0s./sqrt(2.*pi.*(log(sig0s)).^2)).*exp((-0.5).*((log(gf_rng./g0s).^2)./((log(sig0s)).^2)));
end The goal is to integrate from a set number to infinity (or some larger number) for function GF-PDF, which is a lognormal distribution with a geometric mean GF (GFg) and spread (sigma). Each GF-PDF is specifically collected for/interpolated to a dry size (Dp) and the other distribution parameters (GFg, sigma) are fit to the data through a data inversion algorithm. For one mode in the distribution, the equation is:
The issue is that sometime there are multiple modes within one GF-PDF and so the equation becomes:
…where for each mode (k), there is a number fraction (f0,k), geometric mean GF (GFg,k), and spread (sigmak) that described each mode and the sum of all the modes is the distribution. The f0, GFg, and sigma are different for all the modes making up the GF-PDF.
The integration I’m trying to do is:
…where I can integrate above a specific value for GFc (that was calculated for a chosen Sc at a chosen Dp) and get the area/fraction of particles above that GFc since the GF-PDF is at unity. I know how to use trapz(), but integration as a whole has been confusing me. From what I have been reading, I need to input the GF-PDF as a symbolic function, but I’m uncertain on how to add the summation to the symbolic equation in the cases where 2 or more modes are present. I could create the single mode equation as a symbolic function, but I’m again not sure how to integrate across the summation of the equations.
Below are functions I created to create the GF-PDFs, but I know that they aren’t symbolic. I add some sample parameters and the range of GF too.
binsp = (exp(1/60)*0.7)-0.7; % logspace for GF range
gf_rng = 0.90:binsp:2.5; % range of GF in log-space for the GF-PDFs
% Example values for a bimodal (k = 2) GF-PDF:
g0s = [1.1,1.5]; % geometric mean GF
sig0s = [1.04,1.05]; % spread in GF
f0s = [0.4,0.6]; % number fraction of mode
% GF-PDF for GF range
gfpdf = GFPDFf(gf_rng,g0s,sig0s,f0s); % uses functions at bottom
% I could make a symbolic function for just the one lognormal mode, I’m not
% sure how to sum them both in it though…
gf_rng = sym(‘gf_rng’);
g0s = sym(‘g0s’);
sig0s = sym(‘sig0s’);
f0s = sym(‘f0s’);
GFPDF_1m = (f0s./sqrt(2.*pi.*(log(sig0s)).^2)).*exp((-0.5).*((log(gf_rng./g0s).^2)./((log(sig0s)).^2)))
% I’m uncertain where to go from here if I want to integrate from GFc to
% infinity for the bimodal curve…
GFc = 1.3; % random GFc value
% Functions for GF-PDF creations
% Calculating the GFPDF:
function npdf = GFPDFf(gf_rng,g0s,sig0s,f0s)
if width(g0s)>1
for i = 1:width(g0s)
pdf(i,:) = lnPDF(gf_rng,g0s(1,i),sig0s(1,i),f0s(1,i));
end
npdf = sum(pdf);
else
npdf = lnPDF(gf_rng,g0s,sig0s,f0s);
end
end
% Plotting Lognormal Modes:
function pdf = lnPDF(gf_rng,g0s,sig0s,f0s)
pdf = (f0s./sqrt(2.*pi.*(log(sig0s)).^2)).*exp((-0.5).*((log(gf_rng./g0s).^2)./((log(sig0s)).^2)));
end sum, integration, symbolic, pdf MATLAB Answers — New Questions
AUTOSAR Blockset – ERROR: Expected application type to be mapped
I am working on an AUTOSAR architecture using Simulink.
I can compile it without problems, but whenever I perform an action: adding a constant to the dictionary, changing the dimension of a data type or even executing the command
archDict = Simulink.dictionary.archdata.open(‘BmsDataDictionary.sldd’)
I get the error:
The call to autosar_make_rtw_hook, during the after_tlc hook generated the following error:
Expected application type to be mapped
The build process will terminate as a result.
Caused by:
Expected application type to be mapped
I have modified the dictionary in the past, I can’t figure out what is happeningI am working on an AUTOSAR architecture using Simulink.
I can compile it without problems, but whenever I perform an action: adding a constant to the dictionary, changing the dimension of a data type or even executing the command
archDict = Simulink.dictionary.archdata.open(‘BmsDataDictionary.sldd’)
I get the error:
The call to autosar_make_rtw_hook, during the after_tlc hook generated the following error:
Expected application type to be mapped
The build process will terminate as a result.
Caused by:
Expected application type to be mapped
I have modified the dictionary in the past, I can’t figure out what is happening I am working on an AUTOSAR architecture using Simulink.
I can compile it without problems, but whenever I perform an action: adding a constant to the dictionary, changing the dimension of a data type or even executing the command
archDict = Simulink.dictionary.archdata.open(‘BmsDataDictionary.sldd’)
I get the error:
The call to autosar_make_rtw_hook, during the after_tlc hook generated the following error:
Expected application type to be mapped
The build process will terminate as a result.
Caused by:
Expected application type to be mapped
I have modified the dictionary in the past, I can’t figure out what is happening autosar, autosar blockset, simulink, software architecture, composition, dictionary MATLAB Answers — New Questions
launchpadXL F28379D interference between inputs of a same ADC
Hello,
============ Context
I’m using simulink with external mode to pilot a launchpadXL F28379D and I use a lot of ADC readings.
ADC_C is used to measure 2 differencial inputs (C_IN2/IN3 and C_IN4/IN5) <=> These measurements present no issue
ADC_B is used to measure 4 single ended-inputs (B2, B3, B4 and B5)
ADC_A is used to measure 4 single ended-inputs (A2, A3, A4 and A5)
My outputs are DAC-A, DAC-B and ePWM 1,2 and 3.
I’ve shared a model for ease of debugging : "Launchpad_Instanciation.slx".
============ Measurements
For the measurements I have the board by itsef and a DC power supply to test the PINs.
To confirm the proper operation of the ADC I input a voltage between the concerned PIN (+) and the board’s GND (-). The issue appears when I test the measurements done with ADC_A and ADC_B. See "InterferenceBetweenADC.png".
In ADC_A
when I input a voltage in A2, I have a input reading. The issue is that I also have a small reading in A3
when I input a voltage in A3, I have a input reading. The issue is that I also have a small reading in A4
when I input a voltage in A4, I have a input reading. The issue is that I also have a small reading in A5
when I input a voltage in A5, I have a input reading. The issue is that I also have a small reading in A2
In ADC_B I have the same issue
when I input a voltage in B2, I have a input reading. The issue is that I also have a small reading in B3
when I input a voltage in B3, I have a input reading. The issue is that I also have a small reading in B4
when I input a voltage in B4, I have a input reading. The issue is that I also have a small reading in B5
when I input a voltage in B5, I have a input reading. The issue is that I also have a small reading in B2
============ Question
Why does an input voltage on a ADC’s input would impact the "next" input of the same ADC?
I appreciate the time you took to read my issue and any help will be greatly appreciated.
Kind regards,Hello,
============ Context
I’m using simulink with external mode to pilot a launchpadXL F28379D and I use a lot of ADC readings.
ADC_C is used to measure 2 differencial inputs (C_IN2/IN3 and C_IN4/IN5) <=> These measurements present no issue
ADC_B is used to measure 4 single ended-inputs (B2, B3, B4 and B5)
ADC_A is used to measure 4 single ended-inputs (A2, A3, A4 and A5)
My outputs are DAC-A, DAC-B and ePWM 1,2 and 3.
I’ve shared a model for ease of debugging : "Launchpad_Instanciation.slx".
============ Measurements
For the measurements I have the board by itsef and a DC power supply to test the PINs.
To confirm the proper operation of the ADC I input a voltage between the concerned PIN (+) and the board’s GND (-). The issue appears when I test the measurements done with ADC_A and ADC_B. See "InterferenceBetweenADC.png".
In ADC_A
when I input a voltage in A2, I have a input reading. The issue is that I also have a small reading in A3
when I input a voltage in A3, I have a input reading. The issue is that I also have a small reading in A4
when I input a voltage in A4, I have a input reading. The issue is that I also have a small reading in A5
when I input a voltage in A5, I have a input reading. The issue is that I also have a small reading in A2
In ADC_B I have the same issue
when I input a voltage in B2, I have a input reading. The issue is that I also have a small reading in B3
when I input a voltage in B3, I have a input reading. The issue is that I also have a small reading in B4
when I input a voltage in B4, I have a input reading. The issue is that I also have a small reading in B5
when I input a voltage in B5, I have a input reading. The issue is that I also have a small reading in B2
============ Question
Why does an input voltage on a ADC’s input would impact the "next" input of the same ADC?
I appreciate the time you took to read my issue and any help will be greatly appreciated.
Kind regards, Hello,
============ Context
I’m using simulink with external mode to pilot a launchpadXL F28379D and I use a lot of ADC readings.
ADC_C is used to measure 2 differencial inputs (C_IN2/IN3 and C_IN4/IN5) <=> These measurements present no issue
ADC_B is used to measure 4 single ended-inputs (B2, B3, B4 and B5)
ADC_A is used to measure 4 single ended-inputs (A2, A3, A4 and A5)
My outputs are DAC-A, DAC-B and ePWM 1,2 and 3.
I’ve shared a model for ease of debugging : "Launchpad_Instanciation.slx".
============ Measurements
For the measurements I have the board by itsef and a DC power supply to test the PINs.
To confirm the proper operation of the ADC I input a voltage between the concerned PIN (+) and the board’s GND (-). The issue appears when I test the measurements done with ADC_A and ADC_B. See "InterferenceBetweenADC.png".
In ADC_A
when I input a voltage in A2, I have a input reading. The issue is that I also have a small reading in A3
when I input a voltage in A3, I have a input reading. The issue is that I also have a small reading in A4
when I input a voltage in A4, I have a input reading. The issue is that I also have a small reading in A5
when I input a voltage in A5, I have a input reading. The issue is that I also have a small reading in A2
In ADC_B I have the same issue
when I input a voltage in B2, I have a input reading. The issue is that I also have a small reading in B3
when I input a voltage in B3, I have a input reading. The issue is that I also have a small reading in B4
when I input a voltage in B4, I have a input reading. The issue is that I also have a small reading in B5
when I input a voltage in B5, I have a input reading. The issue is that I also have a small reading in B2
============ Question
Why does an input voltage on a ADC’s input would impact the "next" input of the same ADC?
I appreciate the time you took to read my issue and any help will be greatly appreciated.
Kind regards, f28379d, interference, adc inputs MATLAB Answers — New Questions
Producing Clutter IQ for arbitrary Waveform
I was looking at https://www.mathworks.com/help/radar/ug/simulating-radar-returns-from-moving-sea-surfaces.html and saw that the radarTransciever() object has a phased.LinearFMWaveform() object attributed to it. Upon looking at this i realize there are only a few types of waveforms available, and it seems NO custom IQ waveform that can be created into a object like phased.LinearFMWaveform() that i can use to define in the radarTransceiver() object and therefore execute the receive(scene).
Ultimately i need to generate IQ off sea surface, with an arbitrary waveform i have predefined/computed.
Is there a way to define a custom waveform that is compatible with what i am trying to do above? or is there another way to generate IQ clutter return with an arbitrary waveform?I was looking at https://www.mathworks.com/help/radar/ug/simulating-radar-returns-from-moving-sea-surfaces.html and saw that the radarTransciever() object has a phased.LinearFMWaveform() object attributed to it. Upon looking at this i realize there are only a few types of waveforms available, and it seems NO custom IQ waveform that can be created into a object like phased.LinearFMWaveform() that i can use to define in the radarTransceiver() object and therefore execute the receive(scene).
Ultimately i need to generate IQ off sea surface, with an arbitrary waveform i have predefined/computed.
Is there a way to define a custom waveform that is compatible with what i am trying to do above? or is there another way to generate IQ clutter return with an arbitrary waveform? I was looking at https://www.mathworks.com/help/radar/ug/simulating-radar-returns-from-moving-sea-surfaces.html and saw that the radarTransciever() object has a phased.LinearFMWaveform() object attributed to it. Upon looking at this i realize there are only a few types of waveforms available, and it seems NO custom IQ waveform that can be created into a object like phased.LinearFMWaveform() that i can use to define in the radarTransceiver() object and therefore execute the receive(scene).
Ultimately i need to generate IQ off sea surface, with an arbitrary waveform i have predefined/computed.
Is there a way to define a custom waveform that is compatible with what i am trying to do above? or is there another way to generate IQ clutter return with an arbitrary waveform? clutter, seasurface, iq, surfacereflectivity, surfacereflectivitysea MATLAB Answers — New Questions
splitapply does not retain ME stack
When the function that splitapply throws an error, this line number of this error is not include in the output (matlab2024b)
Example:
T=table([1:3]’);
G=findgroups(T);
splitapply(@fun, T, G);
function out = fun(varargin)
ERROR
end
This returns:
Error using splitapply>localsplitandapply (line 196)
Unable to apply the function ‘fun’ to the 1st group of data.
Error in splitapply (line 135)
varargout = localsplitandapply(fun,dataVars,gdiffed,sgnums,gdim,nargout);
Error in templateLoopOverAll (line 231)
splitapply(@fun, T, G);
Caused by:
Unrecognized function or variable ‘ERROR’.
I was expeting that the line number that actually caused that error would be included:
Error in testfile>fun (line 5)
ERROR
Error in testfile (line 3)
fun()
Missing this information makes the debugging of fun very challenging.
How to retrieve this line number?When the function that splitapply throws an error, this line number of this error is not include in the output (matlab2024b)
Example:
T=table([1:3]’);
G=findgroups(T);
splitapply(@fun, T, G);
function out = fun(varargin)
ERROR
end
This returns:
Error using splitapply>localsplitandapply (line 196)
Unable to apply the function ‘fun’ to the 1st group of data.
Error in splitapply (line 135)
varargout = localsplitandapply(fun,dataVars,gdiffed,sgnums,gdim,nargout);
Error in templateLoopOverAll (line 231)
splitapply(@fun, T, G);
Caused by:
Unrecognized function or variable ‘ERROR’.
I was expeting that the line number that actually caused that error would be included:
Error in testfile>fun (line 5)
ERROR
Error in testfile (line 3)
fun()
Missing this information makes the debugging of fun very challenging.
How to retrieve this line number? When the function that splitapply throws an error, this line number of this error is not include in the output (matlab2024b)
Example:
T=table([1:3]’);
G=findgroups(T);
splitapply(@fun, T, G);
function out = fun(varargin)
ERROR
end
This returns:
Error using splitapply>localsplitandapply (line 196)
Unable to apply the function ‘fun’ to the 1st group of data.
Error in splitapply (line 135)
varargout = localsplitandapply(fun,dataVars,gdiffed,sgnums,gdim,nargout);
Error in templateLoopOverAll (line 231)
splitapply(@fun, T, G);
Caused by:
Unrecognized function or variable ‘ERROR’.
I was expeting that the line number that actually caused that error would be included:
Error in testfile>fun (line 5)
ERROR
Error in testfile (line 3)
fun()
Missing this information makes the debugging of fun very challenging.
How to retrieve this line number? matlab internals, error handling MATLAB Answers — New Questions
Resolve this exercice please
Mathlab exerciceMathlab exercice Mathlab exercice matlab, matlab function MATLAB Answers — New Questions
Error in converting 2D Kalman filter to 3D.
I am receiving the following error when attempting to convert a 2D Kalman filter into 3D.
Non-uniform distribution of output to dynamically sized inputs in blocks.
PSA screenshot of error message.I am receiving the following error when attempting to convert a 2D Kalman filter into 3D.
Non-uniform distribution of output to dynamically sized inputs in blocks.
PSA screenshot of error message. I am receiving the following error when attempting to convert a 2D Kalman filter into 3D.
Non-uniform distribution of output to dynamically sized inputs in blocks.
PSA screenshot of error message. simulink MATLAB Answers — New Questions
Rules formation method using fuzzy c means clustering method.
I want to know about tool that automatically genreate the rules on the basis of dataset with fuzzy c means clustering method .Please explain with any dataset to generate rules automatically .It is very urgent for my study .I want to know about tool that automatically genreate the rules on the basis of dataset with fuzzy c means clustering method .Please explain with any dataset to generate rules automatically .It is very urgent for my study . I want to know about tool that automatically genreate the rules on the basis of dataset with fuzzy c means clustering method .Please explain with any dataset to generate rules automatically .It is very urgent for my study . fcm, fuzzy, mamdani, fis MATLAB Answers — New Questions









