Category: Matlab
Category Archives: Matlab
Why does containers.Map(‘KeyType’,’double’) silently return a map with KeyType ‘char’ ?
I would have expected an error if the second argument is strictly required. Giving me a wrong map just pushes the error to runtime when I call it with an ‘double’ key. No idea what went into this design.I would have expected an error if the second argument is strictly required. Giving me a wrong map just pushes the error to runtime when I call it with an ‘double’ key. No idea what went into this design. I would have expected an error if the second argument is strictly required. Giving me a wrong map just pushes the error to runtime when I call it with an ‘double’ key. No idea what went into this design. containers map MATLAB Answers — New Questions
RoadRunner not responding after initial install
I have done a fresh install of RoadRunner 2024b and activated the license. Once RoadRunner screen loads, choose to create a new project and selected base without add-ons.
The screen goes blank and no longer responds.
This is a Azure VM with 16GB memory and when i check the log files the errors in the logs are as below:
——–RoadRunner R2024b Update 3 (1.9.3.059d0255441) Log Created on 2025-01-28 at 16:24:23——–
[16:24:23 Logger.cpp(35)] DEV: Logging messages to file ‘C:/Users/bhanu/AppData/Roaming/MathWorks/RoadRunner/R2024b/Logs/2025-01-28(4)/RoadRunner_Log.txt’
[16:24:23 LibraryInit.cpp(70)] Failed to load the Datasmith plugin: DLL load error 126
[16:24:23 LibraryInit.cpp(73)] To export to Unreal Datasmith, download the Unreal Engine prerequisites. For more information on Unreal Datasmith export requirements, see <a href="https://www.mathworks.com/help/roadrunner/ug/export-to-unreal-datasmith.html" style="color:#54b6ff">here</a>.
[16:24:23 pxphysxgpumoduleloader.cpp(123)] DEV: PhysX message: Failed to load PhysXGpu dll!
[16:24:23] Qt message: QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0%3
[16:24:23] Qt message: QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x144528bbfb0%3
[16:24:23 CoreApplication.cpp(141)] DEV: Application arguments: ‘C:Program FilesRoadRunner R2024bbinwin64AppRoadRunner.exe’
[16:25:17 DatasetInfo.cpp(60)] DEV: Creating new project
[16:25:25 DatasetInfo.cpp(70)] DEV: Loading project from ‘F:/bhanu/secondtest/project2’
[16:25:25 DatasetInfo.cpp(60)] DEV: Creating new scene
[16:25:25] Qt message: QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0%3
[16:25:25] Qt message: QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x1445d197cd0%3
[16:25:25] Qt message: QOpenGLWidget: Failed to create context%3
[16:25:26] Qt message: QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0%3
[16:25:26] Qt message: QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x1445d19a7f0%3I have done a fresh install of RoadRunner 2024b and activated the license. Once RoadRunner screen loads, choose to create a new project and selected base without add-ons.
The screen goes blank and no longer responds.
This is a Azure VM with 16GB memory and when i check the log files the errors in the logs are as below:
——–RoadRunner R2024b Update 3 (1.9.3.059d0255441) Log Created on 2025-01-28 at 16:24:23——–
[16:24:23 Logger.cpp(35)] DEV: Logging messages to file ‘C:/Users/bhanu/AppData/Roaming/MathWorks/RoadRunner/R2024b/Logs/2025-01-28(4)/RoadRunner_Log.txt’
[16:24:23 LibraryInit.cpp(70)] Failed to load the Datasmith plugin: DLL load error 126
[16:24:23 LibraryInit.cpp(73)] To export to Unreal Datasmith, download the Unreal Engine prerequisites. For more information on Unreal Datasmith export requirements, see <a href="https://www.mathworks.com/help/roadrunner/ug/export-to-unreal-datasmith.html" style="color:#54b6ff">here</a>.
[16:24:23 pxphysxgpumoduleloader.cpp(123)] DEV: PhysX message: Failed to load PhysXGpu dll!
[16:24:23] Qt message: QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0%3
[16:24:23] Qt message: QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x144528bbfb0%3
[16:24:23 CoreApplication.cpp(141)] DEV: Application arguments: ‘C:Program FilesRoadRunner R2024bbinwin64AppRoadRunner.exe’
[16:25:17 DatasetInfo.cpp(60)] DEV: Creating new project
[16:25:25 DatasetInfo.cpp(70)] DEV: Loading project from ‘F:/bhanu/secondtest/project2’
[16:25:25 DatasetInfo.cpp(60)] DEV: Creating new scene
[16:25:25] Qt message: QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0%3
[16:25:25] Qt message: QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x1445d197cd0%3
[16:25:25] Qt message: QOpenGLWidget: Failed to create context%3
[16:25:26] Qt message: QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0%3
[16:25:26] Qt message: QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x1445d19a7f0%3 I have done a fresh install of RoadRunner 2024b and activated the license. Once RoadRunner screen loads, choose to create a new project and selected base without add-ons.
The screen goes blank and no longer responds.
This is a Azure VM with 16GB memory and when i check the log files the errors in the logs are as below:
——–RoadRunner R2024b Update 3 (1.9.3.059d0255441) Log Created on 2025-01-28 at 16:24:23——–
[16:24:23 Logger.cpp(35)] DEV: Logging messages to file ‘C:/Users/bhanu/AppData/Roaming/MathWorks/RoadRunner/R2024b/Logs/2025-01-28(4)/RoadRunner_Log.txt’
[16:24:23 LibraryInit.cpp(70)] Failed to load the Datasmith plugin: DLL load error 126
[16:24:23 LibraryInit.cpp(73)] To export to Unreal Datasmith, download the Unreal Engine prerequisites. For more information on Unreal Datasmith export requirements, see <a href="https://www.mathworks.com/help/roadrunner/ug/export-to-unreal-datasmith.html" style="color:#54b6ff">here</a>.
[16:24:23 pxphysxgpumoduleloader.cpp(123)] DEV: PhysX message: Failed to load PhysXGpu dll!
[16:24:23] Qt message: QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0%3
[16:24:23] Qt message: QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x144528bbfb0%3
[16:24:23 CoreApplication.cpp(141)] DEV: Application arguments: ‘C:Program FilesRoadRunner R2024bbinwin64AppRoadRunner.exe’
[16:25:17 DatasetInfo.cpp(60)] DEV: Creating new project
[16:25:25 DatasetInfo.cpp(70)] DEV: Loading project from ‘F:/bhanu/secondtest/project2’
[16:25:25 DatasetInfo.cpp(60)] DEV: Creating new scene
[16:25:25] Qt message: QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0%3
[16:25:25] Qt message: QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x1445d197cd0%3
[16:25:25] Qt message: QOpenGLWidget: Failed to create context%3
[16:25:26] Qt message: QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0%3
[16:25:26] Qt message: QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x1445d19a7f0%3 roadrunner MATLAB Answers — New Questions
deepNetworkDesigner: autoscrolling, connection preservation, undoing, and landscaping
I am encountering several issues with deepNetworkDesigner.
(1) I have a large network whose layers do not fit entirely on one screen, or at least not at a magnification level that allows me to easily see, distinguish, and manipulate the layers. How do I connect one layer to a second layer that is off-screen? When I try to drag a connection wire toward the destination layer, the pane does not autoscroll to let me reach it.
(2) I have one layer A that fans out to many output layers C1,C2,…,CN. I now wish to replace A with a different layer. Is there a way to do that, without having to tediously and manually reconnect the N outputs? Similarly, what if I wish to insert a layer B, so that A now feeds only to B but it is B that fans out to C1,C2,C3,…CN. Again, can this be done without breaking all N connections and having to manually redraw them?
(3) Is there a way to undo a change to a network (something like Ctrl-Z)?
(4) Is there a way to reorient the pane so the network flows left to right, instead of top to bottom (something like a landscape mode, rather than portrait).I am encountering several issues with deepNetworkDesigner.
(1) I have a large network whose layers do not fit entirely on one screen, or at least not at a magnification level that allows me to easily see, distinguish, and manipulate the layers. How do I connect one layer to a second layer that is off-screen? When I try to drag a connection wire toward the destination layer, the pane does not autoscroll to let me reach it.
(2) I have one layer A that fans out to many output layers C1,C2,…,CN. I now wish to replace A with a different layer. Is there a way to do that, without having to tediously and manually reconnect the N outputs? Similarly, what if I wish to insert a layer B, so that A now feeds only to B but it is B that fans out to C1,C2,C3,…CN. Again, can this be done without breaking all N connections and having to manually redraw them?
(3) Is there a way to undo a change to a network (something like Ctrl-Z)?
(4) Is there a way to reorient the pane so the network flows left to right, instead of top to bottom (something like a landscape mode, rather than portrait). I am encountering several issues with deepNetworkDesigner.
(1) I have a large network whose layers do not fit entirely on one screen, or at least not at a magnification level that allows me to easily see, distinguish, and manipulate the layers. How do I connect one layer to a second layer that is off-screen? When I try to drag a connection wire toward the destination layer, the pane does not autoscroll to let me reach it.
(2) I have one layer A that fans out to many output layers C1,C2,…,CN. I now wish to replace A with a different layer. Is there a way to do that, without having to tediously and manually reconnect the N outputs? Similarly, what if I wish to insert a layer B, so that A now feeds only to B but it is B that fans out to C1,C2,C3,…CN. Again, can this be done without breaking all N connections and having to manually redraw them?
(3) Is there a way to undo a change to a network (something like Ctrl-Z)?
(4) Is there a way to reorient the pane so the network flows left to right, instead of top to bottom (something like a landscape mode, rather than portrait). deepnetworkdesigner MATLAB Answers — New Questions
Can a signal go to a server ? in simulink
In simulink, I want some incoming signals to be delayed before reaching their final destination. Because I want to have knowledge about how many signals are being delayed and other statistics, I want to use a server instead of a delay block to use its statistics option. Can a signal pass through a entity server? Any ideas?In simulink, I want some incoming signals to be delayed before reaching their final destination. Because I want to have knowledge about how many signals are being delayed and other statistics, I want to use a server instead of a delay block to use its statistics option. Can a signal pass through a entity server? Any ideas? In simulink, I want some incoming signals to be delayed before reaching their final destination. Because I want to have knowledge about how many signals are being delayed and other statistics, I want to use a server instead of a delay block to use its statistics option. Can a signal pass through a entity server? Any ideas? simulink, signal, server, delay MATLAB Answers — New Questions
not able to choose board nor port in arduino hardware setup dialog
in "Hardware Setup" dialog after choosing connection type(USB) and clicking Next button I am not able to choose any value from "choose board" nor "choose port" dropdowns. If I select it using mouse, it just doesn’t change, its value remind "select a value", if I try to change it using keyboard it looks like pressing down/up keys is just ignored…
any ideas, am I missing something?
ubuntu 24.04
matlab R2024b, trial licensein "Hardware Setup" dialog after choosing connection type(USB) and clicking Next button I am not able to choose any value from "choose board" nor "choose port" dropdowns. If I select it using mouse, it just doesn’t change, its value remind "select a value", if I try to change it using keyboard it looks like pressing down/up keys is just ignored…
any ideas, am I missing something?
ubuntu 24.04
matlab R2024b, trial license in "Hardware Setup" dialog after choosing connection type(USB) and clicking Next button I am not able to choose any value from "choose board" nor "choose port" dropdowns. If I select it using mouse, it just doesn’t change, its value remind "select a value", if I try to change it using keyboard it looks like pressing down/up keys is just ignored…
any ideas, am I missing something?
ubuntu 24.04
matlab R2024b, trial license arduino, hardware setup MATLAB Answers — New Questions
how to plot heat map with a 2d graph?
I am facing some troubles to plot this graph attached in the image , I dont know which commands to use , since it has 2d graph with a heat mapI am facing some troubles to plot this graph attached in the image , I dont know which commands to use , since it has 2d graph with a heat map I am facing some troubles to plot this graph attached in the image , I dont know which commands to use , since it has 2d graph with a heat map matlab, plotting MATLAB Answers — New Questions
Having different value for the same function
I have a simple function
P_MCH = [0.20598017,0.270460009,0.313455273];
P_TOL = [0.20598017,0.270460009,0.313455273];
P_H2 = [4.58803966,4.459079983,4.373089453];
Rp = @(p) p(1)* p(2)*P_MCH.*(1-P_TOL.*P_H2.^3/(P_MCH*316.8159);
While running the Rp is calculated as 0.74409.
In excel it is 0.715944
Can you help?I have a simple function
P_MCH = [0.20598017,0.270460009,0.313455273];
P_TOL = [0.20598017,0.270460009,0.313455273];
P_H2 = [4.58803966,4.459079983,4.373089453];
Rp = @(p) p(1)* p(2)*P_MCH.*(1-P_TOL.*P_H2.^3/(P_MCH*316.8159);
While running the Rp is calculated as 0.74409.
In excel it is 0.715944
Can you help? I have a simple function
P_MCH = [0.20598017,0.270460009,0.313455273];
P_TOL = [0.20598017,0.270460009,0.313455273];
P_H2 = [4.58803966,4.459079983,4.373089453];
Rp = @(p) p(1)* p(2)*P_MCH.*(1-P_TOL.*P_H2.^3/(P_MCH*316.8159);
While running the Rp is calculated as 0.74409.
In excel it is 0.715944
Can you help? function MATLAB Answers — New Questions
How can I improve this line of code perfomance wise?
When using the profiler to look at the performance of a function I need to work with, I saw that one line takes up much time
invalidIndex = any((coords<ddims(1:3)) | (coords>ddims(4:6)),2);
So it just checks if the point contained are within the bounds. The size of coords is nx3
Is there any way this line can be improved perfomance wise. I couldn’t think of anything else…When using the profiler to look at the performance of a function I need to work with, I saw that one line takes up much time
invalidIndex = any((coords<ddims(1:3)) | (coords>ddims(4:6)),2);
So it just checks if the point contained are within the bounds. The size of coords is nx3
Is there any way this line can be improved perfomance wise. I couldn’t think of anything else… When using the profiler to look at the performance of a function I need to work with, I saw that one line takes up much time
invalidIndex = any((coords<ddims(1:3)) | (coords>ddims(4:6)),2);
So it just checks if the point contained are within the bounds. The size of coords is nx3
Is there any way this line can be improved perfomance wise. I couldn’t think of anything else… performance, indexing MATLAB Answers — New Questions
Why does my system object get an assertion failure error
Hello all
I am kinda new in MATLAB/Simulink,and learning the multi-object tracking task based on simulink by Track Closely Spaced Targets Under Ambiguity in Simulink. I want to finish image tracking task. I already have the target detection result based on YOLO. When I was writing based on the HelperDataLogReader class in the example, an assertion failure occurred. But I have looked up a lot of relevant materials but can’t solve it, and I hope someone can help me. Here is my code and the target detection result of YOLO, thank you so much!
classdef (StrictDefaults)HelperDataReader < …
matlabshared.tracking.internal.SimulinkBusUtilities
% This is a helper block for example purposes and may be removed or
% modified in the future.
%
% Copyright 2019 The MathWorks, Inc.
properties(Constant, Access=protected)
pBusPrefix = ‘BusDataLogReader’
end
properties(Access = public, Nontunable)
Data
end
properties(Nontunable)
Frame = fusionCoordinateFrameType.Rectangular
end
properties(Access = private)
%pCurrentIndex
pCurrentIndex = 0
%pMaxIndex Saved the maximum time step index in the data file
pMaxIndex
end
methods
function obj = HelperDataReader(varargin)
% Constructor
setProperties(obj,nargin,varargin{:});
end
end
methods(Access=protected)
function [out, argsToBus] = defaultOutput(obj)
objAtt = struct(‘Score’,double(1));
out = struct(‘Time’,double(1),…
‘Measurement’,double(zeros(1, 4)),…
‘MeasurementNoise’,double(zeros(4)),…
‘SensorIndex’,double(0),…
‘ObjectClassID’,double(0),…
‘ObjectClassParameters’, [],…
‘ObjectAttributes’,objAtt);
argsToBus = {out};
end
% Currently only support simulink environment, so nothing to do
% here
function y = sendToBus(~,x,varargin)
[newx,num] = objDet2Struct(x);
y = struct(‘Detections’,newx,’NumDetections’,num);
end
function [det, time] = stepImpl(obj)
if ~obj.isEndOfData()
obj.pCurrentIndex = obj.pCurrentIndex + 1;
end
newDet = obj.Data.detections{obj.pCurrentIndex};
det = sendToBus(obj,newDet);
time = newDet(1).Time;
end
function setupImpl(obj, varargin)
obj.Data = load(‘PedestrianTrackingYOLODetections.mat’);
obj.pMaxIndex =numel(obj.Data.detections);
end
function loadObjectImpl(obj,s,wasLocked)
% Set properties in object obj to values in structure s
% Set public properties and states
loadObjectImpl@matlab.System(obj,s,wasLocked);
end
function status = isEndOfData(obj)
% Return true if end of data has been reached
status = (obj.pCurrentIndex == obj.pMaxIndex);
end
function s = saveObjectImpl(obj)
% Set properties in structure s to values in object obj
% Set public properties and states
s = saveObjectImpl@matlab.System(obj);
end
% function varargout = getOutputDataTypeImpl(obj)
% varargout{1} = getOutputDataTypeImpl@matlabshared.tracking.internal.SimulinkBusUtilities(obj);
% varargout{2} = "double";
% end
function str = getIconImpl(~)
str = sprintf(‘HelpernDataLognReader’);
end
function varargout = getOutputNamesImpl(~)
varargout{1} = sprintf(‘Detections’);
varargout{2} = sprintf(‘Time’);
end
function varargout = getInputNamesImpl(~)
varargout{1} = sprintf(‘In’);
end
function [out1,out2] = isOutputFixedSizeImpl(~)
out1 = true;
out2 = true;
end
function [out1,out2] = getOutputSizeImpl(~)
out1 = [1 1];
out2 = [1 1];
end
function [out1,out2] = isOutputComplexImpl(~)
out1 = false;
out2 = false;
end
end
methods(Static, Hidden)
function flag = isAllowedInSystemBlock
flag = true;
end
end
methods(Static, Access=protected)
function header = getHeaderImpl
% Define header panel for System block dialog
header = matlab.system.display.Header(…
‘Title’, ‘DataLogReader’, …
‘Text’, getHeaderText());
end
function simMode = getSimulateUsingImpl
% Return only allowed simulation mode in System block dialog
simMode = ‘Interpreted execution’;
end
function flag = showSimulateUsingImpl
% Return false if simulation mode hidden in System block dialog
flag = false;
end
end
end
function str = getHeaderText
str = sprintf(‘The DataLog reader reads a struct file and it outputs the detection and time.’);
end
function [yDet,num] = objDet2Struct(det)
num = numel(det);
for i =1:num
yDet(i) = struct(‘Time’,det(i).Time,…
‘Measurement’,det(i).Measurement,…
‘MeasurementNoise’,det(i).MeasurementNoise,…
‘SensorIndex’,det(i).SensorIndex,…
‘ObjectClassID’,det(i).ObjectClassID,…
‘ObjectClassParameters’, [],…
‘ObjectAttributes’,det(i).ObjectAttributes); %#ok<AGROW>
end
endHello all
I am kinda new in MATLAB/Simulink,and learning the multi-object tracking task based on simulink by Track Closely Spaced Targets Under Ambiguity in Simulink. I want to finish image tracking task. I already have the target detection result based on YOLO. When I was writing based on the HelperDataLogReader class in the example, an assertion failure occurred. But I have looked up a lot of relevant materials but can’t solve it, and I hope someone can help me. Here is my code and the target detection result of YOLO, thank you so much!
classdef (StrictDefaults)HelperDataReader < …
matlabshared.tracking.internal.SimulinkBusUtilities
% This is a helper block for example purposes and may be removed or
% modified in the future.
%
% Copyright 2019 The MathWorks, Inc.
properties(Constant, Access=protected)
pBusPrefix = ‘BusDataLogReader’
end
properties(Access = public, Nontunable)
Data
end
properties(Nontunable)
Frame = fusionCoordinateFrameType.Rectangular
end
properties(Access = private)
%pCurrentIndex
pCurrentIndex = 0
%pMaxIndex Saved the maximum time step index in the data file
pMaxIndex
end
methods
function obj = HelperDataReader(varargin)
% Constructor
setProperties(obj,nargin,varargin{:});
end
end
methods(Access=protected)
function [out, argsToBus] = defaultOutput(obj)
objAtt = struct(‘Score’,double(1));
out = struct(‘Time’,double(1),…
‘Measurement’,double(zeros(1, 4)),…
‘MeasurementNoise’,double(zeros(4)),…
‘SensorIndex’,double(0),…
‘ObjectClassID’,double(0),…
‘ObjectClassParameters’, [],…
‘ObjectAttributes’,objAtt);
argsToBus = {out};
end
% Currently only support simulink environment, so nothing to do
% here
function y = sendToBus(~,x,varargin)
[newx,num] = objDet2Struct(x);
y = struct(‘Detections’,newx,’NumDetections’,num);
end
function [det, time] = stepImpl(obj)
if ~obj.isEndOfData()
obj.pCurrentIndex = obj.pCurrentIndex + 1;
end
newDet = obj.Data.detections{obj.pCurrentIndex};
det = sendToBus(obj,newDet);
time = newDet(1).Time;
end
function setupImpl(obj, varargin)
obj.Data = load(‘PedestrianTrackingYOLODetections.mat’);
obj.pMaxIndex =numel(obj.Data.detections);
end
function loadObjectImpl(obj,s,wasLocked)
% Set properties in object obj to values in structure s
% Set public properties and states
loadObjectImpl@matlab.System(obj,s,wasLocked);
end
function status = isEndOfData(obj)
% Return true if end of data has been reached
status = (obj.pCurrentIndex == obj.pMaxIndex);
end
function s = saveObjectImpl(obj)
% Set properties in structure s to values in object obj
% Set public properties and states
s = saveObjectImpl@matlab.System(obj);
end
% function varargout = getOutputDataTypeImpl(obj)
% varargout{1} = getOutputDataTypeImpl@matlabshared.tracking.internal.SimulinkBusUtilities(obj);
% varargout{2} = "double";
% end
function str = getIconImpl(~)
str = sprintf(‘HelpernDataLognReader’);
end
function varargout = getOutputNamesImpl(~)
varargout{1} = sprintf(‘Detections’);
varargout{2} = sprintf(‘Time’);
end
function varargout = getInputNamesImpl(~)
varargout{1} = sprintf(‘In’);
end
function [out1,out2] = isOutputFixedSizeImpl(~)
out1 = true;
out2 = true;
end
function [out1,out2] = getOutputSizeImpl(~)
out1 = [1 1];
out2 = [1 1];
end
function [out1,out2] = isOutputComplexImpl(~)
out1 = false;
out2 = false;
end
end
methods(Static, Hidden)
function flag = isAllowedInSystemBlock
flag = true;
end
end
methods(Static, Access=protected)
function header = getHeaderImpl
% Define header panel for System block dialog
header = matlab.system.display.Header(…
‘Title’, ‘DataLogReader’, …
‘Text’, getHeaderText());
end
function simMode = getSimulateUsingImpl
% Return only allowed simulation mode in System block dialog
simMode = ‘Interpreted execution’;
end
function flag = showSimulateUsingImpl
% Return false if simulation mode hidden in System block dialog
flag = false;
end
end
end
function str = getHeaderText
str = sprintf(‘The DataLog reader reads a struct file and it outputs the detection and time.’);
end
function [yDet,num] = objDet2Struct(det)
num = numel(det);
for i =1:num
yDet(i) = struct(‘Time’,det(i).Time,…
‘Measurement’,det(i).Measurement,…
‘MeasurementNoise’,det(i).MeasurementNoise,…
‘SensorIndex’,det(i).SensorIndex,…
‘ObjectClassID’,det(i).ObjectClassID,…
‘ObjectClassParameters’, [],…
‘ObjectAttributes’,det(i).ObjectAttributes); %#ok<AGROW>
end
end Hello all
I am kinda new in MATLAB/Simulink,and learning the multi-object tracking task based on simulink by Track Closely Spaced Targets Under Ambiguity in Simulink. I want to finish image tracking task. I already have the target detection result based on YOLO. When I was writing based on the HelperDataLogReader class in the example, an assertion failure occurred. But I have looked up a lot of relevant materials but can’t solve it, and I hope someone can help me. Here is my code and the target detection result of YOLO, thank you so much!
classdef (StrictDefaults)HelperDataReader < …
matlabshared.tracking.internal.SimulinkBusUtilities
% This is a helper block for example purposes and may be removed or
% modified in the future.
%
% Copyright 2019 The MathWorks, Inc.
properties(Constant, Access=protected)
pBusPrefix = ‘BusDataLogReader’
end
properties(Access = public, Nontunable)
Data
end
properties(Nontunable)
Frame = fusionCoordinateFrameType.Rectangular
end
properties(Access = private)
%pCurrentIndex
pCurrentIndex = 0
%pMaxIndex Saved the maximum time step index in the data file
pMaxIndex
end
methods
function obj = HelperDataReader(varargin)
% Constructor
setProperties(obj,nargin,varargin{:});
end
end
methods(Access=protected)
function [out, argsToBus] = defaultOutput(obj)
objAtt = struct(‘Score’,double(1));
out = struct(‘Time’,double(1),…
‘Measurement’,double(zeros(1, 4)),…
‘MeasurementNoise’,double(zeros(4)),…
‘SensorIndex’,double(0),…
‘ObjectClassID’,double(0),…
‘ObjectClassParameters’, [],…
‘ObjectAttributes’,objAtt);
argsToBus = {out};
end
% Currently only support simulink environment, so nothing to do
% here
function y = sendToBus(~,x,varargin)
[newx,num] = objDet2Struct(x);
y = struct(‘Detections’,newx,’NumDetections’,num);
end
function [det, time] = stepImpl(obj)
if ~obj.isEndOfData()
obj.pCurrentIndex = obj.pCurrentIndex + 1;
end
newDet = obj.Data.detections{obj.pCurrentIndex};
det = sendToBus(obj,newDet);
time = newDet(1).Time;
end
function setupImpl(obj, varargin)
obj.Data = load(‘PedestrianTrackingYOLODetections.mat’);
obj.pMaxIndex =numel(obj.Data.detections);
end
function loadObjectImpl(obj,s,wasLocked)
% Set properties in object obj to values in structure s
% Set public properties and states
loadObjectImpl@matlab.System(obj,s,wasLocked);
end
function status = isEndOfData(obj)
% Return true if end of data has been reached
status = (obj.pCurrentIndex == obj.pMaxIndex);
end
function s = saveObjectImpl(obj)
% Set properties in structure s to values in object obj
% Set public properties and states
s = saveObjectImpl@matlab.System(obj);
end
% function varargout = getOutputDataTypeImpl(obj)
% varargout{1} = getOutputDataTypeImpl@matlabshared.tracking.internal.SimulinkBusUtilities(obj);
% varargout{2} = "double";
% end
function str = getIconImpl(~)
str = sprintf(‘HelpernDataLognReader’);
end
function varargout = getOutputNamesImpl(~)
varargout{1} = sprintf(‘Detections’);
varargout{2} = sprintf(‘Time’);
end
function varargout = getInputNamesImpl(~)
varargout{1} = sprintf(‘In’);
end
function [out1,out2] = isOutputFixedSizeImpl(~)
out1 = true;
out2 = true;
end
function [out1,out2] = getOutputSizeImpl(~)
out1 = [1 1];
out2 = [1 1];
end
function [out1,out2] = isOutputComplexImpl(~)
out1 = false;
out2 = false;
end
end
methods(Static, Hidden)
function flag = isAllowedInSystemBlock
flag = true;
end
end
methods(Static, Access=protected)
function header = getHeaderImpl
% Define header panel for System block dialog
header = matlab.system.display.Header(…
‘Title’, ‘DataLogReader’, …
‘Text’, getHeaderText());
end
function simMode = getSimulateUsingImpl
% Return only allowed simulation mode in System block dialog
simMode = ‘Interpreted execution’;
end
function flag = showSimulateUsingImpl
% Return false if simulation mode hidden in System block dialog
flag = false;
end
end
end
function str = getHeaderText
str = sprintf(‘The DataLog reader reads a struct file and it outputs the detection and time.’);
end
function [yDet,num] = objDet2Struct(det)
num = numel(det);
for i =1:num
yDet(i) = struct(‘Time’,det(i).Time,…
‘Measurement’,det(i).Measurement,…
‘MeasurementNoise’,det(i).MeasurementNoise,…
‘SensorIndex’,det(i).SensorIndex,…
‘ObjectClassID’,det(i).ObjectClassID,…
‘ObjectClassParameters’, [],…
‘ObjectAttributes’,det(i).ObjectAttributes); %#ok<AGROW>
end
end multi-object tracking, sensor fusion and tracking toolbox, system object MATLAB Answers — New Questions
How to convert rpm on m/s in this model ssc_pneumatic_motor?
How to convert rpm on m/s in this model ssc_pneumatic_motor?How to convert rpm on m/s in this model ssc_pneumatic_motor? How to convert rpm on m/s in this model ssc_pneumatic_motor? ssc_pneumatic_motor, power_electronics_control, electric_motor_control MATLAB Answers — New Questions
Pose Estimation and Orientation for a UAV in MATLAB
I have the following data:
Ax, Ay, Az (m/s^2) – update rate 10 Hz
Gx, Gy, Gz (rad/s) – update rate 10 Hz
GPS LLA (deg deg meters) – update rate 2 Hz
Roll, Pitch, Yaw (degrees) update rate 10 Hz
I want to develop a GNSS aided INS.
I am following the example given below:
https://www.mathworks.com/help/nav/ug/imu-and-gps-fusion-for-inertial-navigation.html
trajOrient = trajData.Orientation;
I got this using the below code:
%%
clear all;
close all;
clc;
%%
%Load sensor data
load IMUData.mat IMUData;
accelerometerReadings = IMUData(:, 2:4);
gyroscopeReadings = IMUData(:, 5:7);
%% Sampling Rate
imuFs = 10; %Hz
decim = 1;
fuse = imufilter(‘SampleRate’,imuFs,’DecimationFactor’,decim, ‘ReferenceFrame’, ‘ENU’,’AccelerometerNoise’,1e-6, ‘GyroscopeDriftNoise’,1e-6);
%%
OrientationData = fuse(accelerometerReadings,gyroscopeReadings);
trajVel = trajData.Velocity;
How do I get this data?
trajPos = trajData.Position;
How do I get this data?
trajAcc = trajData.Acceleration;
accelerometerReadings = IMUData(:, 2:4);
trajAngVel = trajData.AngularVelocity;
gyroscopeReadings = IMUData(:, 5:7);
Also, I do not have magnetometer. I have to do it using acc-gyro only.
initstate = [1-4 % Orientation as a quaternion
5-7 % Position (NED) %but my frame is in NEU maybe
8-10 % Velocity (NED)
11-13 % Delta Angle Bias (XYZ)
14-16 % Delta Velocity Bias (XYZ)
17-19; % Geomagnetic Field Vector (NED)
20-22] % Magnetometer Bias (XYZ)
How can I proceed with this?I have the following data:
Ax, Ay, Az (m/s^2) – update rate 10 Hz
Gx, Gy, Gz (rad/s) – update rate 10 Hz
GPS LLA (deg deg meters) – update rate 2 Hz
Roll, Pitch, Yaw (degrees) update rate 10 Hz
I want to develop a GNSS aided INS.
I am following the example given below:
https://www.mathworks.com/help/nav/ug/imu-and-gps-fusion-for-inertial-navigation.html
trajOrient = trajData.Orientation;
I got this using the below code:
%%
clear all;
close all;
clc;
%%
%Load sensor data
load IMUData.mat IMUData;
accelerometerReadings = IMUData(:, 2:4);
gyroscopeReadings = IMUData(:, 5:7);
%% Sampling Rate
imuFs = 10; %Hz
decim = 1;
fuse = imufilter(‘SampleRate’,imuFs,’DecimationFactor’,decim, ‘ReferenceFrame’, ‘ENU’,’AccelerometerNoise’,1e-6, ‘GyroscopeDriftNoise’,1e-6);
%%
OrientationData = fuse(accelerometerReadings,gyroscopeReadings);
trajVel = trajData.Velocity;
How do I get this data?
trajPos = trajData.Position;
How do I get this data?
trajAcc = trajData.Acceleration;
accelerometerReadings = IMUData(:, 2:4);
trajAngVel = trajData.AngularVelocity;
gyroscopeReadings = IMUData(:, 5:7);
Also, I do not have magnetometer. I have to do it using acc-gyro only.
initstate = [1-4 % Orientation as a quaternion
5-7 % Position (NED) %but my frame is in NEU maybe
8-10 % Velocity (NED)
11-13 % Delta Angle Bias (XYZ)
14-16 % Delta Velocity Bias (XYZ)
17-19; % Geomagnetic Field Vector (NED)
20-22] % Magnetometer Bias (XYZ)
How can I proceed with this? I have the following data:
Ax, Ay, Az (m/s^2) – update rate 10 Hz
Gx, Gy, Gz (rad/s) – update rate 10 Hz
GPS LLA (deg deg meters) – update rate 2 Hz
Roll, Pitch, Yaw (degrees) update rate 10 Hz
I want to develop a GNSS aided INS.
I am following the example given below:
https://www.mathworks.com/help/nav/ug/imu-and-gps-fusion-for-inertial-navigation.html
trajOrient = trajData.Orientation;
I got this using the below code:
%%
clear all;
close all;
clc;
%%
%Load sensor data
load IMUData.mat IMUData;
accelerometerReadings = IMUData(:, 2:4);
gyroscopeReadings = IMUData(:, 5:7);
%% Sampling Rate
imuFs = 10; %Hz
decim = 1;
fuse = imufilter(‘SampleRate’,imuFs,’DecimationFactor’,decim, ‘ReferenceFrame’, ‘ENU’,’AccelerometerNoise’,1e-6, ‘GyroscopeDriftNoise’,1e-6);
%%
OrientationData = fuse(accelerometerReadings,gyroscopeReadings);
trajVel = trajData.Velocity;
How do I get this data?
trajPos = trajData.Position;
How do I get this data?
trajAcc = trajData.Acceleration;
accelerometerReadings = IMUData(:, 2:4);
trajAngVel = trajData.AngularVelocity;
gyroscopeReadings = IMUData(:, 5:7);
Also, I do not have magnetometer. I have to do it using acc-gyro only.
initstate = [1-4 % Orientation as a quaternion
5-7 % Position (NED) %but my frame is in NEU maybe
8-10 % Velocity (NED)
11-13 % Delta Angle Bias (XYZ)
14-16 % Delta Velocity Bias (XYZ)
17-19; % Geomagnetic Field Vector (NED)
20-22] % Magnetometer Bias (XYZ)
How can I proceed with this? inertial navigation, gps, localization, ekf MATLAB Answers — New Questions
How can I reach the desired rotor speed of a three phase PMSM motor using a PI-Controller?
For study purposes I modelled the Speed controlling of a DC-Motor on Matlab-Simscape using a controlled voltage source, a saturation for the Amplitude of the voltage input and a PI-Controller to control the Motor to rotate with the (desired) controlled rotor speed. This worked properly. (dont mind the blue outliers of the blue signal in the second picture (probably due to the I-Parameter of the PI-Controller).
See the DC-Motor speed (w) controlling and also the signal of both the desired one and actual one:
Now I got a task to do, which is to convert the DC-Motor into a three phase PMSM Motor under the same circumstances, which means I have to get the same rotor speed as the desired one and the same inertia of the motor as an output like the DC-Motor.Here is what I did:
I used the same PI-Controller but a mux as an output of three saturations and used a three phase controlled voltage soure for the motor.
Now both the desired rotor speed and the actual one look nearly also the same (except the outliers propably due to the P-Parameter).
What I dont understand ist that in the display I get the see weird rotor speed values with (e-5 to e-15) which nearly equals 0:
As if I am not 100% if I constructed the PMSM Model without mistaked, especially since the 3 currents of the three phases are not in a sinusoidal or repetitional nor with a shifted shape.. See the current signals..
I am looking for any suggestions how to build this or where might be the errors.
here are the settings of both motors from both models:
PMSM:
DC-Motor:
I used the same PI-Controller settings and also the same saturation and also Pulse Generator values… (for the PMSM I used 3 saturations since the three phase voltage source has 3 voltage inputs). Not sure If this is wrong and there is a correct way to do this..
Any help would be much appreciated! Thanks a lot in advance!For study purposes I modelled the Speed controlling of a DC-Motor on Matlab-Simscape using a controlled voltage source, a saturation for the Amplitude of the voltage input and a PI-Controller to control the Motor to rotate with the (desired) controlled rotor speed. This worked properly. (dont mind the blue outliers of the blue signal in the second picture (probably due to the I-Parameter of the PI-Controller).
See the DC-Motor speed (w) controlling and also the signal of both the desired one and actual one:
Now I got a task to do, which is to convert the DC-Motor into a three phase PMSM Motor under the same circumstances, which means I have to get the same rotor speed as the desired one and the same inertia of the motor as an output like the DC-Motor.Here is what I did:
I used the same PI-Controller but a mux as an output of three saturations and used a three phase controlled voltage soure for the motor.
Now both the desired rotor speed and the actual one look nearly also the same (except the outliers propably due to the P-Parameter).
What I dont understand ist that in the display I get the see weird rotor speed values with (e-5 to e-15) which nearly equals 0:
As if I am not 100% if I constructed the PMSM Model without mistaked, especially since the 3 currents of the three phases are not in a sinusoidal or repetitional nor with a shifted shape.. See the current signals..
I am looking for any suggestions how to build this or where might be the errors.
here are the settings of both motors from both models:
PMSM:
DC-Motor:
I used the same PI-Controller settings and also the same saturation and also Pulse Generator values… (for the PMSM I used 3 saturations since the three phase voltage source has 3 voltage inputs). Not sure If this is wrong and there is a correct way to do this..
Any help would be much appreciated! Thanks a lot in advance! For study purposes I modelled the Speed controlling of a DC-Motor on Matlab-Simscape using a controlled voltage source, a saturation for the Amplitude of the voltage input and a PI-Controller to control the Motor to rotate with the (desired) controlled rotor speed. This worked properly. (dont mind the blue outliers of the blue signal in the second picture (probably due to the I-Parameter of the PI-Controller).
See the DC-Motor speed (w) controlling and also the signal of both the desired one and actual one:
Now I got a task to do, which is to convert the DC-Motor into a three phase PMSM Motor under the same circumstances, which means I have to get the same rotor speed as the desired one and the same inertia of the motor as an output like the DC-Motor.Here is what I did:
I used the same PI-Controller but a mux as an output of three saturations and used a three phase controlled voltage soure for the motor.
Now both the desired rotor speed and the actual one look nearly also the same (except the outliers propably due to the P-Parameter).
What I dont understand ist that in the display I get the see weird rotor speed values with (e-5 to e-15) which nearly equals 0:
As if I am not 100% if I constructed the PMSM Model without mistaked, especially since the 3 currents of the three phases are not in a sinusoidal or repetitional nor with a shifted shape.. See the current signals..
I am looking for any suggestions how to build this or where might be the errors.
here are the settings of both motors from both models:
PMSM:
DC-Motor:
I used the same PI-Controller settings and also the same saturation and also Pulse Generator values… (for the PMSM I used 3 saturations since the three phase voltage source has 3 voltage inputs). Not sure If this is wrong and there is a correct way to do this..
Any help would be much appreciated! Thanks a lot in advance! electric_motor_control, matlab compiler, simulink, simulation, simscape, model MATLAB Answers — New Questions
4 pin SIC FET Model in MATLAB
I am running a circuit simulation in MATLAB that has a 4 pin SIC FET. These pins include Drain, Gate and two Source pins.
The library of the part number is available from manufacturer website in .LIB and include subcircuit model of the 4 pin FET component.
I am basically using this link below to generate thae MATLAB model for this part using lookup table generation approach from subcircuit model:
https://www.mathworks.com/help/sps/ref/ee.spice.semiconductorsubcircuit2lookup.html
I am getting an error related to SIMetrix as attachement. Does matlab use SIMetrix engin for this model conversion? How I can fix this error? I have already installed SIMetrix at the mentioned directory in attachement.I am running a circuit simulation in MATLAB that has a 4 pin SIC FET. These pins include Drain, Gate and two Source pins.
The library of the part number is available from manufacturer website in .LIB and include subcircuit model of the 4 pin FET component.
I am basically using this link below to generate thae MATLAB model for this part using lookup table generation approach from subcircuit model:
https://www.mathworks.com/help/sps/ref/ee.spice.semiconductorsubcircuit2lookup.html
I am getting an error related to SIMetrix as attachement. Does matlab use SIMetrix engin for this model conversion? How I can fix this error? I have already installed SIMetrix at the mentioned directory in attachement. I am running a circuit simulation in MATLAB that has a 4 pin SIC FET. These pins include Drain, Gate and two Source pins.
The library of the part number is available from manufacturer website in .LIB and include subcircuit model of the 4 pin FET component.
I am basically using this link below to generate thae MATLAB model for this part using lookup table generation approach from subcircuit model:
https://www.mathworks.com/help/sps/ref/ee.spice.semiconductorsubcircuit2lookup.html
I am getting an error related to SIMetrix as attachement. Does matlab use SIMetrix engin for this model conversion? How I can fix this error? I have already installed SIMetrix at the mentioned directory in attachement. circuit model, spice, sic fet, 4 pin fet MATLAB Answers — New Questions
Why ,the quaternion values from sensor fusion toolbox are switched ?
Hello everyone,
I am using the Sensor Fusion and Tracking Toolbox. I have raw data from accelerometer and gyroscope.. I imported them to matlab and logged them to imufilter in order to estimate the orientation. ( i want to compare the results of matlab with my own algorithm for gettting the orientation)
However, The quaternions estimated from the toolbox have an unexpected behavior.
the i (x-axis) values are switched with the w values (the real part). So for example , the initial quaternions are someting like 0.0023 + 0.99i -0.001k + 0.001j.
and going along the data set .. it seems they are so similar to my orientation output except that the values of i and w components are switched. I wanted to know why ? or what i am doing wrong. Thank you
Update: I have now transformed the quaternions to normal vectors using (compact) and I noticed the following when I compared the results from the toolbox and results from my alogrithm (assuming Q = [w,x,y,z]) :
The scalar w component is at i (x) and has an inversed sign
The x compnent is at w position with the same sign
The y component is at the z position with an inversed sign
The z component is at the y position with the same signHello everyone,
I am using the Sensor Fusion and Tracking Toolbox. I have raw data from accelerometer and gyroscope.. I imported them to matlab and logged them to imufilter in order to estimate the orientation. ( i want to compare the results of matlab with my own algorithm for gettting the orientation)
However, The quaternions estimated from the toolbox have an unexpected behavior.
the i (x-axis) values are switched with the w values (the real part). So for example , the initial quaternions are someting like 0.0023 + 0.99i -0.001k + 0.001j.
and going along the data set .. it seems they are so similar to my orientation output except that the values of i and w components are switched. I wanted to know why ? or what i am doing wrong. Thank you
Update: I have now transformed the quaternions to normal vectors using (compact) and I noticed the following when I compared the results from the toolbox and results from my alogrithm (assuming Q = [w,x,y,z]) :
The scalar w component is at i (x) and has an inversed sign
The x compnent is at w position with the same sign
The y component is at the z position with an inversed sign
The z component is at the y position with the same sign Hello everyone,
I am using the Sensor Fusion and Tracking Toolbox. I have raw data from accelerometer and gyroscope.. I imported them to matlab and logged them to imufilter in order to estimate the orientation. ( i want to compare the results of matlab with my own algorithm for gettting the orientation)
However, The quaternions estimated from the toolbox have an unexpected behavior.
the i (x-axis) values are switched with the w values (the real part). So for example , the initial quaternions are someting like 0.0023 + 0.99i -0.001k + 0.001j.
and going along the data set .. it seems they are so similar to my orientation output except that the values of i and w components are switched. I wanted to know why ? or what i am doing wrong. Thank you
Update: I have now transformed the quaternions to normal vectors using (compact) and I noticed the following when I compared the results from the toolbox and results from my alogrithm (assuming Q = [w,x,y,z]) :
The scalar w component is at i (x) and has an inversed sign
The x compnent is at w position with the same sign
The y component is at the z position with an inversed sign
The z component is at the y position with the same sign imu, sensor fusion, orientation, quaternion MATLAB Answers — New Questions
Why does DQ Current control of 3 phase inverter work with Simscape SPS components but not with Simscape Electrical components?
Hi Community,
I am building a current controller for a three phase inverter in the dq frame. I have two models. Both are attached here.
Model 1 is built with Simscape Specialised Pwer systems library components &
Model 2 has components from Simscape electrical.
Expected Results – Measured Id and Iq should follow the setpoint/references provided for each respectively. As there is PID control involved there will be some overshoot, rise time etc as expected, but eventually steady state values should converge to the reference.
With all the parameters and controller design same (to the best of my knowledge) I see desired results with Model 1 but not with Model 2. Any ideas why this could be happening?
Model 1
Model 1 results
Model 2
Model 2 results
This result not does not follow the setpoint but also becomes unstable. The PID parameters are the same but could there be a need for different tuning? If so why, since the input output ranges should be similar as all the other parameters are the same.
Due credit for Model 1
"Syed Abdul Rahman Kashif (2025). Grid Tied Inverter with Current Controller (https://www.mathworks.com/matlabcentral/fileexchange/130854-grid-tied-inverter-with-current-controller), MATLAB Central File Exchange. Retrieved January 31, 2025."Hi Community,
I am building a current controller for a three phase inverter in the dq frame. I have two models. Both are attached here.
Model 1 is built with Simscape Specialised Pwer systems library components &
Model 2 has components from Simscape electrical.
Expected Results – Measured Id and Iq should follow the setpoint/references provided for each respectively. As there is PID control involved there will be some overshoot, rise time etc as expected, but eventually steady state values should converge to the reference.
With all the parameters and controller design same (to the best of my knowledge) I see desired results with Model 1 but not with Model 2. Any ideas why this could be happening?
Model 1
Model 1 results
Model 2
Model 2 results
This result not does not follow the setpoint but also becomes unstable. The PID parameters are the same but could there be a need for different tuning? If so why, since the input output ranges should be similar as all the other parameters are the same.
Due credit for Model 1
"Syed Abdul Rahman Kashif (2025). Grid Tied Inverter with Current Controller (https://www.mathworks.com/matlabcentral/fileexchange/130854-grid-tied-inverter-with-current-controller), MATLAB Central File Exchange. Retrieved January 31, 2025." Hi Community,
I am building a current controller for a three phase inverter in the dq frame. I have two models. Both are attached here.
Model 1 is built with Simscape Specialised Pwer systems library components &
Model 2 has components from Simscape electrical.
Expected Results – Measured Id and Iq should follow the setpoint/references provided for each respectively. As there is PID control involved there will be some overshoot, rise time etc as expected, but eventually steady state values should converge to the reference.
With all the parameters and controller design same (to the best of my knowledge) I see desired results with Model 1 but not with Model 2. Any ideas why this could be happening?
Model 1
Model 1 results
Model 2
Model 2 results
This result not does not follow the setpoint but also becomes unstable. The PID parameters are the same but could there be a need for different tuning? If so why, since the input output ranges should be similar as all the other parameters are the same.
Due credit for Model 1
"Syed Abdul Rahman Kashif (2025). Grid Tied Inverter with Current Controller (https://www.mathworks.com/matlabcentral/fileexchange/130854-grid-tied-inverter-with-current-controller), MATLAB Central File Exchange. Retrieved January 31, 2025." dq control, current control, pq control, three phase inverter, mmc, simscape sps, simscape electrical MATLAB Answers — New Questions
Battery from library does not connect!
I have been trying to introduce a simple battery in my Simulink model. The 2 batteries included in the Matlab library cannot connect on any node. These batteries are the "elec_lib/Sources/Battery" and "elec_lib/Sources/Battery(Table-Based)". The help button for these blocks does not work either. Can anyone help?I have been trying to introduce a simple battery in my Simulink model. The 2 batteries included in the Matlab library cannot connect on any node. These batteries are the "elec_lib/Sources/Battery" and "elec_lib/Sources/Battery(Table-Based)". The help button for these blocks does not work either. Can anyone help? I have been trying to introduce a simple battery in my Simulink model. The 2 batteries included in the Matlab library cannot connect on any node. These batteries are the "elec_lib/Sources/Battery" and "elec_lib/Sources/Battery(Table-Based)". The help button for these blocks does not work either. Can anyone help? battery, simulink, power_electronics_control, battery_system_management MATLAB Answers — New Questions
How is the three-phase transformer with three windings modelled?
No equations for the modelling of the transformer with three windings are provided in the documentation. This would be however very helpful for an exact current control design of a grid converter. Is there any documentation available?No equations for the modelling of the transformer with three windings are provided in the documentation. This would be however very helpful for an exact current control design of a grid converter. Is there any documentation available? No equations for the modelling of the transformer with three windings are provided in the documentation. This would be however very helpful for an exact current control design of a grid converter. Is there any documentation available? transformer three windings MATLAB Answers — New Questions
Load flow app showing error
Doing load flow analysis in simulink of the following problem. The model runs without any error, but when using load flow app it shows "An error in the model prevented the load flow analysis".
I have attached the simulation file.
Thanks.Doing load flow analysis in simulink of the following problem. The model runs without any error, but when using load flow app it shows "An error in the model prevented the load flow analysis".
I have attached the simulation file.
Thanks. Doing load flow analysis in simulink of the following problem. The model runs without any error, but when using load flow app it shows "An error in the model prevented the load flow analysis".
I have attached the simulation file.
Thanks. load flow MATLAB Answers — New Questions
rtwbuildmatsim脚本执行过程报错:Error during script execution: coder.make.internal.getTMF:unable to locate template makefile: matsim_lcc64.tmf
我正在尝试使用rtwbuildmatsim脚本导出tutorial_matsim_start_spr_dmp_01.mdl的Simulink模型。
I am trying to export a Simulink model of tutorial_matsim_start_spr_dmp_01.mdl using the rtwbuildmatsim script.
之前在Simulink的Simulation菜单下的Model Configuration Parameters中选择的导出的目标文件类型为matsim.tlc。
The export target file type selected in Model Configuration Parameters under the Simulation menu of Simulink is matsim.tlc.
在执行脚本的过程中,发生了报错:unable to locate template makefile: matsim_lcc64.tmf
An error occurred while executing the script: unable to locate template makefile: matsim_lcc64.tmf
我从报错上判断问题就是MATLAB没有找到模板文件matsim_lcc64.tmf。然而我搜索了MATLAB的所有文件均未找到该模板文件。我搜索过该文件的版本包括MATLAB 2021b20219b2015a。我选择的编译器为MinGW 6.3。
I judged from the error that the problem was that MATLAB did not find the template file matsim_lcc64.tmf. However, I searched all the files in MATLAB and could not find the template file. I have searched for versions of this file including MATLAB 2021b20219b2015a. The compiler I chose is MinGW 6.3.
感谢您的帮助!
Thank you for your help!
附:报错全部内容:
Attached: All contents of the error:
### Generating code and artifacts to ‘Model specific’ folder structure ### Generating code into build folder: E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw 警告: Model ‘tutorial_matsim_start_spr_dmp_01’ is using a default value of 0.2 for maximum step size. You can disable this diagnostic by setting Automatic solver parameter selection to ‘none’ ### Invoking Target Language Compiler on tutorial_matsim_start_spr_dmp_01.rtw ### Using System Target File: E:SOFTMATLABR2019brtwcrtwsfcnrtwsfcn.tlc ### Loading TLC function libraries …. ### Initial pass through model to cache user defined code . ### Caching model source code …………………. ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_types.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sf.h ### Writing header file rtwtypes.h . ### Writing header file multiword_types.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf.c ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_private.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sid.h ### Writing header file tutorial_matsim_start_spr_dmp_01_mid.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf_data.c ### Writing header file rtGetNaN.h . ### Writing source file rtGetNaN.c ### Writing header file rt_nonfinite.h ### Writing source file rt_nonfinite.c ### Writing header file rt_defines.h ### Writing header file rtGetInf.h ### Writing source file rtGetInf.c . ### TLC code generation complete. ### Using toolchain: MinGW64 | gmake (64-bit Windows) ### Creating ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtwtutorial_matsim_start_spr_dmp_01.mk’ … ### Building ‘tutorial_matsim_start_spr_dmp_01_sf’: "E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>cd . E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>if "" == "" ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all ) else ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk ) "### Successfully generated all binary outputs." E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>exit 0 mex -f E:SOFTMATLABR2019bbinwin64mexoptsmingw64.xml -R2018a -outdir .. ‘CFLAGS=$CFLAGS -Wno-overlength-strings -pedantic -Wno-long-long -Wno-declaration-after-statement -fwrapv’ -DMODEL=tutorial_matsim_start_spr_dmp_01 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DTID01EQ=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 COPTIMFLAGS=-O0 -I.. -I..tutorial_matsim_start_spr_dmp_01_sfcn_rtw -IE:SOFTMATLABR2019bexterninclude -IE:SOFTMATLABR2019bsimulinkinclude -IE:SOFTMATLABR2019brtwcsrc tutorial_matsim_start_spr_dmp_01_sf.c rtGetInf.c rtGetNaN.c tutorial_matsim_start_spr_dmp_01_sf_data.c -LE:SOFTMATLABR2019bexternlibwin64mingw64 -lut -lfixedpoint ### Created mex file: ..tutorial_matsim_start_spr_dmp_01_sf.mexw64 ### Simulink cache artifacts for ‘tutorial_matsim_start_spr_dmp_01’ were created in ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01.slxc’. 错误使用 getTMF Unable to locate template makefile: matsim_lcc64.tmf 出错 rtwprivate (line 16) [varargout{1:nargout}] = feval(function_name, varargin{1:end}); 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.ModelCompInfo/createModelCompInfoPrivate 出错 coder.internal.ModelCompInfo.createModelCompInfo 出错 slbuild_private 出错 sl (line 15) [varargout{1:nargout}]=feval(varargin{:}); 出错 slbuild (line 98) sl(‘slbuild_private’, mdl, target, varargin{2:end}); 出错 rtwbuild (line 235) slbuild(sys, ‘StandaloneCoderTarget’, … 出错 rtwbuildmatsim (line 70) rtwbuild(p.Results.model); – Show complete stack trace Displaying stack trace: Error using getTMF • In getTMF • In rtwprivate (line 16) • In coder.internal.getMexCompilerForModel • In coder.internal.getMexCompilerForModel • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfoPrivate • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfo • In slbuild_private • In sl (line 15) • In slbuild (line 98) • In rtwbuild (line 235) • In rtwbuildmatsim (line 70)我正在尝试使用rtwbuildmatsim脚本导出tutorial_matsim_start_spr_dmp_01.mdl的Simulink模型。
I am trying to export a Simulink model of tutorial_matsim_start_spr_dmp_01.mdl using the rtwbuildmatsim script.
之前在Simulink的Simulation菜单下的Model Configuration Parameters中选择的导出的目标文件类型为matsim.tlc。
The export target file type selected in Model Configuration Parameters under the Simulation menu of Simulink is matsim.tlc.
在执行脚本的过程中,发生了报错:unable to locate template makefile: matsim_lcc64.tmf
An error occurred while executing the script: unable to locate template makefile: matsim_lcc64.tmf
我从报错上判断问题就是MATLAB没有找到模板文件matsim_lcc64.tmf。然而我搜索了MATLAB的所有文件均未找到该模板文件。我搜索过该文件的版本包括MATLAB 2021b20219b2015a。我选择的编译器为MinGW 6.3。
I judged from the error that the problem was that MATLAB did not find the template file matsim_lcc64.tmf. However, I searched all the files in MATLAB and could not find the template file. I have searched for versions of this file including MATLAB 2021b20219b2015a. The compiler I chose is MinGW 6.3.
感谢您的帮助!
Thank you for your help!
附:报错全部内容:
Attached: All contents of the error:
### Generating code and artifacts to ‘Model specific’ folder structure ### Generating code into build folder: E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw 警告: Model ‘tutorial_matsim_start_spr_dmp_01’ is using a default value of 0.2 for maximum step size. You can disable this diagnostic by setting Automatic solver parameter selection to ‘none’ ### Invoking Target Language Compiler on tutorial_matsim_start_spr_dmp_01.rtw ### Using System Target File: E:SOFTMATLABR2019brtwcrtwsfcnrtwsfcn.tlc ### Loading TLC function libraries …. ### Initial pass through model to cache user defined code . ### Caching model source code …………………. ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_types.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sf.h ### Writing header file rtwtypes.h . ### Writing header file multiword_types.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf.c ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_private.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sid.h ### Writing header file tutorial_matsim_start_spr_dmp_01_mid.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf_data.c ### Writing header file rtGetNaN.h . ### Writing source file rtGetNaN.c ### Writing header file rt_nonfinite.h ### Writing source file rt_nonfinite.c ### Writing header file rt_defines.h ### Writing header file rtGetInf.h ### Writing source file rtGetInf.c . ### TLC code generation complete. ### Using toolchain: MinGW64 | gmake (64-bit Windows) ### Creating ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtwtutorial_matsim_start_spr_dmp_01.mk’ … ### Building ‘tutorial_matsim_start_spr_dmp_01_sf’: "E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>cd . E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>if "" == "" ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all ) else ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk ) "### Successfully generated all binary outputs." E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>exit 0 mex -f E:SOFTMATLABR2019bbinwin64mexoptsmingw64.xml -R2018a -outdir .. ‘CFLAGS=$CFLAGS -Wno-overlength-strings -pedantic -Wno-long-long -Wno-declaration-after-statement -fwrapv’ -DMODEL=tutorial_matsim_start_spr_dmp_01 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DTID01EQ=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 COPTIMFLAGS=-O0 -I.. -I..tutorial_matsim_start_spr_dmp_01_sfcn_rtw -IE:SOFTMATLABR2019bexterninclude -IE:SOFTMATLABR2019bsimulinkinclude -IE:SOFTMATLABR2019brtwcsrc tutorial_matsim_start_spr_dmp_01_sf.c rtGetInf.c rtGetNaN.c tutorial_matsim_start_spr_dmp_01_sf_data.c -LE:SOFTMATLABR2019bexternlibwin64mingw64 -lut -lfixedpoint ### Created mex file: ..tutorial_matsim_start_spr_dmp_01_sf.mexw64 ### Simulink cache artifacts for ‘tutorial_matsim_start_spr_dmp_01’ were created in ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01.slxc’. 错误使用 getTMF Unable to locate template makefile: matsim_lcc64.tmf 出错 rtwprivate (line 16) [varargout{1:nargout}] = feval(function_name, varargin{1:end}); 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.ModelCompInfo/createModelCompInfoPrivate 出错 coder.internal.ModelCompInfo.createModelCompInfo 出错 slbuild_private 出错 sl (line 15) [varargout{1:nargout}]=feval(varargin{:}); 出错 slbuild (line 98) sl(‘slbuild_private’, mdl, target, varargin{2:end}); 出错 rtwbuild (line 235) slbuild(sys, ‘StandaloneCoderTarget’, … 出错 rtwbuildmatsim (line 70) rtwbuild(p.Results.model); – Show complete stack trace Displaying stack trace: Error using getTMF • In getTMF • In rtwprivate (line 16) • In coder.internal.getMexCompilerForModel • In coder.internal.getMexCompilerForModel • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfoPrivate • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfo • In slbuild_private • In sl (line 15) • In slbuild (line 98) • In rtwbuild (line 235) • In rtwbuildmatsim (line 70) 我正在尝试使用rtwbuildmatsim脚本导出tutorial_matsim_start_spr_dmp_01.mdl的Simulink模型。
I am trying to export a Simulink model of tutorial_matsim_start_spr_dmp_01.mdl using the rtwbuildmatsim script.
之前在Simulink的Simulation菜单下的Model Configuration Parameters中选择的导出的目标文件类型为matsim.tlc。
The export target file type selected in Model Configuration Parameters under the Simulation menu of Simulink is matsim.tlc.
在执行脚本的过程中,发生了报错:unable to locate template makefile: matsim_lcc64.tmf
An error occurred while executing the script: unable to locate template makefile: matsim_lcc64.tmf
我从报错上判断问题就是MATLAB没有找到模板文件matsim_lcc64.tmf。然而我搜索了MATLAB的所有文件均未找到该模板文件。我搜索过该文件的版本包括MATLAB 2021b20219b2015a。我选择的编译器为MinGW 6.3。
I judged from the error that the problem was that MATLAB did not find the template file matsim_lcc64.tmf. However, I searched all the files in MATLAB and could not find the template file. I have searched for versions of this file including MATLAB 2021b20219b2015a. The compiler I chose is MinGW 6.3.
感谢您的帮助!
Thank you for your help!
附:报错全部内容:
Attached: All contents of the error:
### Generating code and artifacts to ‘Model specific’ folder structure ### Generating code into build folder: E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw 警告: Model ‘tutorial_matsim_start_spr_dmp_01’ is using a default value of 0.2 for maximum step size. You can disable this diagnostic by setting Automatic solver parameter selection to ‘none’ ### Invoking Target Language Compiler on tutorial_matsim_start_spr_dmp_01.rtw ### Using System Target File: E:SOFTMATLABR2019brtwcrtwsfcnrtwsfcn.tlc ### Loading TLC function libraries …. ### Initial pass through model to cache user defined code . ### Caching model source code …………………. ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_types.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sf.h ### Writing header file rtwtypes.h . ### Writing header file multiword_types.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf.c ### Writing header file tutorial_matsim_start_spr_dmp_01_sf_private.h ### Writing header file tutorial_matsim_start_spr_dmp_01_sid.h ### Writing header file tutorial_matsim_start_spr_dmp_01_mid.h ### Writing source file tutorial_matsim_start_spr_dmp_01_sf_data.c ### Writing header file rtGetNaN.h . ### Writing source file rtGetNaN.c ### Writing header file rt_nonfinite.h ### Writing source file rt_nonfinite.c ### Writing header file rt_defines.h ### Writing header file rtGetInf.h ### Writing source file rtGetInf.c . ### TLC code generation complete. ### Using toolchain: MinGW64 | gmake (64-bit Windows) ### Creating ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtwtutorial_matsim_start_spr_dmp_01.mk’ … ### Building ‘tutorial_matsim_start_spr_dmp_01_sf’: "E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>cd . E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>if "" == "" ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk all ) else ("E:SOFTMATLABR2019bbinwin64gmake" -f tutorial_matsim_start_spr_dmp_01.mk ) "### Successfully generated all binary outputs." E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01_sfcn_rtw>exit 0 mex -f E:SOFTMATLABR2019bbinwin64mexoptsmingw64.xml -R2018a -outdir .. ‘CFLAGS=$CFLAGS -Wno-overlength-strings -pedantic -Wno-long-long -Wno-declaration-after-statement -fwrapv’ -DMODEL=tutorial_matsim_start_spr_dmp_01 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DCLASSIC_INTERFACE=1 -DALLOCATIONFCN=0 -DTID01EQ=0 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 COPTIMFLAGS=-O0 -I.. -I..tutorial_matsim_start_spr_dmp_01_sfcn_rtw -IE:SOFTMATLABR2019bexterninclude -IE:SOFTMATLABR2019bsimulinkinclude -IE:SOFTMATLABR2019brtwcsrc tutorial_matsim_start_spr_dmp_01_sf.c rtGetInf.c rtGetNaN.c tutorial_matsim_start_spr_dmp_01_sf_data.c -LE:SOFTMATLABR2019bexternlibwin64mingw64 -lut -lfixedpoint ### Created mex file: ..tutorial_matsim_start_spr_dmp_01_sf.mexw64 ### Simulink cache artifacts for ‘tutorial_matsim_start_spr_dmp_01’ were created in ‘E:FILEtutorial_matsim_Isimulink_modeltutorial_matsim_start_spr_dmp_01.slxc’. 错误使用 getTMF Unable to locate template makefile: matsim_lcc64.tmf 出错 rtwprivate (line 16) [varargout{1:nargout}] = feval(function_name, varargin{1:end}); 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.getMexCompilerForModel 出错 coder.internal.ModelCompInfo/createModelCompInfoPrivate 出错 coder.internal.ModelCompInfo.createModelCompInfo 出错 slbuild_private 出错 sl (line 15) [varargout{1:nargout}]=feval(varargin{:}); 出错 slbuild (line 98) sl(‘slbuild_private’, mdl, target, varargin{2:end}); 出错 rtwbuild (line 235) slbuild(sys, ‘StandaloneCoderTarget’, … 出错 rtwbuildmatsim (line 70) rtwbuild(p.Results.model); – Show complete stack trace Displaying stack trace: Error using getTMF • In getTMF • In rtwprivate (line 16) • In coder.internal.getMexCompilerForModel • In coder.internal.getMexCompilerForModel • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfoPrivate • In coder.internal.ModelCompInfo>ModelCompInfo.createModelCompInfo • In slbuild_private • In sl (line 15) • In slbuild (line 98) • In rtwbuild (line 235) • In rtwbuildmatsim (line 70) error, mex compiler, simulink, toolbox MATLAB Answers — New Questions
Ejector (2P)
How can I design a two phase flow ejector in simulink / simscape because this components does not available in simulink?How can I design a two phase flow ejector in simulink / simscape because this components does not available in simulink? How can I design a two phase flow ejector in simulink / simscape because this components does not available in simulink? 2p ejector MATLAB Answers — New Questions