Category: Matlab
Category Archives: Matlab
t test for two samples with different sizes
Hi,
Which function should i use if I want to test whether two samples with different sizes have different means? I see many ttest functions in matlabHi,
Which function should i use if I want to test whether two samples with different sizes have different means? I see many ttest functions in matlab Hi,
Which function should i use if I want to test whether two samples with different sizes have different means? I see many ttest functions in matlab t test MATLAB Answers — New Questions
Facing Error in installing SimMechanics for Inventor 2022
Hello,
I am trying to pull a few CAD models (modelled in CATIA) to Simscape for simulation. In the process, I am suggested to install SimScape Multibody Link Plugin. I have used the Mathworks web link for the same
https://in.mathworks.com/help/physmod/smlink/ug/installing-and-linking-simmechanics-link-software.html
However, Once after completing Step 4, it is supposed to show the SimMechanics Link (Add-in) in Autodesk Inventor 2022 but, it is not.
Currently I am using Matlab 2021b version (and I have downloaded the corresponded Plugin files from Step 1 of the above mentioned link).Hello,
I am trying to pull a few CAD models (modelled in CATIA) to Simscape for simulation. In the process, I am suggested to install SimScape Multibody Link Plugin. I have used the Mathworks web link for the same
https://in.mathworks.com/help/physmod/smlink/ug/installing-and-linking-simmechanics-link-software.html
However, Once after completing Step 4, it is supposed to show the SimMechanics Link (Add-in) in Autodesk Inventor 2022 but, it is not.
Currently I am using Matlab 2021b version (and I have downloaded the corresponded Plugin files from Step 1 of the above mentioned link). Hello,
I am trying to pull a few CAD models (modelled in CATIA) to Simscape for simulation. In the process, I am suggested to install SimScape Multibody Link Plugin. I have used the Mathworks web link for the same
https://in.mathworks.com/help/physmod/smlink/ug/installing-and-linking-simmechanics-link-software.html
However, Once after completing Step 4, it is supposed to show the SimMechanics Link (Add-in) in Autodesk Inventor 2022 but, it is not.
Currently I am using Matlab 2021b version (and I have downloaded the corresponded Plugin files from Step 1 of the above mentioned link). simscape, simmechanics, inventor, simulation MATLAB Answers — New Questions
OPTIMOPTIONS does not support code generation for function ‘ga’.
I get this error OPTIMOPTIONS does not support code generation for function ‘ga’ when I try to run a matlab function in simulink using genetic algorithm optimization methode;
options = optimoptions(‘ga’, ‘Display’, ‘iter’, …
‘PopulationSize’, 50, … % You can adjust this
‘MaxGenerations’, 100, … % You can adjust this
‘UseParallel’, true); % Use parallel computing if available
could someone help me please ?I get this error OPTIMOPTIONS does not support code generation for function ‘ga’ when I try to run a matlab function in simulink using genetic algorithm optimization methode;
options = optimoptions(‘ga’, ‘Display’, ‘iter’, …
‘PopulationSize’, 50, … % You can adjust this
‘MaxGenerations’, 100, … % You can adjust this
‘UseParallel’, true); % Use parallel computing if available
could someone help me please ? I get this error OPTIMOPTIONS does not support code generation for function ‘ga’ when I try to run a matlab function in simulink using genetic algorithm optimization methode;
options = optimoptions(‘ga’, ‘Display’, ‘iter’, …
‘PopulationSize’, 50, … % You can adjust this
‘MaxGenerations’, 100, … % You can adjust this
‘UseParallel’, true); % Use parallel computing if available
could someone help me please ? genetic algorithm, simulink, optimization MATLAB Answers — New Questions
Solve more complex problems in matlab
Hello, I have the following problem: Determine m so that the equation (m-2)x²-3mx+(m+2)=0 has one positive root and one negative root.
I have written the following code and I am getting Empty sym: 0-by-1
syms x m
assume(m~=0);
eq = (m-2)*x^2-3*m*x+(m+2) == 0;
eq_roots = solve(eq, x);
x1 = eq_roots(1);
x2 = eq_roots(2);
cond1 = x1 < 0;
cond2 = 0 < x2;
s=solve([cond1, cond2], m, ‘Real’, true,’ReturnConditions’, true)
s.conditions
Is there any way to solve problems like this in matlab?
I am a beginner in matlab and I am using problems that I know how to solve mathematically to train the use of matlabHello, I have the following problem: Determine m so that the equation (m-2)x²-3mx+(m+2)=0 has one positive root and one negative root.
I have written the following code and I am getting Empty sym: 0-by-1
syms x m
assume(m~=0);
eq = (m-2)*x^2-3*m*x+(m+2) == 0;
eq_roots = solve(eq, x);
x1 = eq_roots(1);
x2 = eq_roots(2);
cond1 = x1 < 0;
cond2 = 0 < x2;
s=solve([cond1, cond2], m, ‘Real’, true,’ReturnConditions’, true)
s.conditions
Is there any way to solve problems like this in matlab?
I am a beginner in matlab and I am using problems that I know how to solve mathematically to train the use of matlab Hello, I have the following problem: Determine m so that the equation (m-2)x²-3mx+(m+2)=0 has one positive root and one negative root.
I have written the following code and I am getting Empty sym: 0-by-1
syms x m
assume(m~=0);
eq = (m-2)*x^2-3*m*x+(m+2) == 0;
eq_roots = solve(eq, x);
x1 = eq_roots(1);
x2 = eq_roots(2);
cond1 = x1 < 0;
cond2 = 0 < x2;
s=solve([cond1, cond2], m, ‘Real’, true,’ReturnConditions’, true)
s.conditions
Is there any way to solve problems like this in matlab?
I am a beginner in matlab and I am using problems that I know how to solve mathematically to train the use of matlab equation MATLAB Answers — New Questions
How do I get past grid parameter restrictions when trying to create custom training data for a YOLOv4 LIDAR object detection network?
I have been following and modifying the example for LIDAR Complex-YOLOv4 Object Detection, and I am running into an issue when creating training data using the createTrainingData.m file. The Standard pcRange block [xMin = -25.0 xMax = 25.0 yMin = 0.0 yMax = 50.0 zMin = -7.0 and zMax = 15.0] is too small for my data set, and the origin position cuts off most of the point cloud regions I want to capture (see image ROI_within_PointCloud). I would like to adjust the pcRange to allow for an ROI as seen in the attached image DesiredROI_2D_PointCloud.
When I drop the xMin and/or yMin values below the standard, i.e. xMin < -25 and/or yMin < 0, to capture the desired region I receive the following error:
———————————————————————————————————–
Error using sub2ind (line 71)
Out of range subscript.
Error in helper.preprocess (line 53)
mapIndices = sub2ind([bevHeight,bevWidth],locMod(:,1),locMod(:,2));
Error in createTrainingData (line 42)
[processedData,~] = helper.preprocess(ptCloud,gridParams);
———————————————————————————————————-
As far as I can tell after diving into the sub2ind function, this error is occuring due to v, the newly sorted array of points, failing this portion of the if statement: min(v,[],’all’) < 1. I can adjust xMax and yMax to be larger in the positive direction and have no issues.
How do I get past this issue and move/modify the region of interest within the point cloud scene? Can I adjust the origin location of the point cloud some how? Or can I remove the restriction on expanding the ROI into the negative quadrants?I have been following and modifying the example for LIDAR Complex-YOLOv4 Object Detection, and I am running into an issue when creating training data using the createTrainingData.m file. The Standard pcRange block [xMin = -25.0 xMax = 25.0 yMin = 0.0 yMax = 50.0 zMin = -7.0 and zMax = 15.0] is too small for my data set, and the origin position cuts off most of the point cloud regions I want to capture (see image ROI_within_PointCloud). I would like to adjust the pcRange to allow for an ROI as seen in the attached image DesiredROI_2D_PointCloud.
When I drop the xMin and/or yMin values below the standard, i.e. xMin < -25 and/or yMin < 0, to capture the desired region I receive the following error:
———————————————————————————————————–
Error using sub2ind (line 71)
Out of range subscript.
Error in helper.preprocess (line 53)
mapIndices = sub2ind([bevHeight,bevWidth],locMod(:,1),locMod(:,2));
Error in createTrainingData (line 42)
[processedData,~] = helper.preprocess(ptCloud,gridParams);
———————————————————————————————————-
As far as I can tell after diving into the sub2ind function, this error is occuring due to v, the newly sorted array of points, failing this portion of the if statement: min(v,[],’all’) < 1. I can adjust xMax and yMax to be larger in the positive direction and have no issues.
How do I get past this issue and move/modify the region of interest within the point cloud scene? Can I adjust the origin location of the point cloud some how? Or can I remove the restriction on expanding the ROI into the negative quadrants? I have been following and modifying the example for LIDAR Complex-YOLOv4 Object Detection, and I am running into an issue when creating training data using the createTrainingData.m file. The Standard pcRange block [xMin = -25.0 xMax = 25.0 yMin = 0.0 yMax = 50.0 zMin = -7.0 and zMax = 15.0] is too small for my data set, and the origin position cuts off most of the point cloud regions I want to capture (see image ROI_within_PointCloud). I would like to adjust the pcRange to allow for an ROI as seen in the attached image DesiredROI_2D_PointCloud.
When I drop the xMin and/or yMin values below the standard, i.e. xMin < -25 and/or yMin < 0, to capture the desired region I receive the following error:
———————————————————————————————————–
Error using sub2ind (line 71)
Out of range subscript.
Error in helper.preprocess (line 53)
mapIndices = sub2ind([bevHeight,bevWidth],locMod(:,1),locMod(:,2));
Error in createTrainingData (line 42)
[processedData,~] = helper.preprocess(ptCloud,gridParams);
———————————————————————————————————-
As far as I can tell after diving into the sub2ind function, this error is occuring due to v, the newly sorted array of points, failing this portion of the if statement: min(v,[],’all’) < 1. I can adjust xMax and yMax to be larger in the positive direction and have no issues.
How do I get past this issue and move/modify the region of interest within the point cloud scene? Can I adjust the origin location of the point cloud some how? Or can I remove the restriction on expanding the ROI into the negative quadrants? yolov4, matlab, object detection, grid, parameters, lidar, roi MATLAB Answers — New Questions
Box-Whisker Plot with 5 and 95 percentiles and non-symmetric distributions.
Dear all,
I have a 1000×2 matrix, M, where each column represents the data of two variables. I would like to plot a boxplot of the two distributions of the data, by specifying the length of the whiskers:
boxplot(M,’Whisker’,w)
However, I would like the upper and lower whiskers to represent the 5th and 95th percentiles respectively. In doing so, I have two problems:
Both the distributions are highly non-symmetric, therefore, the suggestion provided here does not work, since the multiplier w is not the same for the upper and lower whiskers.
Apparently, w can only takes on a scalar value, therefore, I cannot specify different multipliers for different distributions. Is there a way around this problem. In a follow up question of the same Q&A they suggest to use hold on, however the output is not good because of the overlapping of the figures.
It would be great if w could take the form of a 2xsize(M,2) array, in order to specify a specific multiplier for each distribution and for both the upper and lower whisker separately. However, I was not capable of editing in this way the original "boxplot" function.
Thanks in advance,
EdoardoDear all,
I have a 1000×2 matrix, M, where each column represents the data of two variables. I would like to plot a boxplot of the two distributions of the data, by specifying the length of the whiskers:
boxplot(M,’Whisker’,w)
However, I would like the upper and lower whiskers to represent the 5th and 95th percentiles respectively. In doing so, I have two problems:
Both the distributions are highly non-symmetric, therefore, the suggestion provided here does not work, since the multiplier w is not the same for the upper and lower whiskers.
Apparently, w can only takes on a scalar value, therefore, I cannot specify different multipliers for different distributions. Is there a way around this problem. In a follow up question of the same Q&A they suggest to use hold on, however the output is not good because of the overlapping of the figures.
It would be great if w could take the form of a 2xsize(M,2) array, in order to specify a specific multiplier for each distribution and for both the upper and lower whisker separately. However, I was not capable of editing in this way the original "boxplot" function.
Thanks in advance,
Edoardo Dear all,
I have a 1000×2 matrix, M, where each column represents the data of two variables. I would like to plot a boxplot of the two distributions of the data, by specifying the length of the whiskers:
boxplot(M,’Whisker’,w)
However, I would like the upper and lower whiskers to represent the 5th and 95th percentiles respectively. In doing so, I have two problems:
Both the distributions are highly non-symmetric, therefore, the suggestion provided here does not work, since the multiplier w is not the same for the upper and lower whiskers.
Apparently, w can only takes on a scalar value, therefore, I cannot specify different multipliers for different distributions. Is there a way around this problem. In a follow up question of the same Q&A they suggest to use hold on, however the output is not good because of the overlapping of the figures.
It would be great if w could take the form of a 2xsize(M,2) array, in order to specify a specific multiplier for each distribution and for both the upper and lower whisker separately. However, I was not capable of editing in this way the original "boxplot" function.
Thanks in advance,
Edoardo bow-whisker plot, confidence intervals MATLAB Answers — New Questions
How to model PID flow control with throttling (butterfly) valve in wells turbine in owc?
I want to model PID-controlled butterfly throttling valve to control the flow. the butterfly valve put before the well turbine to avoid the stalling ,this behavior which demonstrates when the flow coefficient surpasses a critical value
and how can i draw Airflow control scheme strategy for OWC plant equipped with Wells turbine like this in matlabI want to model PID-controlled butterfly throttling valve to control the flow. the butterfly valve put before the well turbine to avoid the stalling ,this behavior which demonstrates when the flow coefficient surpasses a critical value
and how can i draw Airflow control scheme strategy for OWC plant equipped with Wells turbine like this in matlab I want to model PID-controlled butterfly throttling valve to control the flow. the butterfly valve put before the well turbine to avoid the stalling ,this behavior which demonstrates when the flow coefficient surpasses a critical value
and how can i draw Airflow control scheme strategy for OWC plant equipped with Wells turbine like this in matlab owc, simulink, butterfly valve, pid controller MATLAB Answers — New Questions
What’s the quality of the matlab orbit propagation?
Do orbvital toolkits include earth, sun moon, planets?
Do they include earth gravity perturbations?
Do they include atmospheric drag? As function of lat-lon sun angle and solar F10.7?
Do they include variable drag as function of satellite shape and aspect?Do orbvital toolkits include earth, sun moon, planets?
Do they include earth gravity perturbations?
Do they include atmospheric drag? As function of lat-lon sun angle and solar F10.7?
Do they include variable drag as function of satellite shape and aspect? Do orbvital toolkits include earth, sun moon, planets?
Do they include earth gravity perturbations?
Do they include atmospheric drag? As function of lat-lon sun angle and solar F10.7?
Do they include variable drag as function of satellite shape and aspect? orbit precision MATLAB Answers — New Questions
Help with Uploading MLTBX File to File Exchange
Hello,
I attempted to upload an MLTBX file, but I received the following error message: "This submission seems to have been previously rejected or deleted. Please contact the File Exchange admin if you wish to upload it again."
Could you please advise on how to resolve this issue or provide the contact information for the File Exchange admin?
Thank you for your assistance.
Best regards,
DanielHello,
I attempted to upload an MLTBX file, but I received the following error message: "This submission seems to have been previously rejected or deleted. Please contact the File Exchange admin if you wish to upload it again."
Could you please advise on how to resolve this issue or provide the contact information for the File Exchange admin?
Thank you for your assistance.
Best regards,
Daniel Hello,
I attempted to upload an MLTBX file, but I received the following error message: "This submission seems to have been previously rejected or deleted. Please contact the File Exchange admin if you wish to upload it again."
Could you please advise on how to resolve this issue or provide the contact information for the File Exchange admin?
Thank you for your assistance.
Best regards,
Daniel mltbx, file-exchange MATLAB Answers — New Questions
can I conduce this command?
hello, I’m tring to save this string, but the format is the same and it seems weird to write the command like that…
x_1 = sprintf(‘%.*fcos(%.*ft+%.*f)+%.*fcos(%.*ft+%.*f)’,presi,X(1),presi,w_n(1),presi,phi(1),presi,X(2),presi,w_n(2),presi,phi(2));
x_2 = sprintf(‘%.*fcos(%.*ft+%.*f)+%.*fcos(%.*ft+%.*f)’,presi,X(1)*r(1),presi,w_n(1),presi,phi(1),presi,X(2)*r(2),presi,w_n(2),presi,phi(2));
there is a batter way to get this output?
The image below is markout of the output strings, beside the ‘cos’,’t’,'(/)’ the all is numbers thet I whold like that the user of the overall function will be able to determine with the variable pressi.
thank you
and sorry for my English 😚hello, I’m tring to save this string, but the format is the same and it seems weird to write the command like that…
x_1 = sprintf(‘%.*fcos(%.*ft+%.*f)+%.*fcos(%.*ft+%.*f)’,presi,X(1),presi,w_n(1),presi,phi(1),presi,X(2),presi,w_n(2),presi,phi(2));
x_2 = sprintf(‘%.*fcos(%.*ft+%.*f)+%.*fcos(%.*ft+%.*f)’,presi,X(1)*r(1),presi,w_n(1),presi,phi(1),presi,X(2)*r(2),presi,w_n(2),presi,phi(2));
there is a batter way to get this output?
The image below is markout of the output strings, beside the ‘cos’,’t’,'(/)’ the all is numbers thet I whold like that the user of the overall function will be able to determine with the variable pressi.
thank you
and sorry for my English 😚 hello, I’m tring to save this string, but the format is the same and it seems weird to write the command like that…
x_1 = sprintf(‘%.*fcos(%.*ft+%.*f)+%.*fcos(%.*ft+%.*f)’,presi,X(1),presi,w_n(1),presi,phi(1),presi,X(2),presi,w_n(2),presi,phi(2));
x_2 = sprintf(‘%.*fcos(%.*ft+%.*f)+%.*fcos(%.*ft+%.*f)’,presi,X(1)*r(1),presi,w_n(1),presi,phi(1),presi,X(2)*r(2),presi,w_n(2),presi,phi(2));
there is a batter way to get this output?
The image below is markout of the output strings, beside the ‘cos’,’t’,'(/)’ the all is numbers thet I whold like that the user of the overall function will be able to determine with the variable pressi.
thank you
and sorry for my English 😚 sprintf, string, shortening MATLAB Answers — New Questions
How can I scale and plot the graph according to the formula I use?
Hello everyone,
I am trying to plot only the diffusion and FDEP diffusion using the formulas below. However, the FDEP diffusion plot is incorrect. I am also attaching the reference graph that it should match.
formulas:
reference graph:
my graph:
% Define parameters
epsilon0 = 8.85e-12; % F/m (Permittivity of free space)
epsilon_m = 79; % F/m (Relative permittivity of the medium)
CM = 0.5; % Clausius-Mossotti factor
k_B = 1.38e-23; % J/K (Boltzmann constant)
R = 1e-6; % m (Particle radius)
gamma = 1.88e-8; % kg/s (Friction coefficient)
q = 1e-14; % C (Charge of the particle)
dt = 1e-3; % s (Time step)
T = 300; % K (Room temperature)
x0 = 10e-6; % Initial position (slightly adjusted from zero)
N = 100000; % Number of simulations
num_steps = 1000; % Number of steps (simulation for 1 second)
epsilon = 1e-9; % Small offset to avoid division by zero
k = 1 / (4 * pi * epsilon_m); % Constant for force coefficient
% Generate random numbers
rng(0); % Reset random number generator
W = randn(num_steps, N); % Random numbers from standard normal distribution
% Define position vectors (with and without DEP force)
x_dep = zeros(num_steps, N);
x_diff = zeros(num_steps, N);
x_dep(1, 🙂 = x0;
x_diff(1, 🙂 = x0;
% Perform iterations using the Euler-Maruyama method
for i = 1:num_steps-1
% With DEP force (FDEP is present)
FDEP = 4 * pi * R^3 * epsilon0 * epsilon_m * CM * (-2 * k^2 * q^2) ./ ((abs(x_dep(i, 🙂 – x0) + epsilon).^5);
x_dep(i+1, 🙂 = x_dep(i, 🙂 + (FDEP / gamma) * dt + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i, :); % sqrt(dt) added here
% Only diffusion (FDEP is absent)
x_diff(i+1, 🙂 = x_diff(i, 🙂 + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i, :); % sqrt(dt) added here
end
% Calculate means
x_mean_dep = mean(x_dep, 2);
x_mean_diff = mean(x_diff, 2);
% Plot results (y-axis scaled by 10^-6)
figure;
plot((0:num_steps-1) * dt, x_mean_dep * 1e6, ‘b’, ‘LineWidth’, 1.5); % y-axis scaled by 10^-6
hold on;
plot((0:num_steps-1) * dt, x_mean_diff * 1e6, ‘r–‘, ‘LineWidth’, 1.5); % y-axis scaled by 10^-6
xlabel(‘Time (s)’);
ylabel(‘Particle Position (μm)’); % Units updated to micrometers
title(‘Particle Positions with and without DEP Force’);
legend(‘DEP Force Present’, ‘Only Diffusion’);
grid on;Hello everyone,
I am trying to plot only the diffusion and FDEP diffusion using the formulas below. However, the FDEP diffusion plot is incorrect. I am also attaching the reference graph that it should match.
formulas:
reference graph:
my graph:
% Define parameters
epsilon0 = 8.85e-12; % F/m (Permittivity of free space)
epsilon_m = 79; % F/m (Relative permittivity of the medium)
CM = 0.5; % Clausius-Mossotti factor
k_B = 1.38e-23; % J/K (Boltzmann constant)
R = 1e-6; % m (Particle radius)
gamma = 1.88e-8; % kg/s (Friction coefficient)
q = 1e-14; % C (Charge of the particle)
dt = 1e-3; % s (Time step)
T = 300; % K (Room temperature)
x0 = 10e-6; % Initial position (slightly adjusted from zero)
N = 100000; % Number of simulations
num_steps = 1000; % Number of steps (simulation for 1 second)
epsilon = 1e-9; % Small offset to avoid division by zero
k = 1 / (4 * pi * epsilon_m); % Constant for force coefficient
% Generate random numbers
rng(0); % Reset random number generator
W = randn(num_steps, N); % Random numbers from standard normal distribution
% Define position vectors (with and without DEP force)
x_dep = zeros(num_steps, N);
x_diff = zeros(num_steps, N);
x_dep(1, 🙂 = x0;
x_diff(1, 🙂 = x0;
% Perform iterations using the Euler-Maruyama method
for i = 1:num_steps-1
% With DEP force (FDEP is present)
FDEP = 4 * pi * R^3 * epsilon0 * epsilon_m * CM * (-2 * k^2 * q^2) ./ ((abs(x_dep(i, 🙂 – x0) + epsilon).^5);
x_dep(i+1, 🙂 = x_dep(i, 🙂 + (FDEP / gamma) * dt + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i, :); % sqrt(dt) added here
% Only diffusion (FDEP is absent)
x_diff(i+1, 🙂 = x_diff(i, 🙂 + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i, :); % sqrt(dt) added here
end
% Calculate means
x_mean_dep = mean(x_dep, 2);
x_mean_diff = mean(x_diff, 2);
% Plot results (y-axis scaled by 10^-6)
figure;
plot((0:num_steps-1) * dt, x_mean_dep * 1e6, ‘b’, ‘LineWidth’, 1.5); % y-axis scaled by 10^-6
hold on;
plot((0:num_steps-1) * dt, x_mean_diff * 1e6, ‘r–‘, ‘LineWidth’, 1.5); % y-axis scaled by 10^-6
xlabel(‘Time (s)’);
ylabel(‘Particle Position (μm)’); % Units updated to micrometers
title(‘Particle Positions with and without DEP Force’);
legend(‘DEP Force Present’, ‘Only Diffusion’);
grid on; Hello everyone,
I am trying to plot only the diffusion and FDEP diffusion using the formulas below. However, the FDEP diffusion plot is incorrect. I am also attaching the reference graph that it should match.
formulas:
reference graph:
my graph:
% Define parameters
epsilon0 = 8.85e-12; % F/m (Permittivity of free space)
epsilon_m = 79; % F/m (Relative permittivity of the medium)
CM = 0.5; % Clausius-Mossotti factor
k_B = 1.38e-23; % J/K (Boltzmann constant)
R = 1e-6; % m (Particle radius)
gamma = 1.88e-8; % kg/s (Friction coefficient)
q = 1e-14; % C (Charge of the particle)
dt = 1e-3; % s (Time step)
T = 300; % K (Room temperature)
x0 = 10e-6; % Initial position (slightly adjusted from zero)
N = 100000; % Number of simulations
num_steps = 1000; % Number of steps (simulation for 1 second)
epsilon = 1e-9; % Small offset to avoid division by zero
k = 1 / (4 * pi * epsilon_m); % Constant for force coefficient
% Generate random numbers
rng(0); % Reset random number generator
W = randn(num_steps, N); % Random numbers from standard normal distribution
% Define position vectors (with and without DEP force)
x_dep = zeros(num_steps, N);
x_diff = zeros(num_steps, N);
x_dep(1, 🙂 = x0;
x_diff(1, 🙂 = x0;
% Perform iterations using the Euler-Maruyama method
for i = 1:num_steps-1
% With DEP force (FDEP is present)
FDEP = 4 * pi * R^3 * epsilon0 * epsilon_m * CM * (-2 * k^2 * q^2) ./ ((abs(x_dep(i, 🙂 – x0) + epsilon).^5);
x_dep(i+1, 🙂 = x_dep(i, 🙂 + (FDEP / gamma) * dt + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i, :); % sqrt(dt) added here
% Only diffusion (FDEP is absent)
x_diff(i+1, 🙂 = x_diff(i, 🙂 + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i, :); % sqrt(dt) added here
end
% Calculate means
x_mean_dep = mean(x_dep, 2);
x_mean_diff = mean(x_diff, 2);
% Plot results (y-axis scaled by 10^-6)
figure;
plot((0:num_steps-1) * dt, x_mean_dep * 1e6, ‘b’, ‘LineWidth’, 1.5); % y-axis scaled by 10^-6
hold on;
plot((0:num_steps-1) * dt, x_mean_diff * 1e6, ‘r–‘, ‘LineWidth’, 1.5); % y-axis scaled by 10^-6
xlabel(‘Time (s)’);
ylabel(‘Particle Position (μm)’); % Units updated to micrometers
title(‘Particle Positions with and without DEP Force’);
legend(‘DEP Force Present’, ‘Only Diffusion’);
grid on; graph, graphics, mathematics, matlab, loop MATLAB Answers — New Questions
Error in MATLAB R2021a: Example Not Found in Specified Path
when I put this line to open an example in the command section:
>> openExample(‘simscape/LithiumBatteryCellOneRCBranchEquivalentCircuitExample’)
I am getting this message:
Error using findExample (line 22)
Example "LithiumBatteryCellOneRCBranchEquivalentCircuitExample" not found in "C:Program
FilesMATLABR2021bexamplessimscapeexamples.xml".
Error in openExample (line 30)
metadata = findExample(exampleId);when I put this line to open an example in the command section:
>> openExample(‘simscape/LithiumBatteryCellOneRCBranchEquivalentCircuitExample’)
I am getting this message:
Error using findExample (line 22)
Example "LithiumBatteryCellOneRCBranchEquivalentCircuitExample" not found in "C:Program
FilesMATLABR2021bexamplessimscapeexamples.xml".
Error in openExample (line 30)
metadata = findExample(exampleId); when I put this line to open an example in the command section:
>> openExample(‘simscape/LithiumBatteryCellOneRCBranchEquivalentCircuitExample’)
I am getting this message:
Error using findExample (line 22)
Example "LithiumBatteryCellOneRCBranchEquivalentCircuitExample" not found in "C:Program
FilesMATLABR2021bexamplessimscapeexamples.xml".
Error in openExample (line 30)
metadata = findExample(exampleId); findexample, error in openexample MATLAB Answers — New Questions
How to vary the pixel size in matlab imagesc() plot?
I have data of a heated plate (2m x 2m = L x L) defined by a grid (x- and y-coordinates from 0 to 2 in same or different refinements) and a corresponding matrix containing the temperatures of the centres of the plates fields (the field dimensions are defined by the x- and y-grid).
The imagesc() plot function from matlab creates good results on equidistant grids since every field has the same length and width. However working with an non-equidistant grid requires to adjust all fields dimensions according to x-y-grid.
Is it possible to do this within the imagesc() function?
Code:
imagesc(x,y, sol)
set(gca,’YDir’,’normal’)
colormap(jet(2000)); colorbar;
xlabel(‘x[m]’)
ylabel(‘y[m]’)
x and y are vectors containing the coordinates of the grid, sol is the matrix containing the field centres temperatures.
Plot:
[Heated Plate with equidistant grid]
[Heated Plate with non-equidistant grid]
The non-equidistant grid performs a refinement on the right side of the plate since numerical error is biggest there.
The refinement is defined by
– same discretization for 0 <= x <= L/2 (same for y)
– double fine discretization for L/2 <= x <= L*3/4 (same for y)
– four times discretization for L*3/4 <= x <= L (same for y)
As you can see, the refinement’s new field dimensions are not considered which ends up ruining the visulization.
I’ve already tried different plot methods like surf or pcolor. Both are not well suited for a field-centre-oriented solution.
Thank’s for any advice.I have data of a heated plate (2m x 2m = L x L) defined by a grid (x- and y-coordinates from 0 to 2 in same or different refinements) and a corresponding matrix containing the temperatures of the centres of the plates fields (the field dimensions are defined by the x- and y-grid).
The imagesc() plot function from matlab creates good results on equidistant grids since every field has the same length and width. However working with an non-equidistant grid requires to adjust all fields dimensions according to x-y-grid.
Is it possible to do this within the imagesc() function?
Code:
imagesc(x,y, sol)
set(gca,’YDir’,’normal’)
colormap(jet(2000)); colorbar;
xlabel(‘x[m]’)
ylabel(‘y[m]’)
x and y are vectors containing the coordinates of the grid, sol is the matrix containing the field centres temperatures.
Plot:
[Heated Plate with equidistant grid]
[Heated Plate with non-equidistant grid]
The non-equidistant grid performs a refinement on the right side of the plate since numerical error is biggest there.
The refinement is defined by
– same discretization for 0 <= x <= L/2 (same for y)
– double fine discretization for L/2 <= x <= L*3/4 (same for y)
– four times discretization for L*3/4 <= x <= L (same for y)
As you can see, the refinement’s new field dimensions are not considered which ends up ruining the visulization.
I’ve already tried different plot methods like surf or pcolor. Both are not well suited for a field-centre-oriented solution.
Thank’s for any advice. I have data of a heated plate (2m x 2m = L x L) defined by a grid (x- and y-coordinates from 0 to 2 in same or different refinements) and a corresponding matrix containing the temperatures of the centres of the plates fields (the field dimensions are defined by the x- and y-grid).
The imagesc() plot function from matlab creates good results on equidistant grids since every field has the same length and width. However working with an non-equidistant grid requires to adjust all fields dimensions according to x-y-grid.
Is it possible to do this within the imagesc() function?
Code:
imagesc(x,y, sol)
set(gca,’YDir’,’normal’)
colormap(jet(2000)); colorbar;
xlabel(‘x[m]’)
ylabel(‘y[m]’)
x and y are vectors containing the coordinates of the grid, sol is the matrix containing the field centres temperatures.
Plot:
[Heated Plate with equidistant grid]
[Heated Plate with non-equidistant grid]
The non-equidistant grid performs a refinement on the right side of the plate since numerical error is biggest there.
The refinement is defined by
– same discretization for 0 <= x <= L/2 (same for y)
– double fine discretization for L/2 <= x <= L*3/4 (same for y)
– four times discretization for L*3/4 <= x <= L (same for y)
As you can see, the refinement’s new field dimensions are not considered which ends up ruining the visulization.
I’ve already tried different plot methods like surf or pcolor. Both are not well suited for a field-centre-oriented solution.
Thank’s for any advice. imagesc, plot, grid, refinement MATLAB Answers — New Questions
How to avoid the state of “S”, when using matlab in ubuntu?
When I run matlab script in ubuntu, I find that their states are "S" using "top" (touching figure). What should I do to avoid it?When I run matlab script in ubuntu, I find that their states are "S" using "top" (touching figure). What should I do to avoid it? When I run matlab script in ubuntu, I find that their states are "S" using "top" (touching figure). What should I do to avoid it? ubuntu state MATLAB Answers — New Questions
controlling Two F28379D simultaneously
Hi there,
In my project, I want to control two motors, one is the load motor and the other is MUT. I used two F28379D launchpads with two three-phase inverter. The first motor connected to the first inverter that controlled by first launchpad, and the other motor connected in the same way. The DC link, and axuiliuary supply are shared between them. The ground is connected between all of them. However, when I control the first motor (load), the ADCs for the other launchpad get lots of noises. I am not sure, whether, all these two launchpad should be supplied individualy or they have to communicate with each other. Could you please help in this matter.Hi there,
In my project, I want to control two motors, one is the load motor and the other is MUT. I used two F28379D launchpads with two three-phase inverter. The first motor connected to the first inverter that controlled by first launchpad, and the other motor connected in the same way. The DC link, and axuiliuary supply are shared between them. The ground is connected between all of them. However, when I control the first motor (load), the ADCs for the other launchpad get lots of noises. I am not sure, whether, all these two launchpad should be supplied individualy or they have to communicate with each other. Could you please help in this matter. Hi there,
In my project, I want to control two motors, one is the load motor and the other is MUT. I used two F28379D launchpads with two three-phase inverter. The first motor connected to the first inverter that controlled by first launchpad, and the other motor connected in the same way. The DC link, and axuiliuary supply are shared between them. The ground is connected between all of them. However, when I control the first motor (load), the ADCs for the other launchpad get lots of noises. I am not sure, whether, all these two launchpad should be supplied individualy or they have to communicate with each other. Could you please help in this matter. launchpad f28379d MATLAB Answers — New Questions
Sudden “Incorrect number or types of inputs or outputs for function invoke” error that I now have.
I have some code that previously worked for me with MATLAB and FRED, but is now throwing me an error. Simply put, I’m trying to open a file in FRED using a MATLAB script. This code had worked before the CrowdStrike incident, but after the incident I needed to reset my computer and reinstall all applications, and I’m not sure if having a different version of MATLAB is throwing an error for this. For reference, I’m using MATLAB version R2024a and FRED version 22.40. I tried contacting FRED support about this, but they had no idea how to fix it and suggested I look for MATLAB support.
I’m running the following lines of code:
system(‘cd c:Program FilesPhoton EngineeringFRED 22.40.4Bin & start fred.exe’); pause(1)
fredsvr = actxserver(‘FRED.Application’); pause(0.1)
freddoclist = get(fredsvr,’Documents’); pause(0.1)
set(fredsvr,’Visible’, 1);
testdoc = ‘C:UsersUSERNAMEDocumentsTESTDOCUMENT.frd’;
freddoc = invoke(freddoclist,’Open’,testdoc); pause(0.5);
When I get to the last line I get a message telling me that there is an "Incorrect number or types of inputs or outputs for function invoke", which is an error I didn’t previously see when I ran the code and it worked (a few months ago). It seems like there is an issue with the type for freddoclist, because in the workspace it’s telling me that the type is "1×1 �", which seems wrong. I’m not sure why it’s suddenly creating this type, but I’m not sure how to fix it. Any ideas? Could I be missing a MATLAB application?I have some code that previously worked for me with MATLAB and FRED, but is now throwing me an error. Simply put, I’m trying to open a file in FRED using a MATLAB script. This code had worked before the CrowdStrike incident, but after the incident I needed to reset my computer and reinstall all applications, and I’m not sure if having a different version of MATLAB is throwing an error for this. For reference, I’m using MATLAB version R2024a and FRED version 22.40. I tried contacting FRED support about this, but they had no idea how to fix it and suggested I look for MATLAB support.
I’m running the following lines of code:
system(‘cd c:Program FilesPhoton EngineeringFRED 22.40.4Bin & start fred.exe’); pause(1)
fredsvr = actxserver(‘FRED.Application’); pause(0.1)
freddoclist = get(fredsvr,’Documents’); pause(0.1)
set(fredsvr,’Visible’, 1);
testdoc = ‘C:UsersUSERNAMEDocumentsTESTDOCUMENT.frd’;
freddoc = invoke(freddoclist,’Open’,testdoc); pause(0.5);
When I get to the last line I get a message telling me that there is an "Incorrect number or types of inputs or outputs for function invoke", which is an error I didn’t previously see when I ran the code and it worked (a few months ago). It seems like there is an issue with the type for freddoclist, because in the workspace it’s telling me that the type is "1×1 �", which seems wrong. I’m not sure why it’s suddenly creating this type, but I’m not sure how to fix it. Any ideas? Could I be missing a MATLAB application? I have some code that previously worked for me with MATLAB and FRED, but is now throwing me an error. Simply put, I’m trying to open a file in FRED using a MATLAB script. This code had worked before the CrowdStrike incident, but after the incident I needed to reset my computer and reinstall all applications, and I’m not sure if having a different version of MATLAB is throwing an error for this. For reference, I’m using MATLAB version R2024a and FRED version 22.40. I tried contacting FRED support about this, but they had no idea how to fix it and suggested I look for MATLAB support.
I’m running the following lines of code:
system(‘cd c:Program FilesPhoton EngineeringFRED 22.40.4Bin & start fred.exe’); pause(1)
fredsvr = actxserver(‘FRED.Application’); pause(0.1)
freddoclist = get(fredsvr,’Documents’); pause(0.1)
set(fredsvr,’Visible’, 1);
testdoc = ‘C:UsersUSERNAMEDocumentsTESTDOCUMENT.frd’;
freddoc = invoke(freddoclist,’Open’,testdoc); pause(0.5);
When I get to the last line I get a message telling me that there is an "Incorrect number or types of inputs or outputs for function invoke", which is an error I didn’t previously see when I ran the code and it worked (a few months ago). It seems like there is an issue with the type for freddoclist, because in the workspace it’s telling me that the type is "1×1 �", which seems wrong. I’m not sure why it’s suddenly creating this type, but I’m not sure how to fix it. Any ideas? Could I be missing a MATLAB application? fred, error, invoke, type MATLAB Answers — New Questions
Filtered Historical Simulation Example Determination of Variance
I have a question on determining the variance in the Econometrics Toolbox example "Using Bootstrapping and Filtered Historical Simulation to Evaluate Market Risk". Everything is pretty straitforward till the end of the example where they use the filter function to determine the portfolio returns. Here is the command.
portfolioReturns = filter(fit, bootstrappedResiduals, …
‘Y0’, Y0, ‘Z0’, Z0, ‘V0’, V0);
I would like to obtain the conditional variance paths. Hence I used the command
[V, Y] = filter(fit, bootstrappedResiduals, …
‘Y0’, Y0, ‘Z0’, Z0, ‘V0’, V0);
Here is a plot of the first 10 horizon results for V
Here is the plot of the firt 10 horizon results for Y
The results for Y look like one would expect – plus and minus values around zero. However, the results for V should all be positive since according to the filter function for conditional variances V is the filtered variance result. When comparing the value of V to that of the variable portfolioReturns I fould them to be identical.
I can always square the value of the portfolioReturns to get the squarded returns. Is this the value of the conditional variance for the FHS simulation?I have a question on determining the variance in the Econometrics Toolbox example "Using Bootstrapping and Filtered Historical Simulation to Evaluate Market Risk". Everything is pretty straitforward till the end of the example where they use the filter function to determine the portfolio returns. Here is the command.
portfolioReturns = filter(fit, bootstrappedResiduals, …
‘Y0’, Y0, ‘Z0’, Z0, ‘V0’, V0);
I would like to obtain the conditional variance paths. Hence I used the command
[V, Y] = filter(fit, bootstrappedResiduals, …
‘Y0’, Y0, ‘Z0’, Z0, ‘V0’, V0);
Here is a plot of the first 10 horizon results for V
Here is the plot of the firt 10 horizon results for Y
The results for Y look like one would expect – plus and minus values around zero. However, the results for V should all be positive since according to the filter function for conditional variances V is the filtered variance result. When comparing the value of V to that of the variable portfolioReturns I fould them to be identical.
I can always square the value of the portfolioReturns to get the squarded returns. Is this the value of the conditional variance for the FHS simulation? I have a question on determining the variance in the Econometrics Toolbox example "Using Bootstrapping and Filtered Historical Simulation to Evaluate Market Risk". Everything is pretty straitforward till the end of the example where they use the filter function to determine the portfolio returns. Here is the command.
portfolioReturns = filter(fit, bootstrappedResiduals, …
‘Y0’, Y0, ‘Z0’, Z0, ‘V0’, V0);
I would like to obtain the conditional variance paths. Hence I used the command
[V, Y] = filter(fit, bootstrappedResiduals, …
‘Y0’, Y0, ‘Z0’, Z0, ‘V0’, V0);
Here is a plot of the first 10 horizon results for V
Here is the plot of the firt 10 horizon results for Y
The results for Y look like one would expect – plus and minus values around zero. However, the results for V should all be positive since according to the filter function for conditional variances V is the filtered variance result. When comparing the value of V to that of the variable portfolioReturns I fould them to be identical.
I can always square the value of the portfolioReturns to get the squarded returns. Is this the value of the conditional variance for the FHS simulation? conditional variance, filtered historical simulation MATLAB Answers — New Questions
limit elevation angles for a phased array on a platform/aircraft to satellite
I am able to run and modify this example: Aircraft-to-Satellite Communication for ADS-B Out – MATLAB & Simulink (mathworks.com)
except I do not know how to limit the elevation angles to the satellite such as can be done with a ground station very easily as in the ground station code below:
% Create a satellite scenario with AutoSimulate set to false
sc = satelliteScenario(‘AutoSimulate’, false);
% Define the satellite with a higher orbit
semiMajorAxis = 7000e3; % Semi-major axis in meters (higher orbit)
eccentricity = 0.001; % Eccentricity
inclination = 90; % Inclination in degrees (adjusted for closer pass)
rightAscension = 164.5; % 105 Right ascension of the ascending node in degrees (adjusted for longitude)
argumentOfPeriapsis = 0; % Argument of periapsis in degrees
trueAnomaly = 0; % True anomaly in degrees
sat = satellite(sc, semiMajorAxis, eccentricity, inclination, …
rightAscension, argumentOfPeriapsis, trueAnomaly);
% Set the elevation range
minElevation = 37; % Minimum elevation in degrees
maxElevation = 90; % Maximum elevation in degrees
% Define the ground station (representing the aircraft)
gs = groundStation(sc, ‘Name’, ‘MyAircraft’, ‘Latitude’, 40.0150,…
‘Longitude’, -105.2705, ‘Altitude’, 10000, ‘MinElevationAngle’,minElevation);
It is a built in property of the grounStation function. How can I use the above example, but limit the elevation angles like in the groundStation property?
This is some of the aircraft code:
waypoints = [… % Latitude (deg), Longitude (deg), Altitude (meters)
40.6289,-73.7738,3;…
40.6325,-73.7819,3;…
40.6341,-73.7852,44;…
40.6400,-73.7974,265;…
40.6171,-73.8618,1012;…
40.5787,-73.8585,1698;…
39.1452,-71.6083,11270;…
34.2281,-66.0839,11264;…
32.4248,-64.4389,970;…
32.3476,-64.4565,574;…
32.3320,-64.4915,452;…
32.3459,-64.5712,453;…
32.3610,-64.6612,18;…
32.3621,-64.6678,3;…
32.3639,-64.6777,3];
timeOfArrival = duration([… % time (HH:mm:ss)
"00:00:00";…
"00:00:20";…
"00:00:27";…
"00:00:43";…
"00:01:47";…
"00:02:21";…
"00:21:25";…
"01:32:39";…
"01:54:27";…
"01:55:47";…
"01:56:27";…
"01:57:48";…
"01:59:49";…
"01:59:55";…
"02:00:15"]);
trajectory = geoTrajectory(waypoints,seconds(timeOfArrival),’SampleRate’,sampleTime,…
‘SamplesPerFrame’, 10, AutoPitch=true,AutoBank=true);
minElevationAngle = 30; % degrees
aircraft = platform(sc,trajectory, Name="Aircraft", Visual3DModel="airplane.glb");
The limits I want to impose on the simulation and viewing are from elevation = 90 to 30.
Thank you for the helpI am able to run and modify this example: Aircraft-to-Satellite Communication for ADS-B Out – MATLAB & Simulink (mathworks.com)
except I do not know how to limit the elevation angles to the satellite such as can be done with a ground station very easily as in the ground station code below:
% Create a satellite scenario with AutoSimulate set to false
sc = satelliteScenario(‘AutoSimulate’, false);
% Define the satellite with a higher orbit
semiMajorAxis = 7000e3; % Semi-major axis in meters (higher orbit)
eccentricity = 0.001; % Eccentricity
inclination = 90; % Inclination in degrees (adjusted for closer pass)
rightAscension = 164.5; % 105 Right ascension of the ascending node in degrees (adjusted for longitude)
argumentOfPeriapsis = 0; % Argument of periapsis in degrees
trueAnomaly = 0; % True anomaly in degrees
sat = satellite(sc, semiMajorAxis, eccentricity, inclination, …
rightAscension, argumentOfPeriapsis, trueAnomaly);
% Set the elevation range
minElevation = 37; % Minimum elevation in degrees
maxElevation = 90; % Maximum elevation in degrees
% Define the ground station (representing the aircraft)
gs = groundStation(sc, ‘Name’, ‘MyAircraft’, ‘Latitude’, 40.0150,…
‘Longitude’, -105.2705, ‘Altitude’, 10000, ‘MinElevationAngle’,minElevation);
It is a built in property of the grounStation function. How can I use the above example, but limit the elevation angles like in the groundStation property?
This is some of the aircraft code:
waypoints = [… % Latitude (deg), Longitude (deg), Altitude (meters)
40.6289,-73.7738,3;…
40.6325,-73.7819,3;…
40.6341,-73.7852,44;…
40.6400,-73.7974,265;…
40.6171,-73.8618,1012;…
40.5787,-73.8585,1698;…
39.1452,-71.6083,11270;…
34.2281,-66.0839,11264;…
32.4248,-64.4389,970;…
32.3476,-64.4565,574;…
32.3320,-64.4915,452;…
32.3459,-64.5712,453;…
32.3610,-64.6612,18;…
32.3621,-64.6678,3;…
32.3639,-64.6777,3];
timeOfArrival = duration([… % time (HH:mm:ss)
"00:00:00";…
"00:00:20";…
"00:00:27";…
"00:00:43";…
"00:01:47";…
"00:02:21";…
"00:21:25";…
"01:32:39";…
"01:54:27";…
"01:55:47";…
"01:56:27";…
"01:57:48";…
"01:59:49";…
"01:59:55";…
"02:00:15"]);
trajectory = geoTrajectory(waypoints,seconds(timeOfArrival),’SampleRate’,sampleTime,…
‘SamplesPerFrame’, 10, AutoPitch=true,AutoBank=true);
minElevationAngle = 30; % degrees
aircraft = platform(sc,trajectory, Name="Aircraft", Visual3DModel="airplane.glb");
The limits I want to impose on the simulation and viewing are from elevation = 90 to 30.
Thank you for the help I am able to run and modify this example: Aircraft-to-Satellite Communication for ADS-B Out – MATLAB & Simulink (mathworks.com)
except I do not know how to limit the elevation angles to the satellite such as can be done with a ground station very easily as in the ground station code below:
% Create a satellite scenario with AutoSimulate set to false
sc = satelliteScenario(‘AutoSimulate’, false);
% Define the satellite with a higher orbit
semiMajorAxis = 7000e3; % Semi-major axis in meters (higher orbit)
eccentricity = 0.001; % Eccentricity
inclination = 90; % Inclination in degrees (adjusted for closer pass)
rightAscension = 164.5; % 105 Right ascension of the ascending node in degrees (adjusted for longitude)
argumentOfPeriapsis = 0; % Argument of periapsis in degrees
trueAnomaly = 0; % True anomaly in degrees
sat = satellite(sc, semiMajorAxis, eccentricity, inclination, …
rightAscension, argumentOfPeriapsis, trueAnomaly);
% Set the elevation range
minElevation = 37; % Minimum elevation in degrees
maxElevation = 90; % Maximum elevation in degrees
% Define the ground station (representing the aircraft)
gs = groundStation(sc, ‘Name’, ‘MyAircraft’, ‘Latitude’, 40.0150,…
‘Longitude’, -105.2705, ‘Altitude’, 10000, ‘MinElevationAngle’,minElevation);
It is a built in property of the grounStation function. How can I use the above example, but limit the elevation angles like in the groundStation property?
This is some of the aircraft code:
waypoints = [… % Latitude (deg), Longitude (deg), Altitude (meters)
40.6289,-73.7738,3;…
40.6325,-73.7819,3;…
40.6341,-73.7852,44;…
40.6400,-73.7974,265;…
40.6171,-73.8618,1012;…
40.5787,-73.8585,1698;…
39.1452,-71.6083,11270;…
34.2281,-66.0839,11264;…
32.4248,-64.4389,970;…
32.3476,-64.4565,574;…
32.3320,-64.4915,452;…
32.3459,-64.5712,453;…
32.3610,-64.6612,18;…
32.3621,-64.6678,3;…
32.3639,-64.6777,3];
timeOfArrival = duration([… % time (HH:mm:ss)
"00:00:00";…
"00:00:20";…
"00:00:27";…
"00:00:43";…
"00:01:47";…
"00:02:21";…
"00:21:25";…
"01:32:39";…
"01:54:27";…
"01:55:47";…
"01:56:27";…
"01:57:48";…
"01:59:49";…
"01:59:55";…
"02:00:15"]);
trajectory = geoTrajectory(waypoints,seconds(timeOfArrival),’SampleRate’,sampleTime,…
‘SamplesPerFrame’, 10, AutoPitch=true,AutoBank=true);
minElevationAngle = 30; % degrees
aircraft = platform(sc,trajectory, Name="Aircraft", Visual3DModel="airplane.glb");
The limits I want to impose on the simulation and viewing are from elevation = 90 to 30.
Thank you for the help aircraft, satellite, tracking, matlab MATLAB Answers — New Questions
How to hide console messages for a matlab executable in batch mode
I have used application compiler in Matlab2023b to pack two executable applications (e.g. App1.exe, App2.exe).
I also chose the setting "Do not display the Windows Command Shell (console) for execution" in my project file for both of them.
App2.exe will be called inside one of the function in App1.exe, which is hard coded.
I want to run App1.exe in a batch mode and i also wrote a batch file with one command to run it.
In the terminal the console messages of App1.exe don’t show up (which is expected), but the console messages of App2.exe still exist.
Actually i also tried in the batch file like "App1.exe >nul 2>&1" which makes the situation even worse, console messages of App1.exe also shou up after this adjustment. And i also already use the @echo off, but i think it was not the solution.
How can i also hide the console messages of the App2.exe?
btw. this problem didn’t show in Matlab202b before.I have used application compiler in Matlab2023b to pack two executable applications (e.g. App1.exe, App2.exe).
I also chose the setting "Do not display the Windows Command Shell (console) for execution" in my project file for both of them.
App2.exe will be called inside one of the function in App1.exe, which is hard coded.
I want to run App1.exe in a batch mode and i also wrote a batch file with one command to run it.
In the terminal the console messages of App1.exe don’t show up (which is expected), but the console messages of App2.exe still exist.
Actually i also tried in the batch file like "App1.exe >nul 2>&1" which makes the situation even worse, console messages of App1.exe also shou up after this adjustment. And i also already use the @echo off, but i think it was not the solution.
How can i also hide the console messages of the App2.exe?
btw. this problem didn’t show in Matlab202b before. I have used application compiler in Matlab2023b to pack two executable applications (e.g. App1.exe, App2.exe).
I also chose the setting "Do not display the Windows Command Shell (console) for execution" in my project file for both of them.
App2.exe will be called inside one of the function in App1.exe, which is hard coded.
I want to run App1.exe in a batch mode and i also wrote a batch file with one command to run it.
In the terminal the console messages of App1.exe don’t show up (which is expected), but the console messages of App2.exe still exist.
Actually i also tried in the batch file like "App1.exe >nul 2>&1" which makes the situation even worse, console messages of App1.exe also shou up after this adjustment. And i also already use the @echo off, but i think it was not the solution.
How can i also hide the console messages of the App2.exe?
btw. this problem didn’t show in Matlab202b before. batch, executable MATLAB Answers — New Questions
Why is the initial working folder not opening when I start MATLAB?
I set the "initial working folder" in my MATLAB Preferences so MATLAB will open my preferred folder when I use the shortcut icon. However, when I first open MATLAB on Windows, the initial working folder is not the folder I specified. How do I change the initial working folder folder that MATLAB opens?I set the "initial working folder" in my MATLAB Preferences so MATLAB will open my preferred folder when I use the shortcut icon. However, when I first open MATLAB on Windows, the initial working folder is not the folder I specified. How do I change the initial working folder folder that MATLAB opens? I set the "initial working folder" in my MATLAB Preferences so MATLAB will open my preferred folder when I use the shortcut icon. However, when I first open MATLAB on Windows, the initial working folder is not the folder I specified. How do I change the initial working folder folder that MATLAB opens? initial, working, folder, preferences, shortcut MATLAB Answers — New Questions