Author: PuTI
disable “Configure Arduino” Dialog in Standalone App
Hello everyone,
I have created an app with the MATLAB App Designer that communicates with an Arduino Nano. Everything works fine in the App Designer. After I have created a stand-alone executable file from the app, the “Configure Arduino” dialog box always appears when connecting the Arduino. If i select everything it works, but i dont want to type it in after every restart.
Can this be deactivated?
Here is my code of the connection setup.
app.ArduinoObject = arduino(app.config.COMPort, ‘Nano3’, ‘AnalogReferenceMode’, ‘internal’, ‘AnalogReference’, 1.1);
I also tried the following, but unfortunately it didn’t work.
app.ArduinoObject = arduino(app.config.COMPort,’Nano3′,’ArduinoCLIPath’,’C:Program FilesTopcaseTesterapplicationArduino CLI’,’AnalogReferenceMode’,’internal’, ‘AnalogReference’,1.1);
My CLI path is C:Program FilesTopcaseTesterapplicationArduino CLI
Thanks for you help!Hello everyone,
I have created an app with the MATLAB App Designer that communicates with an Arduino Nano. Everything works fine in the App Designer. After I have created a stand-alone executable file from the app, the “Configure Arduino” dialog box always appears when connecting the Arduino. If i select everything it works, but i dont want to type it in after every restart.
Can this be deactivated?
Here is my code of the connection setup.
app.ArduinoObject = arduino(app.config.COMPort, ‘Nano3’, ‘AnalogReferenceMode’, ‘internal’, ‘AnalogReference’, 1.1);
I also tried the following, but unfortunately it didn’t work.
app.ArduinoObject = arduino(app.config.COMPort,’Nano3′,’ArduinoCLIPath’,’C:Program FilesTopcaseTesterapplicationArduino CLI’,’AnalogReferenceMode’,’internal’, ‘AnalogReference’,1.1);
My CLI path is C:Program FilesTopcaseTesterapplicationArduino CLI
Thanks for you help! Hello everyone,
I have created an app with the MATLAB App Designer that communicates with an Arduino Nano. Everything works fine in the App Designer. After I have created a stand-alone executable file from the app, the “Configure Arduino” dialog box always appears when connecting the Arduino. If i select everything it works, but i dont want to type it in after every restart.
Can this be deactivated?
Here is my code of the connection setup.
app.ArduinoObject = arduino(app.config.COMPort, ‘Nano3’, ‘AnalogReferenceMode’, ‘internal’, ‘AnalogReference’, 1.1);
I also tried the following, but unfortunately it didn’t work.
app.ArduinoObject = arduino(app.config.COMPort,’Nano3′,’ArduinoCLIPath’,’C:Program FilesTopcaseTesterapplicationArduino CLI’,’AnalogReferenceMode’,’internal’, ‘AnalogReference’,1.1);
My CLI path is C:Program FilesTopcaseTesterapplicationArduino CLI
Thanks for you help! standalone MATLAB Answers — New Questions
Write a function that receives an input argument of a number of kilometers (km) and will output the conversions into both miles (mi) and US nautical miles (n.m.). Use the conversions: 1 km = 0.621 mi and 1 km = 0.540 n.m.
Write a function that receives an input argument of a number of kilometers (km) and will output the conversions into both miles (mi) and US nautical miles (n.m.). Use the conversions: 1 km = 0.621 mi and 1 km = 0.540 n.m.Write a function that receives an input argument of a number of kilometers (km) and will output the conversions into both miles (mi) and US nautical miles (n.m.). Use the conversions: 1 km = 0.621 mi and 1 km = 0.540 n.m. Write a function that receives an input argument of a number of kilometers (km) and will output the conversions into both miles (mi) and US nautical miles (n.m.). Use the conversions: 1 km = 0.621 mi and 1 km = 0.540 n.m. functio MATLAB Answers — New Questions
FFT Analysis Tool in Powergui
I want to use the powergui block for fft analysis.I am measuring three phase signals using a current measurement block connected to a scope. After running the simulation , the powergui’s fft analysis does not display anything and the name and input fields display ‘-Empty-‘.
Can anyone please suggest a solution to this problem, urgently.I want to use the powergui block for fft analysis.I am measuring three phase signals using a current measurement block connected to a scope. After running the simulation , the powergui’s fft analysis does not display anything and the name and input fields display ‘-Empty-‘.
Can anyone please suggest a solution to this problem, urgently. I want to use the powergui block for fft analysis.I am measuring three phase signals using a current measurement block connected to a scope. After running the simulation , the powergui’s fft analysis does not display anything and the name and input fields display ‘-Empty-‘.
Can anyone please suggest a solution to this problem, urgently. fft analysis, powergui MATLAB Answers — New Questions
PID controller for m file
Hi
I have system (NOT transfer function) that gives vector numbers. Also, I have specific desire output. I would like to add PID controller as a control to reduce the error between the desire and output based on specific variable (d). Can you please help me with this situation
For example,
A=[0 3 12.5 12.8 11.8 12.3 11.9 12]; % practical data
d=1; % variable
OUT=A*d; % output
Vdesire=12; % desire outputHi
I have system (NOT transfer function) that gives vector numbers. Also, I have specific desire output. I would like to add PID controller as a control to reduce the error between the desire and output based on specific variable (d). Can you please help me with this situation
For example,
A=[0 3 12.5 12.8 11.8 12.3 11.9 12]; % practical data
d=1; % variable
OUT=A*d; % output
Vdesire=12; % desire output Hi
I have system (NOT transfer function) that gives vector numbers. Also, I have specific desire output. I would like to add PID controller as a control to reduce the error between the desire and output based on specific variable (d). Can you please help me with this situation
For example,
A=[0 3 12.5 12.8 11.8 12.3 11.9 12]; % practical data
d=1; % variable
OUT=A*d; % output
Vdesire=12; % desire output pid, controller MATLAB Answers — New Questions
Simulink:Aerospace 6 DoF Model Singularity with High Altitudes
I am using the "Simple Variable Mass 6DoF ECEF (Quaternion)" for a rocket model and everything is working great and as expected, except when the altitude (h) exceeds a certain value (around 180,000 meters). I end up getting an error:
"Derivative input 1 of ‘LV01/Simple Variable Mass 6DoF ECEF (Quaternion)/Calculate Velocity in Body Axes/ub,vb,wb’ at time 0 is Inf or NaN. Stopping simulation. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)."
View post on imgur.com
Any ideas? I’m kind of stuck since I need to get up to around 500 km. I couldn’t find anything that discussed limitations on with the model. Maybe there is another more appropriate model to use?I am using the "Simple Variable Mass 6DoF ECEF (Quaternion)" for a rocket model and everything is working great and as expected, except when the altitude (h) exceeds a certain value (around 180,000 meters). I end up getting an error:
"Derivative input 1 of ‘LV01/Simple Variable Mass 6DoF ECEF (Quaternion)/Calculate Velocity in Body Axes/ub,vb,wb’ at time 0 is Inf or NaN. Stopping simulation. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)."
View post on imgur.com
Any ideas? I’m kind of stuck since I need to get up to around 500 km. I couldn’t find anything that discussed limitations on with the model. Maybe there is another more appropriate model to use? I am using the "Simple Variable Mass 6DoF ECEF (Quaternion)" for a rocket model and everything is working great and as expected, except when the altitude (h) exceeds a certain value (around 180,000 meters). I end up getting an error:
"Derivative input 1 of ‘LV01/Simple Variable Mass 6DoF ECEF (Quaternion)/Calculate Velocity in Body Axes/ub,vb,wb’ at time 0 is Inf or NaN. Stopping simulation. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)."
View post on imgur.com
Any ideas? I’m kind of stuck since I need to get up to around 500 km. I couldn’t find anything that discussed limitations on with the model. Maybe there is another more appropriate model to use? simulink MATLAB Answers — New Questions
How can I edit the Industrial Robot Models in Simscape, MATLAB Example by Steve Miller?
Hello All
I am using the Industrial Robot Models in Simscape by Steve Miller, and need help editing a robot model. Specifically, I would like to modify link dimensions, add joints, or adjust dynamics. Any guidance or tips would be greatly appreciated!
Thank you in advance
ChintanHello All
I am using the Industrial Robot Models in Simscape by Steve Miller, and need help editing a robot model. Specifically, I would like to modify link dimensions, add joints, or adjust dynamics. Any guidance or tips would be greatly appreciated!
Thank you in advance
Chintan Hello All
I am using the Industrial Robot Models in Simscape by Steve Miller, and need help editing a robot model. Specifically, I would like to modify link dimensions, add joints, or adjust dynamics. Any guidance or tips would be greatly appreciated!
Thank you in advance
Chintan industrial robot models, robotic manipulator, 6-dof pick and place manipulator, simscape model MATLAB Answers — New Questions
How do I change the names of the input and output in the Fuzzy Logic Designer for the simulation part, specifically in the system validation? I have already circled in red pen
Post Content Post Content system validation, fuzzylogic, fuzzylogicdesigner MATLAB Answers — New Questions
Problem loading variables to Simulink
I have a Simulink model that uses variables set in Matlab code. However it keeps giving me the same error.
I have this function
function y = tclabsim(t, x0, u, p)
% Ensure input sizes match
if length(t) ~= length(u)
error(‘Time vector t and input profile u must have the same length.’);
end
% Extract parameters from p
U = p(1); % Heat transfer coefficient
alpha = p(2); % Ambient heat loss parameter
tau = p(3); % Time constant
% Initial conditions
x0_T = x0; % Initial temperature
% Ensure t and u are column vectors
t = t(:);
u = u(:);
% Create input matrices
inputMatrix = [t, u];
U_matrix = [0, U];
alpha_matrix = [0, alpha];
tau_matrix = [0, tau];
x0_T_matrix = [0, x0_T];
% Set simulation stop time
stopTime = t(end);
% Assign all required variables to base workspace
assignin(‘base’, ‘x0_T’, x0_T_matrix);
assignin(‘base’, ‘U’, U_matrix);
assignin(‘base’, ‘alpha’, alpha_matrix);
assignin(‘base’, ‘tau’, tau_matrix);
assignin(‘base’, ‘inputMatrix’, inputMatrix);
% Run the Simulink model
simOut = sim(‘SingleHeaterTCLab_1.slx’, ‘SrcWorkspace’, ‘current’, …
‘StopTime’, num2str(stopTime));
% Extract the output from the simulation
y = simOut.Ts; % Sensor temperature output
end
And I call the function like this
% Time vector (0 to 1000 seconds with 1-second steps)
t = (0:999)’; % Make sure t is a column vector
% Initial temperature (20°C)
x0 = 20;
% Heater input (step response: 50% heater power after 100s)
u = zeros(size(t));
u(t >= 100) = 50;
% Parameters [U, alpha, tau]
p = [0.01, 0.01, 200]; % Example values for U, alpha, tau
% Simulate the system
y = tclabsim(t, x0, u, p);
However, every time I try to run it gives the same error.
I have tried to load them as simple double and I have also tried a matrix with t on the first column and the same value in every line of the second column. They also gave the same error.
The block in Simulink has these properties. And I have also tried to change the sample time to -1.
This is the entire simulink if it helps.
How can I fix it?
Thank youI have a Simulink model that uses variables set in Matlab code. However it keeps giving me the same error.
I have this function
function y = tclabsim(t, x0, u, p)
% Ensure input sizes match
if length(t) ~= length(u)
error(‘Time vector t and input profile u must have the same length.’);
end
% Extract parameters from p
U = p(1); % Heat transfer coefficient
alpha = p(2); % Ambient heat loss parameter
tau = p(3); % Time constant
% Initial conditions
x0_T = x0; % Initial temperature
% Ensure t and u are column vectors
t = t(:);
u = u(:);
% Create input matrices
inputMatrix = [t, u];
U_matrix = [0, U];
alpha_matrix = [0, alpha];
tau_matrix = [0, tau];
x0_T_matrix = [0, x0_T];
% Set simulation stop time
stopTime = t(end);
% Assign all required variables to base workspace
assignin(‘base’, ‘x0_T’, x0_T_matrix);
assignin(‘base’, ‘U’, U_matrix);
assignin(‘base’, ‘alpha’, alpha_matrix);
assignin(‘base’, ‘tau’, tau_matrix);
assignin(‘base’, ‘inputMatrix’, inputMatrix);
% Run the Simulink model
simOut = sim(‘SingleHeaterTCLab_1.slx’, ‘SrcWorkspace’, ‘current’, …
‘StopTime’, num2str(stopTime));
% Extract the output from the simulation
y = simOut.Ts; % Sensor temperature output
end
And I call the function like this
% Time vector (0 to 1000 seconds with 1-second steps)
t = (0:999)’; % Make sure t is a column vector
% Initial temperature (20°C)
x0 = 20;
% Heater input (step response: 50% heater power after 100s)
u = zeros(size(t));
u(t >= 100) = 50;
% Parameters [U, alpha, tau]
p = [0.01, 0.01, 200]; % Example values for U, alpha, tau
% Simulate the system
y = tclabsim(t, x0, u, p);
However, every time I try to run it gives the same error.
I have tried to load them as simple double and I have also tried a matrix with t on the first column and the same value in every line of the second column. They also gave the same error.
The block in Simulink has these properties. And I have also tried to change the sample time to -1.
This is the entire simulink if it helps.
How can I fix it?
Thank you I have a Simulink model that uses variables set in Matlab code. However it keeps giving me the same error.
I have this function
function y = tclabsim(t, x0, u, p)
% Ensure input sizes match
if length(t) ~= length(u)
error(‘Time vector t and input profile u must have the same length.’);
end
% Extract parameters from p
U = p(1); % Heat transfer coefficient
alpha = p(2); % Ambient heat loss parameter
tau = p(3); % Time constant
% Initial conditions
x0_T = x0; % Initial temperature
% Ensure t and u are column vectors
t = t(:);
u = u(:);
% Create input matrices
inputMatrix = [t, u];
U_matrix = [0, U];
alpha_matrix = [0, alpha];
tau_matrix = [0, tau];
x0_T_matrix = [0, x0_T];
% Set simulation stop time
stopTime = t(end);
% Assign all required variables to base workspace
assignin(‘base’, ‘x0_T’, x0_T_matrix);
assignin(‘base’, ‘U’, U_matrix);
assignin(‘base’, ‘alpha’, alpha_matrix);
assignin(‘base’, ‘tau’, tau_matrix);
assignin(‘base’, ‘inputMatrix’, inputMatrix);
% Run the Simulink model
simOut = sim(‘SingleHeaterTCLab_1.slx’, ‘SrcWorkspace’, ‘current’, …
‘StopTime’, num2str(stopTime));
% Extract the output from the simulation
y = simOut.Ts; % Sensor temperature output
end
And I call the function like this
% Time vector (0 to 1000 seconds with 1-second steps)
t = (0:999)’; % Make sure t is a column vector
% Initial temperature (20°C)
x0 = 20;
% Heater input (step response: 50% heater power after 100s)
u = zeros(size(t));
u(t >= 100) = 50;
% Parameters [U, alpha, tau]
p = [0.01, 0.01, 200]; % Example values for U, alpha, tau
% Simulate the system
y = tclabsim(t, x0, u, p);
However, every time I try to run it gives the same error.
I have tried to load them as simple double and I have also tried a matrix with t on the first column and the same value in every line of the second column. They also gave the same error.
The block in Simulink has these properties. And I have also tried to change the sample time to -1.
This is the entire simulink if it helps.
How can I fix it?
Thank you simulink, matlab, workspace MATLAB Answers — New Questions
I want to get an image info with imfinfo
Please help me…How to use imfinfo when I use handles.Img = Img to get the Image file?Please help me…How to use imfinfo when I use handles.Img = Img to get the Image file? Please help me…How to use imfinfo when I use handles.Img = Img to get the Image file? imfinfo, image processing, lsb MATLAB Answers — New Questions
MATLAB Plotting: xticks Error and Legend Repetition Issue?
I’m working on a MATLAB project where I need to analyze and plot the relative difference in coverage area for different QAM orders and semi-angles (ϕ_1/2) for a wireless communication simulation. I’ve encountered two persistent errors:
Error using xticks (line 33)
Value must be a numeric vector whose values increase.
Error in untitled11 (line 84)
xticks(QAM_order); % Ensure QAM_order is numeric and sorted
and One more thing is the legend has multiples 15, 30, 45 as shown in the below image
Expected Outcome:
Correct x-axis ticks: The x-axis should display the QAM orders {16,32,64,128,256,512,1024}.
Unique legend entries: Each angle (ϕ1/2 =15 ∘ ,30 ∘ ,45 ∘) should appear exactly once in the legend.
Any assistance, please?
here is below my code:
clear variables;
close all;
clc;
%% Define angles and file paths
angles = [15, 30, 45]; % Define angles
angleLabels = ["15°", "30°", "45°"]; % Labels for legends
numAngles = length(angles);
% Load data from the first angle to initialize QAM_order
load([‘workspace_withBeamsteering_’, num2str(angles(1)), ‘.mat’]); % Replace with actual file path
QAM_order = unique(sort(double(QAM_order(:)))); % Ensure QAM_order is numeric, sorted, and unique
numQAMOrders = length(QAM_order); % Dynamically determine number of QAM orders
% Debug: Display QAM_order
disp(‘QAM_order:’);
disp(QAM_order);
% Initialize storage for results
coverageRelativeDiffAll = zeros(numAngles, numQAMOrders); % Initialize storage for relative differences
%% Process data for each angle
for a = 1:numAngles
angle = angles(a);
% Load data for the perfect beamsteering case
load([‘workspace_withBeamsteering_’, num2str(angle), ‘.mat’]); % Replace with actual file path
berMapPerfectCase = berMap;
coveragePerfectCase = coverage;
% Load data for the beamsteering with misalignment case
load([‘workspace_’, num2str(angle), ‘_withBeamsteering_Misalignment.mat’]); % Replace with actual file path
% Compute relative difference in coverage area for this angle
for q = 1:numQAMOrders
% Ensure correct size for coverageMap
[N_directions, N_rx, N_ry] = size(berMap{q});
coverageMap = zeros(N_rx, N_ry);
% Accumulate coverage for all directions
for i_n = 1:N_directions
currentCoverage = squeeze(berMap{q}(i_n, :, :)) < 3.8e-3;
coverageMap = coverageMap + double(currentCoverage);
end
% Compute the intersection map (points covered in all directions)
intersectionMap = (coverageMap == N_directions);
% Calculate misalignment coverage
coverageMisalignment = sum(intersectionMap(:)) * (L * W) / numel(intersectionMap);
% Compute relative difference
coverageRelativeDiffAll(a, q) = (coverageMisalignment – coveragePerfectCase(q)) / coveragePerfectCase(q);
end
end
%% Plot Relative Difference in Coverage Area for All Angles
figure;
hold on;
% Define markers and colors for each angle
markers = {‘-o’, ‘-s’, ‘-^’}; % Different markers for angles
colors = {‘b’, ‘r’, ‘g’}; % Blue, Red, Green
for a = 1:numAngles
plot(QAM_order, coverageRelativeDiffAll(a, 🙂 * 100, …
markers{a}, ‘LineWidth’, 1.5, ‘Color’, colors{a}, …
‘DisplayName’, [‘$phi_{1/2} = $ ‘, num2str(angles(a)), ‘$^circ$’]);
end
hold off;
% Add labels, title, and legend
xlabel(‘QAM Order (M)’, ‘FontSize’, 12, ‘FontWeight’, ‘bold’);
ylabel(‘Relative Difference in Coverage Area (%)’, ‘FontSize’, 12, ‘FontWeight’, ‘bold’);
title(‘Relative Difference in Coverage Area vs QAM Order’, ‘FontSize’, 12, ‘FontWeight’, ‘bold’);
legend(‘Location’, ‘northeast’, ‘FontSize’, 11, ‘Interpreter’, ‘latex’);
% Set grid and font appearance
grid on;
set(gca, ‘FontSize’, 11, ‘FontWeight’, ‘bold’);
% Set x-axis to show QAM order directly
xticks(QAM_order); % Ensure QAM_order is numeric and sorted
xticklabels(string(QAM_order)); % Display QAM order values directly
% Set x-axis limits to start at the smallest QAM order
xlim([min(QAM_order), max(QAM_order)]); % Start from the minimum and go to the maximum QAM orderI’m working on a MATLAB project where I need to analyze and plot the relative difference in coverage area for different QAM orders and semi-angles (ϕ_1/2) for a wireless communication simulation. I’ve encountered two persistent errors:
Error using xticks (line 33)
Value must be a numeric vector whose values increase.
Error in untitled11 (line 84)
xticks(QAM_order); % Ensure QAM_order is numeric and sorted
and One more thing is the legend has multiples 15, 30, 45 as shown in the below image
Expected Outcome:
Correct x-axis ticks: The x-axis should display the QAM orders {16,32,64,128,256,512,1024}.
Unique legend entries: Each angle (ϕ1/2 =15 ∘ ,30 ∘ ,45 ∘) should appear exactly once in the legend.
Any assistance, please?
here is below my code:
clear variables;
close all;
clc;
%% Define angles and file paths
angles = [15, 30, 45]; % Define angles
angleLabels = ["15°", "30°", "45°"]; % Labels for legends
numAngles = length(angles);
% Load data from the first angle to initialize QAM_order
load([‘workspace_withBeamsteering_’, num2str(angles(1)), ‘.mat’]); % Replace with actual file path
QAM_order = unique(sort(double(QAM_order(:)))); % Ensure QAM_order is numeric, sorted, and unique
numQAMOrders = length(QAM_order); % Dynamically determine number of QAM orders
% Debug: Display QAM_order
disp(‘QAM_order:’);
disp(QAM_order);
% Initialize storage for results
coverageRelativeDiffAll = zeros(numAngles, numQAMOrders); % Initialize storage for relative differences
%% Process data for each angle
for a = 1:numAngles
angle = angles(a);
% Load data for the perfect beamsteering case
load([‘workspace_withBeamsteering_’, num2str(angle), ‘.mat’]); % Replace with actual file path
berMapPerfectCase = berMap;
coveragePerfectCase = coverage;
% Load data for the beamsteering with misalignment case
load([‘workspace_’, num2str(angle), ‘_withBeamsteering_Misalignment.mat’]); % Replace with actual file path
% Compute relative difference in coverage area for this angle
for q = 1:numQAMOrders
% Ensure correct size for coverageMap
[N_directions, N_rx, N_ry] = size(berMap{q});
coverageMap = zeros(N_rx, N_ry);
% Accumulate coverage for all directions
for i_n = 1:N_directions
currentCoverage = squeeze(berMap{q}(i_n, :, :)) < 3.8e-3;
coverageMap = coverageMap + double(currentCoverage);
end
% Compute the intersection map (points covered in all directions)
intersectionMap = (coverageMap == N_directions);
% Calculate misalignment coverage
coverageMisalignment = sum(intersectionMap(:)) * (L * W) / numel(intersectionMap);
% Compute relative difference
coverageRelativeDiffAll(a, q) = (coverageMisalignment – coveragePerfectCase(q)) / coveragePerfectCase(q);
end
end
%% Plot Relative Difference in Coverage Area for All Angles
figure;
hold on;
% Define markers and colors for each angle
markers = {‘-o’, ‘-s’, ‘-^’}; % Different markers for angles
colors = {‘b’, ‘r’, ‘g’}; % Blue, Red, Green
for a = 1:numAngles
plot(QAM_order, coverageRelativeDiffAll(a, 🙂 * 100, …
markers{a}, ‘LineWidth’, 1.5, ‘Color’, colors{a}, …
‘DisplayName’, [‘$phi_{1/2} = $ ‘, num2str(angles(a)), ‘$^circ$’]);
end
hold off;
% Add labels, title, and legend
xlabel(‘QAM Order (M)’, ‘FontSize’, 12, ‘FontWeight’, ‘bold’);
ylabel(‘Relative Difference in Coverage Area (%)’, ‘FontSize’, 12, ‘FontWeight’, ‘bold’);
title(‘Relative Difference in Coverage Area vs QAM Order’, ‘FontSize’, 12, ‘FontWeight’, ‘bold’);
legend(‘Location’, ‘northeast’, ‘FontSize’, 11, ‘Interpreter’, ‘latex’);
% Set grid and font appearance
grid on;
set(gca, ‘FontSize’, 11, ‘FontWeight’, ‘bold’);
% Set x-axis to show QAM order directly
xticks(QAM_order); % Ensure QAM_order is numeric and sorted
xticklabels(string(QAM_order)); % Display QAM order values directly
% Set x-axis limits to start at the smallest QAM order
xlim([min(QAM_order), max(QAM_order)]); % Start from the minimum and go to the maximum QAM order I’m working on a MATLAB project where I need to analyze and plot the relative difference in coverage area for different QAM orders and semi-angles (ϕ_1/2) for a wireless communication simulation. I’ve encountered two persistent errors:
Error using xticks (line 33)
Value must be a numeric vector whose values increase.
Error in untitled11 (line 84)
xticks(QAM_order); % Ensure QAM_order is numeric and sorted
and One more thing is the legend has multiples 15, 30, 45 as shown in the below image
Expected Outcome:
Correct x-axis ticks: The x-axis should display the QAM orders {16,32,64,128,256,512,1024}.
Unique legend entries: Each angle (ϕ1/2 =15 ∘ ,30 ∘ ,45 ∘) should appear exactly once in the legend.
Any assistance, please?
here is below my code:
clear variables;
close all;
clc;
%% Define angles and file paths
angles = [15, 30, 45]; % Define angles
angleLabels = ["15°", "30°", "45°"]; % Labels for legends
numAngles = length(angles);
% Load data from the first angle to initialize QAM_order
load([‘workspace_withBeamsteering_’, num2str(angles(1)), ‘.mat’]); % Replace with actual file path
QAM_order = unique(sort(double(QAM_order(:)))); % Ensure QAM_order is numeric, sorted, and unique
numQAMOrders = length(QAM_order); % Dynamically determine number of QAM orders
% Debug: Display QAM_order
disp(‘QAM_order:’);
disp(QAM_order);
% Initialize storage for results
coverageRelativeDiffAll = zeros(numAngles, numQAMOrders); % Initialize storage for relative differences
%% Process data for each angle
for a = 1:numAngles
angle = angles(a);
% Load data for the perfect beamsteering case
load([‘workspace_withBeamsteering_’, num2str(angle), ‘.mat’]); % Replace with actual file path
berMapPerfectCase = berMap;
coveragePerfectCase = coverage;
% Load data for the beamsteering with misalignment case
load([‘workspace_’, num2str(angle), ‘_withBeamsteering_Misalignment.mat’]); % Replace with actual file path
% Compute relative difference in coverage area for this angle
for q = 1:numQAMOrders
% Ensure correct size for coverageMap
[N_directions, N_rx, N_ry] = size(berMap{q});
coverageMap = zeros(N_rx, N_ry);
% Accumulate coverage for all directions
for i_n = 1:N_directions
currentCoverage = squeeze(berMap{q}(i_n, :, :)) < 3.8e-3;
coverageMap = coverageMap + double(currentCoverage);
end
% Compute the intersection map (points covered in all directions)
intersectionMap = (coverageMap == N_directions);
% Calculate misalignment coverage
coverageMisalignment = sum(intersectionMap(:)) * (L * W) / numel(intersectionMap);
% Compute relative difference
coverageRelativeDiffAll(a, q) = (coverageMisalignment – coveragePerfectCase(q)) / coveragePerfectCase(q);
end
end
%% Plot Relative Difference in Coverage Area for All Angles
figure;
hold on;
% Define markers and colors for each angle
markers = {‘-o’, ‘-s’, ‘-^’}; % Different markers for angles
colors = {‘b’, ‘r’, ‘g’}; % Blue, Red, Green
for a = 1:numAngles
plot(QAM_order, coverageRelativeDiffAll(a, 🙂 * 100, …
markers{a}, ‘LineWidth’, 1.5, ‘Color’, colors{a}, …
‘DisplayName’, [‘$phi_{1/2} = $ ‘, num2str(angles(a)), ‘$^circ$’]);
end
hold off;
% Add labels, title, and legend
xlabel(‘QAM Order (M)’, ‘FontSize’, 12, ‘FontWeight’, ‘bold’);
ylabel(‘Relative Difference in Coverage Area (%)’, ‘FontSize’, 12, ‘FontWeight’, ‘bold’);
title(‘Relative Difference in Coverage Area vs QAM Order’, ‘FontSize’, 12, ‘FontWeight’, ‘bold’);
legend(‘Location’, ‘northeast’, ‘FontSize’, 11, ‘Interpreter’, ‘latex’);
% Set grid and font appearance
grid on;
set(gca, ‘FontSize’, 11, ‘FontWeight’, ‘bold’);
% Set x-axis to show QAM order directly
xticks(QAM_order); % Ensure QAM_order is numeric and sorted
xticklabels(string(QAM_order)); % Display QAM order values directly
% Set x-axis limits to start at the smallest QAM order
xlim([min(QAM_order), max(QAM_order)]); % Start from the minimum and go to the maximum QAM order plot, xticks, legend MATLAB Answers — New Questions
Model Reference Control Bug
When I use the Model Reference Controller in the Simulink Neural Network toolbox, (with Size of Hidden Layer: 10, No. Delayed Reference Inputs: 100, No. Delayed Controller Outputs: 1, No. Delayed Plant Outputs: 100, Max. Reference Value: 100, Min. Reference Value = -100, Max. Interval Value: 2, Min. Interval Value: 0.1, Controller Training Samples: 1000), I get the following error:
??? Error using ==> mldivide
Matrix dimensions must agree.
Error in ==> nnmodref at 482
step_size=ceil(max([min([(rand*(max_r_int-min_r_int)+min_r_int) max_r_int])
min_r_int])/Ts);
Error in ==> nncontrolutil at 20
feval(command,varargin{:});
??? Error while evaluating uicontrol Callback
Ts appears to be equal to [], since it obtains its value from arg1 that is passed to nnmodref, and there is no argument passed. Is there a fix for this?
Thanks,
Maria
I am running MATLAB Version 7.12.0.635 (R2011a), Neural Network Toolbox Version 7.0.1 (R2011a), and Simulink Version 7.7 (R2011a)When I use the Model Reference Controller in the Simulink Neural Network toolbox, (with Size of Hidden Layer: 10, No. Delayed Reference Inputs: 100, No. Delayed Controller Outputs: 1, No. Delayed Plant Outputs: 100, Max. Reference Value: 100, Min. Reference Value = -100, Max. Interval Value: 2, Min. Interval Value: 0.1, Controller Training Samples: 1000), I get the following error:
??? Error using ==> mldivide
Matrix dimensions must agree.
Error in ==> nnmodref at 482
step_size=ceil(max([min([(rand*(max_r_int-min_r_int)+min_r_int) max_r_int])
min_r_int])/Ts);
Error in ==> nncontrolutil at 20
feval(command,varargin{:});
??? Error while evaluating uicontrol Callback
Ts appears to be equal to [], since it obtains its value from arg1 that is passed to nnmodref, and there is no argument passed. Is there a fix for this?
Thanks,
Maria
I am running MATLAB Version 7.12.0.635 (R2011a), Neural Network Toolbox Version 7.0.1 (R2011a), and Simulink Version 7.7 (R2011a) When I use the Model Reference Controller in the Simulink Neural Network toolbox, (with Size of Hidden Layer: 10, No. Delayed Reference Inputs: 100, No. Delayed Controller Outputs: 1, No. Delayed Plant Outputs: 100, Max. Reference Value: 100, Min. Reference Value = -100, Max. Interval Value: 2, Min. Interval Value: 0.1, Controller Training Samples: 1000), I get the following error:
??? Error using ==> mldivide
Matrix dimensions must agree.
Error in ==> nnmodref at 482
step_size=ceil(max([min([(rand*(max_r_int-min_r_int)+min_r_int) max_r_int])
min_r_int])/Ts);
Error in ==> nncontrolutil at 20
feval(command,varargin{:});
??? Error while evaluating uicontrol Callback
Ts appears to be equal to [], since it obtains its value from arg1 that is passed to nnmodref, and there is no argument passed. Is there a fix for this?
Thanks,
Maria
I am running MATLAB Version 7.12.0.635 (R2011a), Neural Network Toolbox Version 7.0.1 (R2011a), and Simulink Version 7.7 (R2011a) neural network, neural networks, control, model predictive controller MATLAB Answers — New Questions
Is there a typo in the documentation for n4sid?
The documentation for n4sid contains the following code snippet. I believe the line u(k-1) = -K*y(k-2) + w(k); should read u(k-2) = -K*y(k-2) + w(k);.
N = 1000;
K = 0.5;
rng(‘default’);
w = randn(N,1);
z = zeros(N,1);
u = zeros(N,1);
y = zeros(N,1);
e = randn(N,1);
v = filter([1 0.5],[1 1.5 0.7],e);
for k = 3:N
u(k-1) = -K*y(k-2) + w(k);
u(k-1) = -K*y(k-1) + w(k);
z(k) = 1.5*z(k-1) – 0.7*z(k-2) + u(k-1) + 0.5*u(k-2);
y(k) = z(k) + 0.8*v(k);
end
dat = iddata(y, u, 1);The documentation for n4sid contains the following code snippet. I believe the line u(k-1) = -K*y(k-2) + w(k); should read u(k-2) = -K*y(k-2) + w(k);.
N = 1000;
K = 0.5;
rng(‘default’);
w = randn(N,1);
z = zeros(N,1);
u = zeros(N,1);
y = zeros(N,1);
e = randn(N,1);
v = filter([1 0.5],[1 1.5 0.7],e);
for k = 3:N
u(k-1) = -K*y(k-2) + w(k);
u(k-1) = -K*y(k-1) + w(k);
z(k) = 1.5*z(k-1) – 0.7*z(k-2) + u(k-1) + 0.5*u(k-2);
y(k) = z(k) + 0.8*v(k);
end
dat = iddata(y, u, 1); The documentation for n4sid contains the following code snippet. I believe the line u(k-1) = -K*y(k-2) + w(k); should read u(k-2) = -K*y(k-2) + w(k);.
N = 1000;
K = 0.5;
rng(‘default’);
w = randn(N,1);
z = zeros(N,1);
u = zeros(N,1);
y = zeros(N,1);
e = randn(N,1);
v = filter([1 0.5],[1 1.5 0.7],e);
for k = 3:N
u(k-1) = -K*y(k-2) + w(k);
u(k-1) = -K*y(k-1) + w(k);
z(k) = 1.5*z(k-1) – 0.7*z(k-2) + u(k-1) + 0.5*u(k-2);
y(k) = z(k) + 0.8*v(k);
end
dat = iddata(y, u, 1); documentation MATLAB Answers — New Questions
Using CPLEX with MATLAB newest version
Hello, I am trying to figure out how to use a cplex function and connect it to MATLAB. The code that I have in MATLAB calls a cplexmiqp function.
I am going to use the MIQPS_MATPOWER Mixed Integer Quadratic Program Solver for MATPOWER, from this page https://matpower.org/docs/ref/matpower6.0/miqps_cplex.html.
Now my question is, how would I connect IBM cplex to MATLAB to call such a fucntion. I am using a MAC and MATLAB R2022a. What CPLEX version is compatible?Hello, I am trying to figure out how to use a cplex function and connect it to MATLAB. The code that I have in MATLAB calls a cplexmiqp function.
I am going to use the MIQPS_MATPOWER Mixed Integer Quadratic Program Solver for MATPOWER, from this page https://matpower.org/docs/ref/matpower6.0/miqps_cplex.html.
Now my question is, how would I connect IBM cplex to MATLAB to call such a fucntion. I am using a MAC and MATLAB R2022a. What CPLEX version is compatible? Hello, I am trying to figure out how to use a cplex function and connect it to MATLAB. The code that I have in MATLAB calls a cplexmiqp function.
I am going to use the MIQPS_MATPOWER Mixed Integer Quadratic Program Solver for MATPOWER, from this page https://matpower.org/docs/ref/matpower6.0/miqps_cplex.html.
Now my question is, how would I connect IBM cplex to MATLAB to call such a fucntion. I am using a MAC and MATLAB R2022a. What CPLEX version is compatible? ibm cplex, matlab, optimization MATLAB Answers — New Questions
Why do I see huge voltage spikes at the output of a 3 phase MMC (Modular multi-level converter) in Simscape, when the number of submodules >1, but not with 1 submodule?
Dear Community,
I have a three phase bi-directional power converter modelled by the Simscape block Modular Multilevel Converter (MMC) set for full bridges. This is controlled by a sinusoidal PWM generator and includes a simple LC filter to filter the inverter’s output and help me see a sine wave at the output. The DC Source is a battery with 1000V. The reference setpoint to the PWM generator is a three phase sine wave generator multiplied with a manual gain block (= 0.565) at the moment (this open loop is intentional while I focus on building the plant model at the moment, and will move on to closed loop controller development in next stages).
My model & parameter file is attached.
In the MMC, when the number of submodules = 1 the inverter output and the filtered output waveforms are as expected. (Image below).
However, when I set number of submodules = 2 or above the inverter output (before being filtered) has huge voltage spikes. The filter manages to smoothen these spikes somewhat but I would like to understand why do the spikes show up at Nsm = 2,3, etc and not at Nsm = 1?
A zoomed in view of the phase-to-phase voltage confirms that the inverter is doing it’s job as expected, just with the addition of very high voltage spikes.
Other things I have considered/ tried:
I. Filter Design
For a considerable duration while working with Nsm = 2, I only saw the spikes with the addition of a LC filter. There were no unwanted spikes without the filter (and also no sine wave). This led me to believe that filter tuning might be the source of these voltage spikes. At the moment my filter design is choosing the cutoff frequency at the geometric mean of switching frequency (540 Hz) and output voltage frequency (50 Hz).
fc = sqrt(540*50);
LC = 1/(2*pi*Fc)^2 = 9.4e-07 ~= 1e-06
From this I have selected L = 50e-3 Henry & C = 20e-6 Farads.
This simple filter design works with the Simscape block Converter (3 Phase) but not with the Nsm > 1 for the MMC block I have selected. So I now suspect that filter is not the root cause, especially since I now know that it works with MMC as well but only for Nsm = 1.
II. PWM Generation
I have experimented with different PWM Generation techniques but have obtained similar results from PWM (1) and PWM (2)
Any ideas for the root cause of this behavior would be very helpful for me to move ahead. Thank you.Dear Community,
I have a three phase bi-directional power converter modelled by the Simscape block Modular Multilevel Converter (MMC) set for full bridges. This is controlled by a sinusoidal PWM generator and includes a simple LC filter to filter the inverter’s output and help me see a sine wave at the output. The DC Source is a battery with 1000V. The reference setpoint to the PWM generator is a three phase sine wave generator multiplied with a manual gain block (= 0.565) at the moment (this open loop is intentional while I focus on building the plant model at the moment, and will move on to closed loop controller development in next stages).
My model & parameter file is attached.
In the MMC, when the number of submodules = 1 the inverter output and the filtered output waveforms are as expected. (Image below).
However, when I set number of submodules = 2 or above the inverter output (before being filtered) has huge voltage spikes. The filter manages to smoothen these spikes somewhat but I would like to understand why do the spikes show up at Nsm = 2,3, etc and not at Nsm = 1?
A zoomed in view of the phase-to-phase voltage confirms that the inverter is doing it’s job as expected, just with the addition of very high voltage spikes.
Other things I have considered/ tried:
I. Filter Design
For a considerable duration while working with Nsm = 2, I only saw the spikes with the addition of a LC filter. There were no unwanted spikes without the filter (and also no sine wave). This led me to believe that filter tuning might be the source of these voltage spikes. At the moment my filter design is choosing the cutoff frequency at the geometric mean of switching frequency (540 Hz) and output voltage frequency (50 Hz).
fc = sqrt(540*50);
LC = 1/(2*pi*Fc)^2 = 9.4e-07 ~= 1e-06
From this I have selected L = 50e-3 Henry & C = 20e-6 Farads.
This simple filter design works with the Simscape block Converter (3 Phase) but not with the Nsm > 1 for the MMC block I have selected. So I now suspect that filter is not the root cause, especially since I now know that it works with MMC as well but only for Nsm = 1.
II. PWM Generation
I have experimented with different PWM Generation techniques but have obtained similar results from PWM (1) and PWM (2)
Any ideas for the root cause of this behavior would be very helpful for me to move ahead. Thank you. Dear Community,
I have a three phase bi-directional power converter modelled by the Simscape block Modular Multilevel Converter (MMC) set for full bridges. This is controlled by a sinusoidal PWM generator and includes a simple LC filter to filter the inverter’s output and help me see a sine wave at the output. The DC Source is a battery with 1000V. The reference setpoint to the PWM generator is a three phase sine wave generator multiplied with a manual gain block (= 0.565) at the moment (this open loop is intentional while I focus on building the plant model at the moment, and will move on to closed loop controller development in next stages).
My model & parameter file is attached.
In the MMC, when the number of submodules = 1 the inverter output and the filtered output waveforms are as expected. (Image below).
However, when I set number of submodules = 2 or above the inverter output (before being filtered) has huge voltage spikes. The filter manages to smoothen these spikes somewhat but I would like to understand why do the spikes show up at Nsm = 2,3, etc and not at Nsm = 1?
A zoomed in view of the phase-to-phase voltage confirms that the inverter is doing it’s job as expected, just with the addition of very high voltage spikes.
Other things I have considered/ tried:
I. Filter Design
For a considerable duration while working with Nsm = 2, I only saw the spikes with the addition of a LC filter. There were no unwanted spikes without the filter (and also no sine wave). This led me to believe that filter tuning might be the source of these voltage spikes. At the moment my filter design is choosing the cutoff frequency at the geometric mean of switching frequency (540 Hz) and output voltage frequency (50 Hz).
fc = sqrt(540*50);
LC = 1/(2*pi*Fc)^2 = 9.4e-07 ~= 1e-06
From this I have selected L = 50e-3 Henry & C = 20e-6 Farads.
This simple filter design works with the Simscape block Converter (3 Phase) but not with the Nsm > 1 for the MMC block I have selected. So I now suspect that filter is not the root cause, especially since I now know that it works with MMC as well but only for Nsm = 1.
II. PWM Generation
I have experimented with different PWM Generation techniques but have obtained similar results from PWM (1) and PWM (2)
Any ideas for the root cause of this behavior would be very helpful for me to move ahead. Thank you. three-phase inverter, mmc, pwm generator, spwm, full bridge converter, lc filter, voltage spikes, modular multilevel converter MATLAB Answers — New Questions
how can dameged image and restored image by harmonic function
how can dameged image and restored image by harmonic functionhow can dameged image and restored image by harmonic function how can dameged image and restored image by harmonic function harmonic function MATLAB Answers — New Questions
Problem with using Communications Toolbox to analyse a Receiver Chain
Hi,
I was wondering if anyone who is familiar with the Communication Toolbox may be able to help me in solving a problem with my simulated receiver chain? The code works, but I cannot despite playing with various parameters, get an Error Vector Magnitude (EVM) at my receiver that’s sensible. Ideally, I’m aiming for a EVM of <5% but its showing without equalisation 1700% and 135% with equalisation. The code generates digital modulation using the Communications Toolbox which are put through a transmit raised cosine filter, it then uses a simple channel model, in which I can introduce phase and attenuation, also multipaths. At the receiver I have used again, a receive raised cosine filter, then it undergoes matched filtering, symbol and carrier synchronisation (this is done for SINGLE_CARRIER_RX_CHAIN part of the code, for BPSK, QPSK, 16QAM and 64QAM), OFDM and GSMK is similar but carried out with different functions (but again doesn’t work). All this is done using the Communication Toolbox.
No matter what I try, I can not get The EVM to a sensible level. I have even tried bypassing the channel, so the generated symbols go straight to the receiver (in order to eliminate any phase/attenuation problems) and have set the phase to 2*pi and attenuation to 1 in the code, but the EVM is still just as poor.
I have attached a copy of the code, I have set the phase and attenuation to 2*pi and 1 respectively in the channel model so not to introduce any channel changes. I’m sure it is simply a problem with the Communication Toolbox functions and how I have set them up. Can anyone please shed any light on what I’m doing wrong?
Best regards,
AndyHi,
I was wondering if anyone who is familiar with the Communication Toolbox may be able to help me in solving a problem with my simulated receiver chain? The code works, but I cannot despite playing with various parameters, get an Error Vector Magnitude (EVM) at my receiver that’s sensible. Ideally, I’m aiming for a EVM of <5% but its showing without equalisation 1700% and 135% with equalisation. The code generates digital modulation using the Communications Toolbox which are put through a transmit raised cosine filter, it then uses a simple channel model, in which I can introduce phase and attenuation, also multipaths. At the receiver I have used again, a receive raised cosine filter, then it undergoes matched filtering, symbol and carrier synchronisation (this is done for SINGLE_CARRIER_RX_CHAIN part of the code, for BPSK, QPSK, 16QAM and 64QAM), OFDM and GSMK is similar but carried out with different functions (but again doesn’t work). All this is done using the Communication Toolbox.
No matter what I try, I can not get The EVM to a sensible level. I have even tried bypassing the channel, so the generated symbols go straight to the receiver (in order to eliminate any phase/attenuation problems) and have set the phase to 2*pi and attenuation to 1 in the code, but the EVM is still just as poor.
I have attached a copy of the code, I have set the phase and attenuation to 2*pi and 1 respectively in the channel model so not to introduce any channel changes. I’m sure it is simply a problem with the Communication Toolbox functions and how I have set them up. Can anyone please shed any light on what I’m doing wrong?
Best regards,
Andy Hi,
I was wondering if anyone who is familiar with the Communication Toolbox may be able to help me in solving a problem with my simulated receiver chain? The code works, but I cannot despite playing with various parameters, get an Error Vector Magnitude (EVM) at my receiver that’s sensible. Ideally, I’m aiming for a EVM of <5% but its showing without equalisation 1700% and 135% with equalisation. The code generates digital modulation using the Communications Toolbox which are put through a transmit raised cosine filter, it then uses a simple channel model, in which I can introduce phase and attenuation, also multipaths. At the receiver I have used again, a receive raised cosine filter, then it undergoes matched filtering, symbol and carrier synchronisation (this is done for SINGLE_CARRIER_RX_CHAIN part of the code, for BPSK, QPSK, 16QAM and 64QAM), OFDM and GSMK is similar but carried out with different functions (but again doesn’t work). All this is done using the Communication Toolbox.
No matter what I try, I can not get The EVM to a sensible level. I have even tried bypassing the channel, so the generated symbols go straight to the receiver (in order to eliminate any phase/attenuation problems) and have set the phase to 2*pi and attenuation to 1 in the code, but the EVM is still just as poor.
I have attached a copy of the code, I have set the phase and attenuation to 2*pi and 1 respectively in the channel model so not to introduce any channel changes. I’m sure it is simply a problem with the Communication Toolbox functions and how I have set them up. Can anyone please shed any light on what I’m doing wrong?
Best regards,
Andy problem with communications toolbox MATLAB Answers — New Questions
Weighted regression without priority zone, but with finding the minimum possible value for all the differences
Dear colleagues,
I need to perform a regression. The input data is shown in Figure 1 and is also attached as an MS Excel file.
Figure 1 (Figures are shown in the end of the letter.
The equation is z = a*x^m/(y+c)^n.
The parameters of the fit are shown in Figure 2 and are also attached.
Figure 2
The output data is shown in Figure 3.
Figure 3
The individual differences in percentage are shown in Figure 4.
Figure 4
I know that by using a weighted matrix, it is possible to decrease some differences (priority zones) at the expense of increasing others. However, in this case, my goal is to estimate the minimal possible error (one border value) for all of the values. For example, in the first fit, the maximum difference is 93%. It is easy to decrease it by applying individual weight coefficients, but of course, somewhere, the difference will increase. Therefore, the question is: what method can be used to find the minimal possible difference? If this for example is 18%, it means that everywhere the difference will be smaller, and it is likely that there is no 0 % anymore. Example by hand (not real) is given in Figure 5.
Figure 5
And if we try to decrease the difference at the point with an 18% difference, this will lead to an increase in the difference somewhere above 18%. Also, if in the first fit I have a 0% or 1% difference at a given point, in the second fit, the difference at this point is likely to be close (but smaller) to 18%. And one more thing – if there is a way for doing the whole procedure, is it possible to use curve fitter app or need to use a code?Dear colleagues,
I need to perform a regression. The input data is shown in Figure 1 and is also attached as an MS Excel file.
Figure 1 (Figures are shown in the end of the letter.
The equation is z = a*x^m/(y+c)^n.
The parameters of the fit are shown in Figure 2 and are also attached.
Figure 2
The output data is shown in Figure 3.
Figure 3
The individual differences in percentage are shown in Figure 4.
Figure 4
I know that by using a weighted matrix, it is possible to decrease some differences (priority zones) at the expense of increasing others. However, in this case, my goal is to estimate the minimal possible error (one border value) for all of the values. For example, in the first fit, the maximum difference is 93%. It is easy to decrease it by applying individual weight coefficients, but of course, somewhere, the difference will increase. Therefore, the question is: what method can be used to find the minimal possible difference? If this for example is 18%, it means that everywhere the difference will be smaller, and it is likely that there is no 0 % anymore. Example by hand (not real) is given in Figure 5.
Figure 5
And if we try to decrease the difference at the point with an 18% difference, this will lead to an increase in the difference somewhere above 18%. Also, if in the first fit I have a 0% or 1% difference at a given point, in the second fit, the difference at this point is likely to be close (but smaller) to 18%. And one more thing – if there is a way for doing the whole procedure, is it possible to use curve fitter app or need to use a code? Dear colleagues,
I need to perform a regression. The input data is shown in Figure 1 and is also attached as an MS Excel file.
Figure 1 (Figures are shown in the end of the letter.
The equation is z = a*x^m/(y+c)^n.
The parameters of the fit are shown in Figure 2 and are also attached.
Figure 2
The output data is shown in Figure 3.
Figure 3
The individual differences in percentage are shown in Figure 4.
Figure 4
I know that by using a weighted matrix, it is possible to decrease some differences (priority zones) at the expense of increasing others. However, in this case, my goal is to estimate the minimal possible error (one border value) for all of the values. For example, in the first fit, the maximum difference is 93%. It is easy to decrease it by applying individual weight coefficients, but of course, somewhere, the difference will increase. Therefore, the question is: what method can be used to find the minimal possible difference? If this for example is 18%, it means that everywhere the difference will be smaller, and it is likely that there is no 0 % anymore. Example by hand (not real) is given in Figure 5.
Figure 5
And if we try to decrease the difference at the point with an 18% difference, this will lead to an increase in the difference somewhere above 18%. Also, if in the first fit I have a 0% or 1% difference at a given point, in the second fit, the difference at this point is likely to be close (but smaller) to 18%. And one more thing – if there is a way for doing the whole procedure, is it possible to use curve fitter app or need to use a code? curve fitter toolbox, weighted regression MATLAB Answers — New Questions
Print windows in matlab
Hi
I was making an application using GUIDE in matlab, my interface uses uicontrols, tables, and images, I’m trying how to print the whole information in the GUI application, i.e. the whole window but I cannot print it using the _print_ command. Is it possible to print or export as file the active window?Hi
I was making an application using GUIDE in matlab, my interface uses uicontrols, tables, and images, I’m trying how to print the whole information in the GUI application, i.e. the whole window but I cannot print it using the _print_ command. Is it possible to print or export as file the active window? Hi
I was making an application using GUIDE in matlab, my interface uses uicontrols, tables, and images, I’m trying how to print the whole information in the GUI application, i.e. the whole window but I cannot print it using the _print_ command. Is it possible to print or export as file the active window? guide, gui, print MATLAB Answers — New Questions
What does the sim(‘model’,[0 1]) do in the 2011a Matlab syntax
What does the array [0 1] do in the "sim(‘model’,[0 1]) command of an old simulink model, 2011-ish?What does the array [0 1] do in the "sim(‘model’,[0 1]) command of an old simulink model, 2011-ish? What does the array [0 1] do in the "sim(‘model’,[0 1]) command of an old simulink model, 2011-ish? array input to sim function MATLAB Answers — New Questions