Month: February 2025
Error de Add-On Installer
Hola, Buenos días.
Estoy intentando instalar las Toolbox Simscape, y Simscape Electrical. Todo va bien hasta que al momento de descargar e instalar las Toolbox aparece el siguiente error.
Estoy usando MATLAB R2024aHola, Buenos días.
Estoy intentando instalar las Toolbox Simscape, y Simscape Electrical. Todo va bien hasta que al momento de descargar e instalar las Toolbox aparece el siguiente error.
Estoy usando MATLAB R2024a Hola, Buenos días.
Estoy intentando instalar las Toolbox Simscape, y Simscape Electrical. Todo va bien hasta que al momento de descargar e instalar las Toolbox aparece el siguiente error.
Estoy usando MATLAB R2024a error, addon, toolbox MATLAB Answers — New Questions
not able to copy paste custom simscape component
I am copying custom component to a default matlab example, But getting below error
–>Error evaluating ‘PreCopyFcn’ callback of Converter
(Three-Phase) block (mask) ‘untitled/Converter’.
Callback string is ‘simscape.compiler.sli.internal.callback(‘PreCopyFcn’,gcbh);’
–>Cannot add block Converter to the model because a license for Simscape Electrical is not available.I am copying custom component to a default matlab example, But getting below error
–>Error evaluating ‘PreCopyFcn’ callback of Converter
(Three-Phase) block (mask) ‘untitled/Converter’.
Callback string is ‘simscape.compiler.sli.internal.callback(‘PreCopyFcn’,gcbh);’
–>Cannot add block Converter to the model because a license for Simscape Electrical is not available. I am copying custom component to a default matlab example, But getting below error
–>Error evaluating ‘PreCopyFcn’ callback of Converter
(Three-Phase) block (mask) ‘untitled/Converter’.
Callback string is ‘simscape.compiler.sli.internal.callback(‘PreCopyFcn’,gcbh);’
–>Cannot add block Converter to the model because a license for Simscape Electrical is not available. #error #simulink MATLAB Answers — New Questions
How to use “wget” command in Linux?
I’m trying to run a program that needs to access the "wget" the command as follows:
[result, cmdout] = system(‘wget -h’);
Do you have any suggestions to get it working in Linux?I’m trying to run a program that needs to access the "wget" the command as follows:
[result, cmdout] = system(‘wget -h’);
Do you have any suggestions to get it working in Linux? I’m trying to run a program that needs to access the "wget" the command as follows:
[result, cmdout] = system(‘wget -h’);
Do you have any suggestions to get it working in Linux? wget, websave, url, download MATLAB Answers — New Questions
Why trapz is giving me negative area?
Hey all,
I have two vectors, frequency and power. I’m trying to get the area under the curve of the power plot but it ends up giving me a negative value. When I do trapz(power) alone, it’s a positive value. diff(freq) is also positive. I’m attaching the data for your reference. Thanks!Hey all,
I have two vectors, frequency and power. I’m trying to get the area under the curve of the power plot but it ends up giving me a negative value. When I do trapz(power) alone, it’s a positive value. diff(freq) is also positive. I’m attaching the data for your reference. Thanks! Hey all,
I have two vectors, frequency and power. I’m trying to get the area under the curve of the power plot but it ends up giving me a negative value. When I do trapz(power) alone, it’s a positive value. diff(freq) is also positive. I’m attaching the data for your reference. Thanks! integral, trapz MATLAB Answers — New Questions
Simulink Code Generation Error: Array of Classes Initalization
Hello,
I am trying to built a Simulink function which keeps record of the statistics of the system by using array of classes. However, I can not generate an array of class in Simulink. I realize that I should instantiate an array in Simulink but how can I instantiate a class?
arrivedArray(3, 65536) = queueInfo;
analysisArray(3, 65536) = queueInfo;
In the picture above, queueInfo is my class. This two lines return with the following error.
Code generation requires variable arrivedArray to be fully defined before subscribing it.
By the way, this is the suggested method by Matlab for creating an array of class but somehow it doesn’t work. Later I’ve tried this one:
persistent arrivedArray
if isempty(arrivedArray)
arrivedArray(3, 655336) = queueInfo;
end
persistent analysisArray
if isempty(analysisArray)
analysisArray(3, 65536) = queueInfo;
end
But it doesn’t work either. The error İs:
Persistent variable ‘arrivedArray’ must be assigned before it is used. The only exception is a check using ‘isempty(arrivedArray)’ that can be performed prior to assignment.
I understand the error but have no idea how to fix it. A constructor did not help me too. Here is my class structure:
1
classdef transactionInfo
properties
tag = uint16(0);
arrivalTime = uint64(0);
departureTime = uint64(0);
end
methods
function obj = transactionInfo(v)
if nargin > 0
obj.tag = uint16(v);
obj.arrivalTime = uint64(v);
obj.departureTime = uint64(v);
end
end
end
end
2
classdef queueInfo < transactionInfo
properties
length = uint16(0);
queueID = uint8(0);
delay = uint64(0);
end
methods
function obj = queueInfo(v)
if nargin > 0
obj.length = uint16(v);
obj.queueID = uint8(v);
obj.delay = uint64(v);
end
end
end
end
Does anyone know how to fix this issue?
Note: There might be some obvious errors in my class structures, I am kind of new to OOP. Every suggestion is welcomed.Hello,
I am trying to built a Simulink function which keeps record of the statistics of the system by using array of classes. However, I can not generate an array of class in Simulink. I realize that I should instantiate an array in Simulink but how can I instantiate a class?
arrivedArray(3, 65536) = queueInfo;
analysisArray(3, 65536) = queueInfo;
In the picture above, queueInfo is my class. This two lines return with the following error.
Code generation requires variable arrivedArray to be fully defined before subscribing it.
By the way, this is the suggested method by Matlab for creating an array of class but somehow it doesn’t work. Later I’ve tried this one:
persistent arrivedArray
if isempty(arrivedArray)
arrivedArray(3, 655336) = queueInfo;
end
persistent analysisArray
if isempty(analysisArray)
analysisArray(3, 65536) = queueInfo;
end
But it doesn’t work either. The error İs:
Persistent variable ‘arrivedArray’ must be assigned before it is used. The only exception is a check using ‘isempty(arrivedArray)’ that can be performed prior to assignment.
I understand the error but have no idea how to fix it. A constructor did not help me too. Here is my class structure:
1
classdef transactionInfo
properties
tag = uint16(0);
arrivalTime = uint64(0);
departureTime = uint64(0);
end
methods
function obj = transactionInfo(v)
if nargin > 0
obj.tag = uint16(v);
obj.arrivalTime = uint64(v);
obj.departureTime = uint64(v);
end
end
end
end
2
classdef queueInfo < transactionInfo
properties
length = uint16(0);
queueID = uint8(0);
delay = uint64(0);
end
methods
function obj = queueInfo(v)
if nargin > 0
obj.length = uint16(v);
obj.queueID = uint8(v);
obj.delay = uint64(v);
end
end
end
end
Does anyone know how to fix this issue?
Note: There might be some obvious errors in my class structures, I am kind of new to OOP. Every suggestion is welcomed. Hello,
I am trying to built a Simulink function which keeps record of the statistics of the system by using array of classes. However, I can not generate an array of class in Simulink. I realize that I should instantiate an array in Simulink but how can I instantiate a class?
arrivedArray(3, 65536) = queueInfo;
analysisArray(3, 65536) = queueInfo;
In the picture above, queueInfo is my class. This two lines return with the following error.
Code generation requires variable arrivedArray to be fully defined before subscribing it.
By the way, this is the suggested method by Matlab for creating an array of class but somehow it doesn’t work. Later I’ve tried this one:
persistent arrivedArray
if isempty(arrivedArray)
arrivedArray(3, 655336) = queueInfo;
end
persistent analysisArray
if isempty(analysisArray)
analysisArray(3, 65536) = queueInfo;
end
But it doesn’t work either. The error İs:
Persistent variable ‘arrivedArray’ must be assigned before it is used. The only exception is a check using ‘isempty(arrivedArray)’ that can be performed prior to assignment.
I understand the error but have no idea how to fix it. A constructor did not help me too. Here is my class structure:
1
classdef transactionInfo
properties
tag = uint16(0);
arrivalTime = uint64(0);
departureTime = uint64(0);
end
methods
function obj = transactionInfo(v)
if nargin > 0
obj.tag = uint16(v);
obj.arrivalTime = uint64(v);
obj.departureTime = uint64(v);
end
end
end
end
2
classdef queueInfo < transactionInfo
properties
length = uint16(0);
queueID = uint8(0);
delay = uint64(0);
end
methods
function obj = queueInfo(v)
if nargin > 0
obj.length = uint16(v);
obj.queueID = uint8(v);
obj.delay = uint64(v);
end
end
end
end
Does anyone know how to fix this issue?
Note: There might be some obvious errors in my class structures, I am kind of new to OOP. Every suggestion is welcomed. simulink, class, code generation MATLAB Answers — New Questions
How can I count the number of non virtual blocks in my model?
I have a home licenseI have a home license I have a home license non virtual MATLAB Answers — New Questions