Tag Archives: matlab
Could not find a feasible initial point gamultiobj function
Hi, Hope members are good….I am getting the error "Could not find a feasible initial point.." despite changing lower and upper bounds…… request to help….. attached is the snapshot of obtained error ,,,,, plus matlab script is also in the attachment…… many thanks in advanceHi, Hope members are good….I am getting the error "Could not find a feasible initial point.." despite changing lower and upper bounds…… request to help….. attached is the snapshot of obtained error ,,,,, plus matlab script is also in the attachment…… many thanks in advance Hi, Hope members are good….I am getting the error "Could not find a feasible initial point.." despite changing lower and upper bounds…… request to help….. attached is the snapshot of obtained error ,,,,, plus matlab script is also in the attachment…… many thanks in advance genetic algorithm, constraints, feasible initial point MATLAB Answers — New Questions
Empty pdf if table is saved as pdf
I am trying save the table t1 by uisng the suggested table-to-figure mathod. However, the saved pdf remains empty.
t1=table(ones(5));
fig = uifigure(‘Name’,’Numbers’);
t = uitable(fig,’Data’,t1);
exportapp(fig,’Peak_assigments.pdf’)I am trying save the table t1 by uisng the suggested table-to-figure mathod. However, the saved pdf remains empty.
t1=table(ones(5));
fig = uifigure(‘Name’,’Numbers’);
t = uitable(fig,’Data’,t1);
exportapp(fig,’Peak_assigments.pdf’) I am trying save the table t1 by uisng the suggested table-to-figure mathod. However, the saved pdf remains empty.
t1=table(ones(5));
fig = uifigure(‘Name’,’Numbers’);
t = uitable(fig,’Data’,t1);
exportapp(fig,’Peak_assigments.pdf’) uitable, pdf, saveas, exportapp MATLAB Answers — New Questions
Genetic algorithm with solution of pde toolbox
Hi I’m on project that find optimal parameter about transient heat transfer problem. (find optimal values that minimize temperature fluctuation)
I have problem about exceed maximum array size (about 1800GB) while solving ga problem
I defined a design domain contains multiple values (i.e. length, geometry properties, etc) and FEA using pde toolbox has finished
the last task what i have to do is find optimal values with solution of FEA using ga function and my pseudo code about FEA is here:
function [result, model] = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time)
thermalmodel = createpde(‘thermal’, ‘transient’);
tlist = 0:1:time*60*60;
% Skip code about geometries, BC, IC
result = solve(thermalmodel, tlist);
model = thermalmodel;
end
L1, t1, t2, t3, length_fin is about geometry parameters that is noninteger values (because it is length)
num_fins, shelltype, shellmat, intermed is also about geometry parameters that is interger values (because it is about number or material type, i implemented that decide material type, geometry type by select number like if shellmat == 1, steel / elseif shellmat == 2, polymer)
and code about ga is as below:
function value = ObjectiveFcn(a, time)
L1 = a(1);
t1 = a(2);
t2 = a(3);
t3 = a(4);
length_fin = a(5);
num_fins = a(6);
shelltype = a(7);
shellmat = a(8);
intermed = a(9);
result = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time);
T = result.Temperature;
std_dev = std(T, 0, 1);
value = mean(std_dev);
end
function [c, ceq] = Constraints(b)
L1 = b(1);
t1 = b(2);
t2 = b(3);
t3 = b(4);
length_fin = b(5);
c1 = L1 + t1 + t2 + t3 – 0.3; % 0.3 is total length of control volume
c2 = length_fin – t1;
c3 = length_fin – t3;
c = [c1; c2; c3];
ceq = [];
end
% a = [L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed]
lb = [0, 0, 0, 0, 0, 1, 1, 1, 1];
ub = [0.3, 0.01, 0.02, 0.01, 0.01, 374, 2, 3, 2];
intvar = [6, 7, 8, 9];
ObjectivefunWithTime = @(a) Objectivefun(a, time);
ConstraintsFcn = @(b) Constraints(b);
options = optimoptions(‘ga’, ‘Display’, ‘iter’, ‘PopulationSize’, 10,…
‘MaxGenerations’, 20, ‘CrossoverFraction’, 0.8, ‘UseParallel’, true);
[x_opt, fval] = ga(ObjectivefunWithTime, 9, [], [], [], [], lb, ub, ConstraintsFcn, intvar, options);
time is not design variable so I excepted it from objective function
In ub (upper bound), I actually want to set value for t1, t2, t3, length_fin as 0.3 to find optimal value widely (under Constraints) but when i set values like that, it results error for invalid geometry (conflicted in pde toolbox code) so I defined arbiturary values.
What should I do for achieve my goal? (find optimal value)
I’m sorry for messy code
If anyone knows about this, please comment.
Thank youHi I’m on project that find optimal parameter about transient heat transfer problem. (find optimal values that minimize temperature fluctuation)
I have problem about exceed maximum array size (about 1800GB) while solving ga problem
I defined a design domain contains multiple values (i.e. length, geometry properties, etc) and FEA using pde toolbox has finished
the last task what i have to do is find optimal values with solution of FEA using ga function and my pseudo code about FEA is here:
function [result, model] = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time)
thermalmodel = createpde(‘thermal’, ‘transient’);
tlist = 0:1:time*60*60;
% Skip code about geometries, BC, IC
result = solve(thermalmodel, tlist);
model = thermalmodel;
end
L1, t1, t2, t3, length_fin is about geometry parameters that is noninteger values (because it is length)
num_fins, shelltype, shellmat, intermed is also about geometry parameters that is interger values (because it is about number or material type, i implemented that decide material type, geometry type by select number like if shellmat == 1, steel / elseif shellmat == 2, polymer)
and code about ga is as below:
function value = ObjectiveFcn(a, time)
L1 = a(1);
t1 = a(2);
t2 = a(3);
t3 = a(4);
length_fin = a(5);
num_fins = a(6);
shelltype = a(7);
shellmat = a(8);
intermed = a(9);
result = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time);
T = result.Temperature;
std_dev = std(T, 0, 1);
value = mean(std_dev);
end
function [c, ceq] = Constraints(b)
L1 = b(1);
t1 = b(2);
t2 = b(3);
t3 = b(4);
length_fin = b(5);
c1 = L1 + t1 + t2 + t3 – 0.3; % 0.3 is total length of control volume
c2 = length_fin – t1;
c3 = length_fin – t3;
c = [c1; c2; c3];
ceq = [];
end
% a = [L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed]
lb = [0, 0, 0, 0, 0, 1, 1, 1, 1];
ub = [0.3, 0.01, 0.02, 0.01, 0.01, 374, 2, 3, 2];
intvar = [6, 7, 8, 9];
ObjectivefunWithTime = @(a) Objectivefun(a, time);
ConstraintsFcn = @(b) Constraints(b);
options = optimoptions(‘ga’, ‘Display’, ‘iter’, ‘PopulationSize’, 10,…
‘MaxGenerations’, 20, ‘CrossoverFraction’, 0.8, ‘UseParallel’, true);
[x_opt, fval] = ga(ObjectivefunWithTime, 9, [], [], [], [], lb, ub, ConstraintsFcn, intvar, options);
time is not design variable so I excepted it from objective function
In ub (upper bound), I actually want to set value for t1, t2, t3, length_fin as 0.3 to find optimal value widely (under Constraints) but when i set values like that, it results error for invalid geometry (conflicted in pde toolbox code) so I defined arbiturary values.
What should I do for achieve my goal? (find optimal value)
I’m sorry for messy code
If anyone knows about this, please comment.
Thank you Hi I’m on project that find optimal parameter about transient heat transfer problem. (find optimal values that minimize temperature fluctuation)
I have problem about exceed maximum array size (about 1800GB) while solving ga problem
I defined a design domain contains multiple values (i.e. length, geometry properties, etc) and FEA using pde toolbox has finished
the last task what i have to do is find optimal values with solution of FEA using ga function and my pseudo code about FEA is here:
function [result, model] = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time)
thermalmodel = createpde(‘thermal’, ‘transient’);
tlist = 0:1:time*60*60;
% Skip code about geometries, BC, IC
result = solve(thermalmodel, tlist);
model = thermalmodel;
end
L1, t1, t2, t3, length_fin is about geometry parameters that is noninteger values (because it is length)
num_fins, shelltype, shellmat, intermed is also about geometry parameters that is interger values (because it is about number or material type, i implemented that decide material type, geometry type by select number like if shellmat == 1, steel / elseif shellmat == 2, polymer)
and code about ga is as below:
function value = ObjectiveFcn(a, time)
L1 = a(1);
t1 = a(2);
t2 = a(3);
t3 = a(4);
length_fin = a(5);
num_fins = a(6);
shelltype = a(7);
shellmat = a(8);
intermed = a(9);
result = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time);
T = result.Temperature;
std_dev = std(T, 0, 1);
value = mean(std_dev);
end
function [c, ceq] = Constraints(b)
L1 = b(1);
t1 = b(2);
t2 = b(3);
t3 = b(4);
length_fin = b(5);
c1 = L1 + t1 + t2 + t3 – 0.3; % 0.3 is total length of control volume
c2 = length_fin – t1;
c3 = length_fin – t3;
c = [c1; c2; c3];
ceq = [];
end
% a = [L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed]
lb = [0, 0, 0, 0, 0, 1, 1, 1, 1];
ub = [0.3, 0.01, 0.02, 0.01, 0.01, 374, 2, 3, 2];
intvar = [6, 7, 8, 9];
ObjectivefunWithTime = @(a) Objectivefun(a, time);
ConstraintsFcn = @(b) Constraints(b);
options = optimoptions(‘ga’, ‘Display’, ‘iter’, ‘PopulationSize’, 10,…
‘MaxGenerations’, 20, ‘CrossoverFraction’, 0.8, ‘UseParallel’, true);
[x_opt, fval] = ga(ObjectivefunWithTime, 9, [], [], [], [], lb, ub, ConstraintsFcn, intvar, options);
time is not design variable so I excepted it from objective function
In ub (upper bound), I actually want to set value for t1, t2, t3, length_fin as 0.3 to find optimal value widely (under Constraints) but when i set values like that, it results error for invalid geometry (conflicted in pde toolbox code) so I defined arbiturary values.
What should I do for achieve my goal? (find optimal value)
I’m sorry for messy code
If anyone knows about this, please comment.
Thank you genetic algorithm, pde toolbox, transient heat transfer, matlab, partial differential equation toolbox, global optimization toolbox MATLAB Answers — New Questions
How does im2int16 map double(0.5) to int16(0)?
I’ve known about this for a long time, and I’ve ignored it. It’s a curiosity I pick at every time I edit MIMT imcast(), but I’ve never really figured out a good explanation.
IPT im2int16() maps floating point values on the unit interval to values on the interval [-32768 32767]. That seems very simple. The problem is that obvious arithmetic doesn’t give the same result. What’s more curious is that it seems that the only input value that does not map identically is 1/2.
% our input
dx = 3E-5;
x = [0 linspace(0.5-dx,0.5+dx,7) 1].’; % ‘single’ or ‘double’ are the same
% convert it
y1 = im2int16(x); % the curiosity
y2 = int16(double(x)*65535 – 32768); % the obvious
y3 = int16(rescale(x,-32768,32767,’inputmin’,0,’inputmax’,1)); % a third opinion
% compare
[y1 y2 y3]
For what it’s worth, im2double() doesn’t map that 0 back to 1/2. It maps exactly like one would expect.
% map back to float
z1 = im2double(y1(2:8));
z2 = ((double(y2(2:8)) + 32768)/65535 );
% compare error
[z1 z2] – x(2:8)
So I suppose I have three sorts of questions.
How does this happen? I’m assuming this rises naturally from some simple conversion being used, but im2int16() isn’t working in mcode, and I’m not the clever one here.
Do you think this should be expected? Matter of differing conventions? Preference?
Does it really even matter? I’ve been assuming it doesn’t.I’ve known about this for a long time, and I’ve ignored it. It’s a curiosity I pick at every time I edit MIMT imcast(), but I’ve never really figured out a good explanation.
IPT im2int16() maps floating point values on the unit interval to values on the interval [-32768 32767]. That seems very simple. The problem is that obvious arithmetic doesn’t give the same result. What’s more curious is that it seems that the only input value that does not map identically is 1/2.
% our input
dx = 3E-5;
x = [0 linspace(0.5-dx,0.5+dx,7) 1].’; % ‘single’ or ‘double’ are the same
% convert it
y1 = im2int16(x); % the curiosity
y2 = int16(double(x)*65535 – 32768); % the obvious
y3 = int16(rescale(x,-32768,32767,’inputmin’,0,’inputmax’,1)); % a third opinion
% compare
[y1 y2 y3]
For what it’s worth, im2double() doesn’t map that 0 back to 1/2. It maps exactly like one would expect.
% map back to float
z1 = im2double(y1(2:8));
z2 = ((double(y2(2:8)) + 32768)/65535 );
% compare error
[z1 z2] – x(2:8)
So I suppose I have three sorts of questions.
How does this happen? I’m assuming this rises naturally from some simple conversion being used, but im2int16() isn’t working in mcode, and I’m not the clever one here.
Do you think this should be expected? Matter of differing conventions? Preference?
Does it really even matter? I’ve been assuming it doesn’t. I’ve known about this for a long time, and I’ve ignored it. It’s a curiosity I pick at every time I edit MIMT imcast(), but I’ve never really figured out a good explanation.
IPT im2int16() maps floating point values on the unit interval to values on the interval [-32768 32767]. That seems very simple. The problem is that obvious arithmetic doesn’t give the same result. What’s more curious is that it seems that the only input value that does not map identically is 1/2.
% our input
dx = 3E-5;
x = [0 linspace(0.5-dx,0.5+dx,7) 1].’; % ‘single’ or ‘double’ are the same
% convert it
y1 = im2int16(x); % the curiosity
y2 = int16(double(x)*65535 – 32768); % the obvious
y3 = int16(rescale(x,-32768,32767,’inputmin’,0,’inputmax’,1)); % a third opinion
% compare
[y1 y2 y3]
For what it’s worth, im2double() doesn’t map that 0 back to 1/2. It maps exactly like one would expect.
% map back to float
z1 = im2double(y1(2:8));
z2 = ((double(y2(2:8)) + 32768)/65535 );
% compare error
[z1 z2] – x(2:8)
So I suppose I have three sorts of questions.
How does this happen? I’m assuming this rises naturally from some simple conversion being used, but im2int16() isn’t working in mcode, and I’m not the clever one here.
Do you think this should be expected? Matter of differing conventions? Preference?
Does it really even matter? I’ve been assuming it doesn’t. im2int16 MATLAB Answers — New Questions
How to connect the Raspberry pi GPIO blocks to simulink model to perform real time simulation ?
Raspberry piRaspberry pi Raspberry pi gpio blocks MATLAB Answers — New Questions
I’m getting an error in port width and dimensions.
<</matlabcentral/answers/uploaded_files/1710701/PXL_20240607_114519832.MV.jpg>><</matlabcentral/answers/uploaded_files/1710701/PXL_20240607_114519832.MV.jpg>> <</matlabcentral/answers/uploaded_files/1710701/PXL_20240607_114519832.MV.jpg>> error in port width and dimensions or orientation. MATLAB Answers — New Questions
MQTT connection error on 2021b – Unable to resolve the name com.mathworks.mqttclient.client.Client.
I’m facing this error while trying to create an mqtt connection:
>> myMQTT=mqtt(‘tcp://broker.hivemq.com’)
‘com.mathworks’ package and subpackages will be removed in a future release. There is no simple replacement for this.
Caused by:
Unable to resolve the name com.mathworks.mqttclient.client.Client.
I just downloaded the mqtt package from file -exchange (mqtt-download).
I’m using matlab 2021b:
—————————————————————————————————–
MATLAB Version: 9.11.0.2358333 (R2021b) Update 7
MATLAB License Number:
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
—————————————————————————————————–
MATLAB Version 9.11 (R2021b)
Database Toolbox Version 10.2 (R2021b)
Deep Learning Toolbox Version 14.3 (R2021b)
Image Acquisition Toolbox Version 6.5 (R2021b)
Image Processing Toolbox Version 11.4 (R2021b)
MATLAB Compiler Version 8.3 (R2021b)
MATLAB Compiler SDK Version 6.11 (R2021b)
MATLAB Report Generator Version 5.11 (R2021b)
Spreadsheet Link Version 3.4.6 (R2021b)
Statistics and Machine Learning Toolbox Version 12.2 (R2021b)I’m facing this error while trying to create an mqtt connection:
>> myMQTT=mqtt(‘tcp://broker.hivemq.com’)
‘com.mathworks’ package and subpackages will be removed in a future release. There is no simple replacement for this.
Caused by:
Unable to resolve the name com.mathworks.mqttclient.client.Client.
I just downloaded the mqtt package from file -exchange (mqtt-download).
I’m using matlab 2021b:
—————————————————————————————————–
MATLAB Version: 9.11.0.2358333 (R2021b) Update 7
MATLAB License Number:
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
—————————————————————————————————–
MATLAB Version 9.11 (R2021b)
Database Toolbox Version 10.2 (R2021b)
Deep Learning Toolbox Version 14.3 (R2021b)
Image Acquisition Toolbox Version 6.5 (R2021b)
Image Processing Toolbox Version 11.4 (R2021b)
MATLAB Compiler Version 8.3 (R2021b)
MATLAB Compiler SDK Version 6.11 (R2021b)
MATLAB Report Generator Version 5.11 (R2021b)
Spreadsheet Link Version 3.4.6 (R2021b)
Statistics and Machine Learning Toolbox Version 12.2 (R2021b) I’m facing this error while trying to create an mqtt connection:
>> myMQTT=mqtt(‘tcp://broker.hivemq.com’)
‘com.mathworks’ package and subpackages will be removed in a future release. There is no simple replacement for this.
Caused by:
Unable to resolve the name com.mathworks.mqttclient.client.Client.
I just downloaded the mqtt package from file -exchange (mqtt-download).
I’m using matlab 2021b:
—————————————————————————————————–
MATLAB Version: 9.11.0.2358333 (R2021b) Update 7
MATLAB License Number:
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
—————————————————————————————————–
MATLAB Version 9.11 (R2021b)
Database Toolbox Version 10.2 (R2021b)
Deep Learning Toolbox Version 14.3 (R2021b)
Image Acquisition Toolbox Version 6.5 (R2021b)
Image Processing Toolbox Version 11.4 (R2021b)
MATLAB Compiler Version 8.3 (R2021b)
MATLAB Compiler SDK Version 6.11 (R2021b)
MATLAB Report Generator Version 5.11 (R2021b)
Spreadsheet Link Version 3.4.6 (R2021b)
Statistics and Machine Learning Toolbox Version 12.2 (R2021b) mqtt, 2021b MATLAB Answers — New Questions
How to call a function with arguments containing “.” in “run” function?
Lets say I am trying to call a function called printVersion() using run.
Here is printVersion()
function printVersion(version)
disp(version)
end
Now, if version number doesn’t contain decimal, it works fine.
But, If version number has decimal, it trys to find the whole string as a script.
Thank you.Lets say I am trying to call a function called printVersion() using run.
Here is printVersion()
function printVersion(version)
disp(version)
end
Now, if version number doesn’t contain decimal, it works fine.
But, If version number has decimal, it trys to find the whole string as a script.
Thank you. Lets say I am trying to call a function called printVersion() using run.
Here is printVersion()
function printVersion(version)
disp(version)
end
Now, if version number doesn’t contain decimal, it works fine.
But, If version number has decimal, it trys to find the whole string as a script.
Thank you. run, argument with decimal MATLAB Answers — New Questions
Text inside the meshgrid
Hello,
I am trying to place an arbitrary text inside the meshgrid. The code is as follows:
Nx = 201; Ny = 201;
TEXT = ‘K e k’; % Text to draw
FONT_SIZE = 10; % Font size
FONT_NAME = ‘Castellar’; % Font style (you can change this to any available font)
% Create a black image
img = zeros(Ny, Nx);
% Create a figure, axes, and an image object
figure(‘Visible’, ‘off’); % Create an invisible figure
axes(‘Units’, ‘pixels’, ‘Position’, [1, 1, Nx, Ny], ‘Visible’, ‘off’); % Create axes
imageHandle = imshow(img); % Show the black image
% Add text to the image
text(Nx / 2, Ny / 2, TEXT, ‘FontSize’, FONT_SIZE, ‘FontName’, FONT_NAME, …
‘Color’, [1, 1, 1], ‘HorizontalAlignment’, ‘center’, ‘VerticalAlignment’, ‘middle’);
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
% Convert to grayscale and then to binary mask
imgWithTextGray = rgb2gray(imgWithText);
mask = imgWithTextGray > 0;
% Invert the binary mask
mask_inverted = ~mask;
% Convert the inverted binary mask to double type
mask_double = double(mask_inverted);
% Flip upside down
obst = flipud(mask_double);
% Display the final mask (optional)
figure;
imshow(obst);
The code works fine with this grid resolution. However, when i increase the number of mesh points along y-axis (Ny), i get incorrect size of the obst. In particular, the maximum resolution of Ny is 420. For example, if i set Nx=601 and Ny=601, i will get the obst size of 420×601. Obviously, the problem is in this part:
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
I cannot understand why the frame data is limited along y-axis (Ny) by 420 points despite i have enough memory. Can someone suggest anything to fix this problem?
kind regards,
AlexHello,
I am trying to place an arbitrary text inside the meshgrid. The code is as follows:
Nx = 201; Ny = 201;
TEXT = ‘K e k’; % Text to draw
FONT_SIZE = 10; % Font size
FONT_NAME = ‘Castellar’; % Font style (you can change this to any available font)
% Create a black image
img = zeros(Ny, Nx);
% Create a figure, axes, and an image object
figure(‘Visible’, ‘off’); % Create an invisible figure
axes(‘Units’, ‘pixels’, ‘Position’, [1, 1, Nx, Ny], ‘Visible’, ‘off’); % Create axes
imageHandle = imshow(img); % Show the black image
% Add text to the image
text(Nx / 2, Ny / 2, TEXT, ‘FontSize’, FONT_SIZE, ‘FontName’, FONT_NAME, …
‘Color’, [1, 1, 1], ‘HorizontalAlignment’, ‘center’, ‘VerticalAlignment’, ‘middle’);
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
% Convert to grayscale and then to binary mask
imgWithTextGray = rgb2gray(imgWithText);
mask = imgWithTextGray > 0;
% Invert the binary mask
mask_inverted = ~mask;
% Convert the inverted binary mask to double type
mask_double = double(mask_inverted);
% Flip upside down
obst = flipud(mask_double);
% Display the final mask (optional)
figure;
imshow(obst);
The code works fine with this grid resolution. However, when i increase the number of mesh points along y-axis (Ny), i get incorrect size of the obst. In particular, the maximum resolution of Ny is 420. For example, if i set Nx=601 and Ny=601, i will get the obst size of 420×601. Obviously, the problem is in this part:
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
I cannot understand why the frame data is limited along y-axis (Ny) by 420 points despite i have enough memory. Can someone suggest anything to fix this problem?
kind regards,
Alex Hello,
I am trying to place an arbitrary text inside the meshgrid. The code is as follows:
Nx = 201; Ny = 201;
TEXT = ‘K e k’; % Text to draw
FONT_SIZE = 10; % Font size
FONT_NAME = ‘Castellar’; % Font style (you can change this to any available font)
% Create a black image
img = zeros(Ny, Nx);
% Create a figure, axes, and an image object
figure(‘Visible’, ‘off’); % Create an invisible figure
axes(‘Units’, ‘pixels’, ‘Position’, [1, 1, Nx, Ny], ‘Visible’, ‘off’); % Create axes
imageHandle = imshow(img); % Show the black image
% Add text to the image
text(Nx / 2, Ny / 2, TEXT, ‘FontSize’, FONT_SIZE, ‘FontName’, FONT_NAME, …
‘Color’, [1, 1, 1], ‘HorizontalAlignment’, ‘center’, ‘VerticalAlignment’, ‘middle’);
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
% Convert to grayscale and then to binary mask
imgWithTextGray = rgb2gray(imgWithText);
mask = imgWithTextGray > 0;
% Invert the binary mask
mask_inverted = ~mask;
% Convert the inverted binary mask to double type
mask_double = double(mask_inverted);
% Flip upside down
obst = flipud(mask_double);
% Display the final mask (optional)
figure;
imshow(obst);
The code works fine with this grid resolution. However, when i increase the number of mesh points along y-axis (Ny), i get incorrect size of the obst. In particular, the maximum resolution of Ny is 420. For example, if i set Nx=601 and Ny=601, i will get the obst size of 420×601. Obviously, the problem is in this part:
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
I cannot understand why the frame data is limited along y-axis (Ny) by 420 points despite i have enough memory. Can someone suggest anything to fix this problem?
kind regards,
Alex visualization, text MATLAB Answers — New Questions
proper namespace organisation with classes and enums
Hi Folks,
I’m curious of how to proper organise a folder structure for xx
Setting
Consider I’m developing a driver class for some DeviceA made by Manufacturer.
I assume, that I will use this DeviceA in several more Projects and I probably will get another one DeviceB, which use the same manufacturer-specific enumerated definitions of something – let`s say the volume levels will be defined as:
classdef enumVolumeLevels < uint8
enumeration
volLow (0)
volMid (50)
volHigh (100)
end
end
So I will write some kine of driver class including everything manufacturer-specific either as constants or as enumerations.
Folder Structure
So my Folderstructure will look like:
%rootfolder:
.+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
Now if I’m going to write a setter and getter method, which both checks If the provided Value fits to the manufacturer-defined levels
classdef DeviceA
% […]
methods
%getter
function value = get.Volume(obj)
value = Manufacturer.enumVolumeLevels(50); %some dummy getter method
end
%setter
function set.Volume(obj,level)
arguments
obj
mode Manufacturer.enumVolumeLevels
end
% some dummy setter method
end
end
%[…]
end
Standalone usage
Now I’m goind to test my class from the root folder of this project.
… and works fine if I define an object of this class and assign or read the property Volume
test = Manufacturer.DeviceA(); %call constructor
test.Volume = 50; %set property to something
disp(test.Volume); % display this property
Code Refactoring
Following the initial Idea of writing this driver class to use it in several Application specific projects I will include it into root folder of ProjectA, which looks like:
%rootfolder of ProjectA:
.+Drivers+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Drivers+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+Drivers+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
.MyFunc.m %some script containing instancesof the DeviceA-class
But if I write MyFunc.m as follows:
function MyFunc
test = Drivers.Manufacturer.DeviceA(); % call constructor
test.Volume = 50; % set property to something
disp(test.Volume); % display this property
end
… it will fail after the 2nd line because from the setter point of view the enumeration class Manufacturer.enumVolumeLevels is not defined.
So my question is:
–> Is there a solution for organizing my namespace folders to avoid such visibility Problem?
Perhaps I’ll need to chanhe the folder structure of my Manufacturer-package or the way I use the enumeration class in my class DeviceA, but I’m completely stuck right now and have no Idea, what should be the best practice in this case,Hi Folks,
I’m curious of how to proper organise a folder structure for xx
Setting
Consider I’m developing a driver class for some DeviceA made by Manufacturer.
I assume, that I will use this DeviceA in several more Projects and I probably will get another one DeviceB, which use the same manufacturer-specific enumerated definitions of something – let`s say the volume levels will be defined as:
classdef enumVolumeLevels < uint8
enumeration
volLow (0)
volMid (50)
volHigh (100)
end
end
So I will write some kine of driver class including everything manufacturer-specific either as constants or as enumerations.
Folder Structure
So my Folderstructure will look like:
%rootfolder:
.+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
Now if I’m going to write a setter and getter method, which both checks If the provided Value fits to the manufacturer-defined levels
classdef DeviceA
% […]
methods
%getter
function value = get.Volume(obj)
value = Manufacturer.enumVolumeLevels(50); %some dummy getter method
end
%setter
function set.Volume(obj,level)
arguments
obj
mode Manufacturer.enumVolumeLevels
end
% some dummy setter method
end
end
%[…]
end
Standalone usage
Now I’m goind to test my class from the root folder of this project.
… and works fine if I define an object of this class and assign or read the property Volume
test = Manufacturer.DeviceA(); %call constructor
test.Volume = 50; %set property to something
disp(test.Volume); % display this property
Code Refactoring
Following the initial Idea of writing this driver class to use it in several Application specific projects I will include it into root folder of ProjectA, which looks like:
%rootfolder of ProjectA:
.+Drivers+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Drivers+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+Drivers+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
.MyFunc.m %some script containing instancesof the DeviceA-class
But if I write MyFunc.m as follows:
function MyFunc
test = Drivers.Manufacturer.DeviceA(); % call constructor
test.Volume = 50; % set property to something
disp(test.Volume); % display this property
end
… it will fail after the 2nd line because from the setter point of view the enumeration class Manufacturer.enumVolumeLevels is not defined.
So my question is:
–> Is there a solution for organizing my namespace folders to avoid such visibility Problem?
Perhaps I’ll need to chanhe the folder structure of my Manufacturer-package or the way I use the enumeration class in my class DeviceA, but I’m completely stuck right now and have no Idea, what should be the best practice in this case, Hi Folks,
I’m curious of how to proper organise a folder structure for xx
Setting
Consider I’m developing a driver class for some DeviceA made by Manufacturer.
I assume, that I will use this DeviceA in several more Projects and I probably will get another one DeviceB, which use the same manufacturer-specific enumerated definitions of something – let`s say the volume levels will be defined as:
classdef enumVolumeLevels < uint8
enumeration
volLow (0)
volMid (50)
volHigh (100)
end
end
So I will write some kine of driver class including everything manufacturer-specific either as constants or as enumerations.
Folder Structure
So my Folderstructure will look like:
%rootfolder:
.+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
Now if I’m going to write a setter and getter method, which both checks If the provided Value fits to the manufacturer-defined levels
classdef DeviceA
% […]
methods
%getter
function value = get.Volume(obj)
value = Manufacturer.enumVolumeLevels(50); %some dummy getter method
end
%setter
function set.Volume(obj,level)
arguments
obj
mode Manufacturer.enumVolumeLevels
end
% some dummy setter method
end
end
%[…]
end
Standalone usage
Now I’m goind to test my class from the root folder of this project.
… and works fine if I define an object of this class and assign or read the property Volume
test = Manufacturer.DeviceA(); %call constructor
test.Volume = 50; %set property to something
disp(test.Volume); % display this property
Code Refactoring
Following the initial Idea of writing this driver class to use it in several Application specific projects I will include it into root folder of ProjectA, which looks like:
%rootfolder of ProjectA:
.+Drivers+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Drivers+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+Drivers+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
.MyFunc.m %some script containing instancesof the DeviceA-class
But if I write MyFunc.m as follows:
function MyFunc
test = Drivers.Manufacturer.DeviceA(); % call constructor
test.Volume = 50; % set property to something
disp(test.Volume); % display this property
end
… it will fail after the 2nd line because from the setter point of view the enumeration class Manufacturer.enumVolumeLevels is not defined.
So my question is:
–> Is there a solution for organizing my namespace folders to avoid such visibility Problem?
Perhaps I’ll need to chanhe the folder structure of my Manufacturer-package or the way I use the enumeration class in my class DeviceA, but I’m completely stuck right now and have no Idea, what should be the best practice in this case, namespace, package, class, enumeration class, refactoring, 2021a, .git, modular programming, oop MATLAB Answers — New Questions
Distance measurement using TFmini-S in SIMULINK
We are using TFmini-S connected to ARDUINO UNO at pin no 2 and 3, we want to measure the distance in SIMULINK model for some application. can anyone help us?We are using TFmini-S connected to ARDUINO UNO at pin no 2 and 3, we want to measure the distance in SIMULINK model for some application. can anyone help us? We are using TFmini-S connected to ARDUINO UNO at pin no 2 and 3, we want to measure the distance in SIMULINK model for some application. can anyone help us? tfmini, tfmini-s, arduino, simulink MATLAB Answers — New Questions
Why am I not receiving any ERROR?
Despite the en: du: and ex: actions being ignored, the chart is running smooth and publishing outputs even. Is this a new update or is this some bug? Model Advisor checks also are not showing any anomality. Please if someone could clarify.Despite the en: du: and ex: actions being ignored, the chart is running smooth and publishing outputs even. Is this a new update or is this some bug? Model Advisor checks also are not showing any anomality. Please if someone could clarify. Despite the en: du: and ex: actions being ignored, the chart is running smooth and publishing outputs even. Is this a new update or is this some bug? Model Advisor checks also are not showing any anomality. Please if someone could clarify. stateflow, chart, simulink, entry action MATLAB Answers — New Questions
Why load flow do not converge for Kundur two area system with Induction Motor as load?
Currently I am working on small signal stability analysis of Kundur two areas system with different types of load modelling. I am using induction motor as load and it does not converge the load flow in 50 iteration. How can i solve this issues. If any one has solution for this, i would be grateful.
Thank you.Currently I am working on small signal stability analysis of Kundur two areas system with different types of load modelling. I am using induction motor as load and it does not converge the load flow in 50 iteration. How can i solve this issues. If any one has solution for this, i would be grateful.
Thank you. Currently I am working on small signal stability analysis of Kundur two areas system with different types of load modelling. I am using induction motor as load and it does not converge the load flow in 50 iteration. How can i solve this issues. If any one has solution for this, i would be grateful.
Thank you. load flow analysis, simulink, matlab gui MATLAB Answers — New Questions
How can I use Python in Matlab for dll usage?
I am using Python inside of MATLAB to load a DLL so I can use its functionality. I have tried almost every combination of inputs to try and make this MATLAB-Python combo work, but I have been unsuccessful. I know my DLL is good because I have used it using solely python and I have also gotten it working in MATLAB using a different set of commands, but I really want to use the MATLAB/Python combo.
Below is what I am trying to do
%% Using Python
ctypes = py.importlib.import_module(‘ctypes’);
vnx = ctypes.cdll.LoadLibrary(‘file path where dll and header files are stored vnx_fmsynth.dll’);
%% Calling these fx’s don’t work!
vnx.fnLMS_SetTestMode(0)
vnx.fnLMS_GetNumDevices()
I can assure fnLMS_SetTestMode and fnLMS_GetNumDevices, are methods within the DLL but python-matlab does not want to recognize them. I have tried over 100 combinations of trying to get the DLL to function, but I simply cannot figure out the correct syntax. When I run essentially the same lines in python however, it does work, so I am obviously doing something wrong inside of matlab.
Let me show you what does work in MATLAB with out using python.. (this does require you have a C-code compiler installed on your PC).
%% Load Libraries
cd(‘file path where dll and header files are stored’)
libName=’vnx_fmsynth’;
loadlibrary([libName,’.dll’],’vnx_LMS_api.h’)
libfunc= libfunctions(‘vnx_fmsynth’)
%% tab complete for the lazy
for i=1:length(libfunc)
libF.(libfunc{i})=libfunc{i}; % this way the auto complete from the structure’s field is the same as the library name
end
%% Calling these fx’s work!
calllib(libName, ‘fnLMS_SetTestMode’,0)
devNum=calllib(libName,libF.fnLMS_GetNumDevices)
I have included the files in .zip for you to try yourself.
the fnLMS_GetNumDevices function should response with ‘0’. the TestMode function doesn’t respond with anything, but it does functionally work. I have been told and have watched videos that running python inside of MATLAB works the same, but I am starting to question my presumptions. 🙁 Any and all help would be very much appreciated!!
I am using MATLAB 2022AI am using Python inside of MATLAB to load a DLL so I can use its functionality. I have tried almost every combination of inputs to try and make this MATLAB-Python combo work, but I have been unsuccessful. I know my DLL is good because I have used it using solely python and I have also gotten it working in MATLAB using a different set of commands, but I really want to use the MATLAB/Python combo.
Below is what I am trying to do
%% Using Python
ctypes = py.importlib.import_module(‘ctypes’);
vnx = ctypes.cdll.LoadLibrary(‘file path where dll and header files are stored vnx_fmsynth.dll’);
%% Calling these fx’s don’t work!
vnx.fnLMS_SetTestMode(0)
vnx.fnLMS_GetNumDevices()
I can assure fnLMS_SetTestMode and fnLMS_GetNumDevices, are methods within the DLL but python-matlab does not want to recognize them. I have tried over 100 combinations of trying to get the DLL to function, but I simply cannot figure out the correct syntax. When I run essentially the same lines in python however, it does work, so I am obviously doing something wrong inside of matlab.
Let me show you what does work in MATLAB with out using python.. (this does require you have a C-code compiler installed on your PC).
%% Load Libraries
cd(‘file path where dll and header files are stored’)
libName=’vnx_fmsynth’;
loadlibrary([libName,’.dll’],’vnx_LMS_api.h’)
libfunc= libfunctions(‘vnx_fmsynth’)
%% tab complete for the lazy
for i=1:length(libfunc)
libF.(libfunc{i})=libfunc{i}; % this way the auto complete from the structure’s field is the same as the library name
end
%% Calling these fx’s work!
calllib(libName, ‘fnLMS_SetTestMode’,0)
devNum=calllib(libName,libF.fnLMS_GetNumDevices)
I have included the files in .zip for you to try yourself.
the fnLMS_GetNumDevices function should response with ‘0’. the TestMode function doesn’t respond with anything, but it does functionally work. I have been told and have watched videos that running python inside of MATLAB works the same, but I am starting to question my presumptions. 🙁 Any and all help would be very much appreciated!!
I am using MATLAB 2022A I am using Python inside of MATLAB to load a DLL so I can use its functionality. I have tried almost every combination of inputs to try and make this MATLAB-Python combo work, but I have been unsuccessful. I know my DLL is good because I have used it using solely python and I have also gotten it working in MATLAB using a different set of commands, but I really want to use the MATLAB/Python combo.
Below is what I am trying to do
%% Using Python
ctypes = py.importlib.import_module(‘ctypes’);
vnx = ctypes.cdll.LoadLibrary(‘file path where dll and header files are stored vnx_fmsynth.dll’);
%% Calling these fx’s don’t work!
vnx.fnLMS_SetTestMode(0)
vnx.fnLMS_GetNumDevices()
I can assure fnLMS_SetTestMode and fnLMS_GetNumDevices, are methods within the DLL but python-matlab does not want to recognize them. I have tried over 100 combinations of trying to get the DLL to function, but I simply cannot figure out the correct syntax. When I run essentially the same lines in python however, it does work, so I am obviously doing something wrong inside of matlab.
Let me show you what does work in MATLAB with out using python.. (this does require you have a C-code compiler installed on your PC).
%% Load Libraries
cd(‘file path where dll and header files are stored’)
libName=’vnx_fmsynth’;
loadlibrary([libName,’.dll’],’vnx_LMS_api.h’)
libfunc= libfunctions(‘vnx_fmsynth’)
%% tab complete for the lazy
for i=1:length(libfunc)
libF.(libfunc{i})=libfunc{i}; % this way the auto complete from the structure’s field is the same as the library name
end
%% Calling these fx’s work!
calllib(libName, ‘fnLMS_SetTestMode’,0)
devNum=calllib(libName,libF.fnLMS_GetNumDevices)
I have included the files in .zip for you to try yourself.
the fnLMS_GetNumDevices function should response with ‘0’. the TestMode function doesn’t respond with anything, but it does functionally work. I have been told and have watched videos that running python inside of MATLAB works the same, but I am starting to question my presumptions. 🙁 Any and all help would be very much appreciated!!
I am using MATLAB 2022A ctype, dll, python, calllib, loadlibrary MATLAB Answers — New Questions
How to close autosar updater report with programming script?
hello guys,i update my autosar model by updateModel(ar,modelName).At the end of update process, a updater report will be opened. I want to close this report by m-scripts.It will be generous of you to provide me api name to complete this function.
Best regardhello guys,i update my autosar model by updateModel(ar,modelName).At the end of update process, a updater report will be opened. I want to close this report by m-scripts.It will be generous of you to provide me api name to complete this function.
Best regard hello guys,i update my autosar model by updateModel(ar,modelName).At the end of update process, a updater report will be opened. I want to close this report by m-scripts.It will be generous of you to provide me api name to complete this function.
Best regard report, autosar MATLAB Answers — New Questions
How do I Copy or Import a figure from MATLAB into Word document
Dear Support,
How do I copy or Import a figure (q-q plot graph) from MATLAB into Word document.
Thank you.Dear Support,
How do I copy or Import a figure (q-q plot graph) from MATLAB into Word document.
Thank you. Dear Support,
How do I copy or Import a figure (q-q plot graph) from MATLAB into Word document.
Thank you. how copy figuree into word document, word, activex, exportgraphics MATLAB Answers — New Questions
What Does Access Expire means in Matlab Fundamental
Hello, I completed my Matlab Fundamental and claimed the Badge Too . So after doing all test i noticed that it says Access expire in 2026 What does it means will my certificate will be invalid after 2026/ Will my certificate will be removed from the server?Hello, I completed my Matlab Fundamental and claimed the Badge Too . So after doing all test i noticed that it says Access expire in 2026 What does it means will my certificate will be invalid after 2026/ Will my certificate will be removed from the server? Hello, I completed my Matlab Fundamental and claimed the Badge Too . So after doing all test i noticed that it says Access expire in 2026 What does it means will my certificate will be invalid after 2026/ Will my certificate will be removed from the server? #matlab, #matlab_ fundamentals, certificate MATLAB Answers — New Questions
Intel P +E or AMD for large (2000) Monte Carlo simulations
I’m about to build a new pc with running large Monte Carlo simulation in mind. I know that matlab doesn’t benefit from threading. Am I better off with an Intel 14700k 20core (8P+12E) cpu, or an AMD 7950x 16core cpu (16P) cpu.
I’m concerned that the intel chip E cores can’t perform equally well as the P cores, so that different Monte Carlo runs won’t finish about the same time.
On the other hand, by running bench(0), I see that AMD chips are really bad at linear algebra, which is another concern to me.
A related q&a to this post
https://www.mathworks.com/matlabcentral/answers/2062522-how-does-parallel-computing-toolbox-handle-performance-and-efficiency-core-usageI’m about to build a new pc with running large Monte Carlo simulation in mind. I know that matlab doesn’t benefit from threading. Am I better off with an Intel 14700k 20core (8P+12E) cpu, or an AMD 7950x 16core cpu (16P) cpu.
I’m concerned that the intel chip E cores can’t perform equally well as the P cores, so that different Monte Carlo runs won’t finish about the same time.
On the other hand, by running bench(0), I see that AMD chips are really bad at linear algebra, which is another concern to me.
A related q&a to this post
https://www.mathworks.com/matlabcentral/answers/2062522-how-does-parallel-computing-toolbox-handle-performance-and-efficiency-core-usage I’m about to build a new pc with running large Monte Carlo simulation in mind. I know that matlab doesn’t benefit from threading. Am I better off with an Intel 14700k 20core (8P+12E) cpu, or an AMD 7950x 16core cpu (16P) cpu.
I’m concerned that the intel chip E cores can’t perform equally well as the P cores, so that different Monte Carlo runs won’t finish about the same time.
On the other hand, by running bench(0), I see that AMD chips are really bad at linear algebra, which is another concern to me.
A related q&a to this post
https://www.mathworks.com/matlabcentral/answers/2062522-how-does-parallel-computing-toolbox-handle-performance-and-efficiency-core-usage cpu, hardware setup, parallel computing, linear algebra, monte carlo MATLAB Answers — New Questions
How to use the Automated Driving Toolbox to render car models in Unrealengine
A scenario was created using the Automated Driving Toolbox. It was confirmed that the vehicle moved according to the scenario in UnrealEngine 4.27.
Next, the car created in Blender was imported into UnrealEngine. Next, uasset was added to the "type" parameter of the Simulation 3D Vehicle with Ground Following block, but an error occurred and it could not be executed.
・The uasset was set to a static mesh
・The path of the uasset was the path that was obtained by copying the mesh reference in the UnrealEngine content browser (/Game/Alphard/Alphard.Alphard)
UnrealEngine errormessage
LoginId:56f3086d4e90220396b1f8a834dbef9b
EpicAccountId:8813ae5e8cfa455c88081ad3cf2b70ef
Assertion failed: VehMesh != nullptr [File:C:/TEMP/Bsim3d_2357499_7508/home/Desktop/SP/plg/MathWorksSimulation/HostProject/Plugins/MathWorksSimulation/Source/MathWorksSimulation/Private/Sim3dVeh.cpp] [Line: 254] Failed to load /Game/Alphard/Alphard1.Alphard1. Please specify a valid mesh path.
UE4Editor_Core
UE4Editor_Core
UE4Editor_MathWorksSimulation!DispatchCheckVerify<void,<lambda_a44834317377756d5b8114aa20be44b3> >() [C:Program FilesEpic GamesUE_4.27EngineSourceRuntimeCorePublicMiscAssertionMacros.h:164]
UE4Editor_MathWorksSimulation!ASim3dVeh::ConfigureDefaultMesh() [C:TEMPBsim3d_2357499_7508homeDesktopSPplgMathWorksSimulationHostProjectPluginsMathWorksSimulationSourceMathWorksSimulationPrivateSim3dVeh.cpp:254]
UE4Editor_MathWorksSimulation!ASim3dPassVeh::Sim3dSetup() [C:TEMPBsim3d_2357499_7508homeDesktopSPplgMathWorksSimulationHostProjectPluginsMathWorksSimulationSourceMathWorksSimulationPrivateSim3dPassVeh.cpp:109]
UE4Editor_MathWorksSimulation!ASim3dActor::BeginPlay() [C:TEMPBsim3d_2357499_7508homeDesktopSPplgMathWorksSimulationHostProjectPluginsMathWorksSimulationSourceMathWorksSimulationPrivateSim3dActor.cpp:153]
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdllA scenario was created using the Automated Driving Toolbox. It was confirmed that the vehicle moved according to the scenario in UnrealEngine 4.27.
Next, the car created in Blender was imported into UnrealEngine. Next, uasset was added to the "type" parameter of the Simulation 3D Vehicle with Ground Following block, but an error occurred and it could not be executed.
・The uasset was set to a static mesh
・The path of the uasset was the path that was obtained by copying the mesh reference in the UnrealEngine content browser (/Game/Alphard/Alphard.Alphard)
UnrealEngine errormessage
LoginId:56f3086d4e90220396b1f8a834dbef9b
EpicAccountId:8813ae5e8cfa455c88081ad3cf2b70ef
Assertion failed: VehMesh != nullptr [File:C:/TEMP/Bsim3d_2357499_7508/home/Desktop/SP/plg/MathWorksSimulation/HostProject/Plugins/MathWorksSimulation/Source/MathWorksSimulation/Private/Sim3dVeh.cpp] [Line: 254] Failed to load /Game/Alphard/Alphard1.Alphard1. Please specify a valid mesh path.
UE4Editor_Core
UE4Editor_Core
UE4Editor_MathWorksSimulation!DispatchCheckVerify<void,<lambda_a44834317377756d5b8114aa20be44b3> >() [C:Program FilesEpic GamesUE_4.27EngineSourceRuntimeCorePublicMiscAssertionMacros.h:164]
UE4Editor_MathWorksSimulation!ASim3dVeh::ConfigureDefaultMesh() [C:TEMPBsim3d_2357499_7508homeDesktopSPplgMathWorksSimulationHostProjectPluginsMathWorksSimulationSourceMathWorksSimulationPrivateSim3dVeh.cpp:254]
UE4Editor_MathWorksSimulation!ASim3dPassVeh::Sim3dSetup() [C:TEMPBsim3d_2357499_7508homeDesktopSPplgMathWorksSimulationHostProjectPluginsMathWorksSimulationSourceMathWorksSimulationPrivateSim3dPassVeh.cpp:109]
UE4Editor_MathWorksSimulation!ASim3dActor::BeginPlay() [C:TEMPBsim3d_2357499_7508homeDesktopSPplgMathWorksSimulationHostProjectPluginsMathWorksSimulationSourceMathWorksSimulationPrivateSim3dActor.cpp:153]
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll A scenario was created using the Automated Driving Toolbox. It was confirmed that the vehicle moved according to the scenario in UnrealEngine 4.27.
Next, the car created in Blender was imported into UnrealEngine. Next, uasset was added to the "type" parameter of the Simulation 3D Vehicle with Ground Following block, but an error occurred and it could not be executed.
・The uasset was set to a static mesh
・The path of the uasset was the path that was obtained by copying the mesh reference in the UnrealEngine content browser (/Game/Alphard/Alphard.Alphard)
UnrealEngine errormessage
LoginId:56f3086d4e90220396b1f8a834dbef9b
EpicAccountId:8813ae5e8cfa455c88081ad3cf2b70ef
Assertion failed: VehMesh != nullptr [File:C:/TEMP/Bsim3d_2357499_7508/home/Desktop/SP/plg/MathWorksSimulation/HostProject/Plugins/MathWorksSimulation/Source/MathWorksSimulation/Private/Sim3dVeh.cpp] [Line: 254] Failed to load /Game/Alphard/Alphard1.Alphard1. Please specify a valid mesh path.
UE4Editor_Core
UE4Editor_Core
UE4Editor_MathWorksSimulation!DispatchCheckVerify<void,<lambda_a44834317377756d5b8114aa20be44b3> >() [C:Program FilesEpic GamesUE_4.27EngineSourceRuntimeCorePublicMiscAssertionMacros.h:164]
UE4Editor_MathWorksSimulation!ASim3dVeh::ConfigureDefaultMesh() [C:TEMPBsim3d_2357499_7508homeDesktopSPplgMathWorksSimulationHostProjectPluginsMathWorksSimulationSourceMathWorksSimulationPrivateSim3dVeh.cpp:254]
UE4Editor_MathWorksSimulation!ASim3dPassVeh::Sim3dSetup() [C:TEMPBsim3d_2357499_7508homeDesktopSPplgMathWorksSimulationHostProjectPluginsMathWorksSimulationSourceMathWorksSimulationPrivateSim3dPassVeh.cpp:109]
UE4Editor_MathWorksSimulation!ASim3dActor::BeginPlay() [C:TEMPBsim3d_2357499_7508homeDesktopSPplgMathWorksSimulationHostProjectPluginsMathWorksSimulationSourceMathWorksSimulationPrivateSim3dActor.cpp:153]
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll automated driving toolbox, unrealengine, simulink, simulation3dvehiclewithgroundfollowing MATLAB Answers — New Questions
Exporting C++code to Visual Studio using the Simulink model yields incorrect results
I have a Simulink model that includes the Three Phase Breaker module, Three Phase Source module, and Switch module. After exporting C++code using Simulink coder and running it in visual studio 2022, the results are inconsistent with those running in Simulink.The Matlab version used is 2023a.I have a Simulink model that includes the Three Phase Breaker module, Three Phase Source module, and Switch module. After exporting C++code using Simulink coder and running it in visual studio 2022, the results are inconsistent with those running in Simulink.The Matlab version used is 2023a. I have a Simulink model that includes the Three Phase Breaker module, Three Phase Source module, and Switch module. After exporting C++code using Simulink coder and running it in visual studio 2022, the results are inconsistent with those running in Simulink.The Matlab version used is 2023a. simulink, c++, visual studio MATLAB Answers — New Questions