Tag Archives: matlab
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
Dependency Analyzer – question re/ path
I started using the Dependency Analyzer tool (in 2023b) to find out which Mathworks toolboxes are being invoked in my scripts and apps. I’m a bit confused on the output. So one of my scripts calls the ‘contains’ function. DA tool indicates the Mapping Toolbox is in use because it has a ‘contains’ function. However ‘which contains’ shows this is also in C:Program FilesMATLABR2023btoolboxmatlabstrfuncontains – and this is the right one.
So why is DA saying I’m using the Mapping Toolbox? Doesn’t it follow the Matlab path rules to find the right one (that takes priority)? Such output can be quite confusing and time-consuming. Or am I doing something wrong? Thanks for the guidance.
PVI started using the Dependency Analyzer tool (in 2023b) to find out which Mathworks toolboxes are being invoked in my scripts and apps. I’m a bit confused on the output. So one of my scripts calls the ‘contains’ function. DA tool indicates the Mapping Toolbox is in use because it has a ‘contains’ function. However ‘which contains’ shows this is also in C:Program FilesMATLABR2023btoolboxmatlabstrfuncontains – and this is the right one.
So why is DA saying I’m using the Mapping Toolbox? Doesn’t it follow the Matlab path rules to find the right one (that takes priority)? Such output can be quite confusing and time-consuming. Or am I doing something wrong? Thanks for the guidance.
PV I started using the Dependency Analyzer tool (in 2023b) to find out which Mathworks toolboxes are being invoked in my scripts and apps. I’m a bit confused on the output. So one of my scripts calls the ‘contains’ function. DA tool indicates the Mapping Toolbox is in use because it has a ‘contains’ function. However ‘which contains’ shows this is also in C:Program FilesMATLABR2023btoolboxmatlabstrfuncontains – and this is the right one.
So why is DA saying I’m using the Mapping Toolbox? Doesn’t it follow the Matlab path rules to find the right one (that takes priority)? Such output can be quite confusing and time-consuming. Or am I doing something wrong? Thanks for the guidance.
PV dependency analyzer, path MATLAB Answers — New Questions
Making a heat map from three vectors of different lengths
From a set of three vectors (x,y,z), I want to generate a heat map of x,y and z where the color bar would denote z-values.Perhaps this answer was relevant https://www.mathworks.com/matlabcentral/answers/105390-making-a-heat-map-from-three-vectorsBut it was erased from the database. Thanks!From a set of three vectors (x,y,z), I want to generate a heat map of x,y and z where the color bar would denote z-values.Perhaps this answer was relevant https://www.mathworks.com/matlabcentral/answers/105390-making-a-heat-map-from-three-vectorsBut it was erased from the database. Thanks! From a set of three vectors (x,y,z), I want to generate a heat map of x,y and z where the color bar would denote z-values.Perhaps this answer was relevant https://www.mathworks.com/matlabcentral/answers/105390-making-a-heat-map-from-three-vectorsBut it was erased from the database. Thanks! heat map, concatenate MATLAB Answers — New Questions
problem to solve incorrrect
%% R-RRR
clear all; clc; close all
% Input data
AB=0.325; %(m)
BC=0.938; %(m)
CD=0.675; %(m)
CE=0.6; %(m)
xD=0.8; %(m)
yD=-0.432; %(m)
phi =pi; %(rad)
xA = 0; yA = 0;
rA = [xA yA 0];
rD = [xD yD 0];
xB = AB*cos(phi); yB = AB*sin(phi); rB = [xB yB 0];
% Position of joint C
%
eqnC1 = ‘(xCsol – xB)^2 + (yCsol – yB)^2 = BC^2 ‘;
% Distance formula: CD=constant
eqnC2 = ‘(xCsol – xD)^2 + (yCsol – yD)^2 = CD^2 ‘;
% Simultaneously solve above equations
solC = solve(eqnC1, eqnC2, ‘xCsol, yCsol’);
% Two solutions for xC – vector form
xCpositions = eval(solC.xCsol);
% Two solutions for yC – vector form
yCpositions = eval(solC.yCsol);
% Separate the solutions in scalar form
% first component of the vector xCpositions
xC1 = xCpositions(1);
% second component of the vector xCpositions
xC2 = xCpositions(2);
yC1 = yCpositions(1);
% second component of the vector yCpositions
yC2 = yCpositions(2);
% Select the correct position for C
% for the given input angle
if xC1 > xD
xC = xC1; yC=yC1;
else
xC = xC2; yC=yC2;
end
rC = [xC yC 0]; % Position vector of C
% Position of joint E
% Distance formula: CE=constant
eqnE1='(xEsol-xC)^2+(yEsol-yC)^2=CE^2′;
% Slope formula:
% E, C, and D are on the same straight line
eqnE2='(yD-yC)/(xD-xC)=(yEsol-yC)/(xEsol-xC)’;
solE = solve(eqnE1, eqnE2, ‘xEsol, yEsol’);
xEpositions = eval(solE.xEsol);
yEpositions = eval(solE.yEsol);
xE1 = xEpositions(1); xE2 = xEpositions(2);
yE1 = yEpositions(1); yE2 = yEpositions(2);
if xE1 < xC
xE = xE1; yE=yE1;
else
xE = xE2; yE=yE2;
end
rE = [xE yE 0]; % Position vector of E
% Angles of the links with the horizontal
phi2 = atan((yB-yC)/(xB-xC));
phi3 = atan((yD-yC)/(xD-xC));
fprintf(‘Results nn’)
fprintf(‘rA = [ %g, %g, %g ] (m)n’, rA)
fprintf(‘rD = [ %g, %g, %g ] (m)n’, rD)
fprintf(‘rB = [ %g, %g, %g ] (m)n’, rB)
fprintf(‘rC = [ %g, %g, %g ] (m)n’, rC)
fprintf(‘rE = [ %g, %g, %g ] (m)n’, rE)
fprintf(‘phi2 = %g (degrees) n’, phi2*180/pi)
fprintf(‘phi3 = %g (degrees) n’, phi3*180/pi)
% Graphic of the mechanism
plot([xA,xB],[yA,yB],’k-o’,’LineWidth’,1.5)
hold on % holds the current plot
plot([xB,xC],[yB,yC],’b-o’,’LineWidth’,1.5)
hold on
plot([xD,xE],[yD,yE],’r-o’,’LineWidth’,1.5)
% adds major grid lines to the current axes
grid on,…
xlabel(‘x (m)’), ylabel(‘y (m)’),…
title(‘positions for phi = 45 (deg)’),…
text(xA,yA,’leftarrow A = ground’,…
‘HorizontalAlignment’,’left’),…
text(xB,yB,’ B’),…
text(xC,yC,’leftarrow C = ground’,…
‘HorizontalAlignment’,’left’),…
text(xD,yD,’leftarrow D = ground’,…
‘HorizontalAlignment’,’left’),…
text(xE,yE,’ E’), axis([-2 3 -2 3])%% R-RRR
clear all; clc; close all
% Input data
AB=0.325; %(m)
BC=0.938; %(m)
CD=0.675; %(m)
CE=0.6; %(m)
xD=0.8; %(m)
yD=-0.432; %(m)
phi =pi; %(rad)
xA = 0; yA = 0;
rA = [xA yA 0];
rD = [xD yD 0];
xB = AB*cos(phi); yB = AB*sin(phi); rB = [xB yB 0];
% Position of joint C
%
eqnC1 = ‘(xCsol – xB)^2 + (yCsol – yB)^2 = BC^2 ‘;
% Distance formula: CD=constant
eqnC2 = ‘(xCsol – xD)^2 + (yCsol – yD)^2 = CD^2 ‘;
% Simultaneously solve above equations
solC = solve(eqnC1, eqnC2, ‘xCsol, yCsol’);
% Two solutions for xC – vector form
xCpositions = eval(solC.xCsol);
% Two solutions for yC – vector form
yCpositions = eval(solC.yCsol);
% Separate the solutions in scalar form
% first component of the vector xCpositions
xC1 = xCpositions(1);
% second component of the vector xCpositions
xC2 = xCpositions(2);
yC1 = yCpositions(1);
% second component of the vector yCpositions
yC2 = yCpositions(2);
% Select the correct position for C
% for the given input angle
if xC1 > xD
xC = xC1; yC=yC1;
else
xC = xC2; yC=yC2;
end
rC = [xC yC 0]; % Position vector of C
% Position of joint E
% Distance formula: CE=constant
eqnE1='(xEsol-xC)^2+(yEsol-yC)^2=CE^2′;
% Slope formula:
% E, C, and D are on the same straight line
eqnE2='(yD-yC)/(xD-xC)=(yEsol-yC)/(xEsol-xC)’;
solE = solve(eqnE1, eqnE2, ‘xEsol, yEsol’);
xEpositions = eval(solE.xEsol);
yEpositions = eval(solE.yEsol);
xE1 = xEpositions(1); xE2 = xEpositions(2);
yE1 = yEpositions(1); yE2 = yEpositions(2);
if xE1 < xC
xE = xE1; yE=yE1;
else
xE = xE2; yE=yE2;
end
rE = [xE yE 0]; % Position vector of E
% Angles of the links with the horizontal
phi2 = atan((yB-yC)/(xB-xC));
phi3 = atan((yD-yC)/(xD-xC));
fprintf(‘Results nn’)
fprintf(‘rA = [ %g, %g, %g ] (m)n’, rA)
fprintf(‘rD = [ %g, %g, %g ] (m)n’, rD)
fprintf(‘rB = [ %g, %g, %g ] (m)n’, rB)
fprintf(‘rC = [ %g, %g, %g ] (m)n’, rC)
fprintf(‘rE = [ %g, %g, %g ] (m)n’, rE)
fprintf(‘phi2 = %g (degrees) n’, phi2*180/pi)
fprintf(‘phi3 = %g (degrees) n’, phi3*180/pi)
% Graphic of the mechanism
plot([xA,xB],[yA,yB],’k-o’,’LineWidth’,1.5)
hold on % holds the current plot
plot([xB,xC],[yB,yC],’b-o’,’LineWidth’,1.5)
hold on
plot([xD,xE],[yD,yE],’r-o’,’LineWidth’,1.5)
% adds major grid lines to the current axes
grid on,…
xlabel(‘x (m)’), ylabel(‘y (m)’),…
title(‘positions for phi = 45 (deg)’),…
text(xA,yA,’leftarrow A = ground’,…
‘HorizontalAlignment’,’left’),…
text(xB,yB,’ B’),…
text(xC,yC,’leftarrow C = ground’,…
‘HorizontalAlignment’,’left’),…
text(xD,yD,’leftarrow D = ground’,…
‘HorizontalAlignment’,’left’),…
text(xE,yE,’ E’), axis([-2 3 -2 3]) %% R-RRR
clear all; clc; close all
% Input data
AB=0.325; %(m)
BC=0.938; %(m)
CD=0.675; %(m)
CE=0.6; %(m)
xD=0.8; %(m)
yD=-0.432; %(m)
phi =pi; %(rad)
xA = 0; yA = 0;
rA = [xA yA 0];
rD = [xD yD 0];
xB = AB*cos(phi); yB = AB*sin(phi); rB = [xB yB 0];
% Position of joint C
%
eqnC1 = ‘(xCsol – xB)^2 + (yCsol – yB)^2 = BC^2 ‘;
% Distance formula: CD=constant
eqnC2 = ‘(xCsol – xD)^2 + (yCsol – yD)^2 = CD^2 ‘;
% Simultaneously solve above equations
solC = solve(eqnC1, eqnC2, ‘xCsol, yCsol’);
% Two solutions for xC – vector form
xCpositions = eval(solC.xCsol);
% Two solutions for yC – vector form
yCpositions = eval(solC.yCsol);
% Separate the solutions in scalar form
% first component of the vector xCpositions
xC1 = xCpositions(1);
% second component of the vector xCpositions
xC2 = xCpositions(2);
yC1 = yCpositions(1);
% second component of the vector yCpositions
yC2 = yCpositions(2);
% Select the correct position for C
% for the given input angle
if xC1 > xD
xC = xC1; yC=yC1;
else
xC = xC2; yC=yC2;
end
rC = [xC yC 0]; % Position vector of C
% Position of joint E
% Distance formula: CE=constant
eqnE1='(xEsol-xC)^2+(yEsol-yC)^2=CE^2′;
% Slope formula:
% E, C, and D are on the same straight line
eqnE2='(yD-yC)/(xD-xC)=(yEsol-yC)/(xEsol-xC)’;
solE = solve(eqnE1, eqnE2, ‘xEsol, yEsol’);
xEpositions = eval(solE.xEsol);
yEpositions = eval(solE.yEsol);
xE1 = xEpositions(1); xE2 = xEpositions(2);
yE1 = yEpositions(1); yE2 = yEpositions(2);
if xE1 < xC
xE = xE1; yE=yE1;
else
xE = xE2; yE=yE2;
end
rE = [xE yE 0]; % Position vector of E
% Angles of the links with the horizontal
phi2 = atan((yB-yC)/(xB-xC));
phi3 = atan((yD-yC)/(xD-xC));
fprintf(‘Results nn’)
fprintf(‘rA = [ %g, %g, %g ] (m)n’, rA)
fprintf(‘rD = [ %g, %g, %g ] (m)n’, rD)
fprintf(‘rB = [ %g, %g, %g ] (m)n’, rB)
fprintf(‘rC = [ %g, %g, %g ] (m)n’, rC)
fprintf(‘rE = [ %g, %g, %g ] (m)n’, rE)
fprintf(‘phi2 = %g (degrees) n’, phi2*180/pi)
fprintf(‘phi3 = %g (degrees) n’, phi3*180/pi)
% Graphic of the mechanism
plot([xA,xB],[yA,yB],’k-o’,’LineWidth’,1.5)
hold on % holds the current plot
plot([xB,xC],[yB,yC],’b-o’,’LineWidth’,1.5)
hold on
plot([xD,xE],[yD,yE],’r-o’,’LineWidth’,1.5)
% adds major grid lines to the current axes
grid on,…
xlabel(‘x (m)’), ylabel(‘y (m)’),…
title(‘positions for phi = 45 (deg)’),…
text(xA,yA,’leftarrow A = ground’,…
‘HorizontalAlignment’,’left’),…
text(xB,yB,’ B’),…
text(xC,yC,’leftarrow C = ground’,…
‘HorizontalAlignment’,’left’),…
text(xD,yD,’leftarrow D = ground’,…
‘HorizontalAlignment’,’left’),…
text(xE,yE,’ E’), axis([-2 3 -2 3]) plot MATLAB Answers — New Questions
Singularity error – Simulink
An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state ‘1’ in block ‘XXXXXX/Receiver/pre-amp/CTLE mode 2/Transfer Fcn15’ at time 3.3003349235944607E-9 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
Please help.An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state ‘1’ in block ‘XXXXXX/Receiver/pre-amp/CTLE mode 2/Transfer Fcn15’ at time 3.3003349235944607E-9 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
Please help. An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state ‘1’ in block ‘XXXXXX/Receiver/pre-amp/CTLE mode 2/Transfer Fcn15’ at time 3.3003349235944607E-9 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
Please help. simulink MATLAB Answers — New Questions
When DDPG optimizes PID parameters, how do I keep the first 10s of data from the system stabilization phase out of the experienceBuffer?
Adaptive PID control using simulink’s own Agent. Since the first 20 is a buffer process for the system, the first 20s are not part of the transition process, but are necessary to exist. How to make the Agent block the first 20s of action, state, reward and other information, or how to make the first 20s does not affect the training effect. In fact, if the first 10s are learned by the intelligent body, then the training effect is very poor.Adaptive PID control using simulink’s own Agent. Since the first 20 is a buffer process for the system, the first 20s are not part of the transition process, but are necessary to exist. How to make the Agent block the first 20s of action, state, reward and other information, or how to make the first 20s does not affect the training effect. In fact, if the first 10s are learned by the intelligent body, then the training effect is very poor. Adaptive PID control using simulink’s own Agent. Since the first 20 is a buffer process for the system, the first 20s are not part of the transition process, but are necessary to exist. How to make the Agent block the first 20s of action, state, reward and other information, or how to make the first 20s does not affect the training effect. In fact, if the first 10s are learned by the intelligent body, then the training effect is very poor. reinforcement learning, simulink, agent MATLAB Answers — New Questions
Distinguish land from ocean in harbors
I’m trying to distinguish land from ocean in harbors and have tried using the highest resolution maps from gshhs, but it isn’t detailed enough. Below are is an example showing that it isn’t detailed to the level I want. The one to the left showing th coastline boundaries and the other one showing the geoplot with basemap = ‘streets’
Since the map is able to plot in such detail, shown below, I would imagine that it should be able to distingusih land from ocean, just based on the colors.
Appriciate any help here! Thanks in advance.I’m trying to distinguish land from ocean in harbors and have tried using the highest resolution maps from gshhs, but it isn’t detailed enough. Below are is an example showing that it isn’t detailed to the level I want. The one to the left showing th coastline boundaries and the other one showing the geoplot with basemap = ‘streets’
Since the map is able to plot in such detail, shown below, I would imagine that it should be able to distingusih land from ocean, just based on the colors.
Appriciate any help here! Thanks in advance. I’m trying to distinguish land from ocean in harbors and have tried using the highest resolution maps from gshhs, but it isn’t detailed enough. Below are is an example showing that it isn’t detailed to the level I want. The one to the left showing th coastline boundaries and the other one showing the geoplot with basemap = ‘streets’
Since the map is able to plot in such detail, shown below, I would imagine that it should be able to distingusih land from ocean, just based on the colors.
Appriciate any help here! Thanks in advance. geoplot, plot, colormap, map, marine, figure, gshhg MATLAB Answers — New Questions
sinusoidal representation networks or SIRENs
Hi there!
I am wondering if there is the matlab code for sinusoidal representation networks or SIRENs, which are suitable for solving PDEs in the frame of PINNs. The activation function of an SIREN in sin function, this activation layer has not been built in Matlab.
Thanks for any help.Hi there!
I am wondering if there is the matlab code for sinusoidal representation networks or SIRENs, which are suitable for solving PDEs in the frame of PINNs. The activation function of an SIREN in sin function, this activation layer has not been built in Matlab.
Thanks for any help. Hi there!
I am wondering if there is the matlab code for sinusoidal representation networks or SIRENs, which are suitable for solving PDEs in the frame of PINNs. The activation function of an SIREN in sin function, this activation layer has not been built in Matlab.
Thanks for any help. deep learning, pinns, siren MATLAB Answers — New Questions