Category: Matlab
Category Archives: Matlab
Battery Pack Modeling – Self-Paced Online Course – Unable to Proceed Further due to Problem in Task 4 in the exercise “Exploring the Custom Battery Pack Block”
Hello, I have recently started learning about Battery Pack Modelling using Simulink/Simscape through the "Battery Pack Modelling" Self-Paced Online Course offered by MathWorks. I am taking the course through the Chrome Browser (Simulink Online) for the simulinkR2024b version.
Presently, I am facing an issue under Section 2.1 – Pack Modelling of this course due to which my progress has come to a halt. The problem I am experiencing is related to Task 4 in the exercise "Exploring the Custom Battery Pack Block" of the particular section I mentioned above. I am unable to proceed ahead with the completion of the exercise as the "Training Assessment" fails each and every time I click the submit button even though I have clearly and carefully followed the instructions provided and completed the given task.
To give a brief summary and clarify the context, in Task 4, we have to observe the battery voltages in the simulation. We have to start by right-clicking the batteryVoltage port of the Battery Pack and selecting Log Selected Signals. Next, we have to change the Stop Time in the Simulate section to 200. After that, we have to navigate to the Simulation tab and click Run to execute the model. Once the simulation is complete, we have to access the Data Inspector from the Review Results section. The Simulation Data Inspector window appears, and we have to click and select NewPack(8). A dialog box titled Multidimensional Signal appears, where we have to select Convert to channels (24) and then choose NewPack (1,1) and NewPack (10,1) to view the battery voltages.
Now the difficulty I encountered while performing the task is that after running the simulation and opening up Data Inspector from the Review Results section, I am not shown the option of NewPack(8) as mentioned in the instructions and instead shown NewPack:3 (8). Also, when I click and select NewPack:3 (8), I am not presented with the option of Convert to channels (24) and instead presented with Convert to channels (8). As a result, there are no options such as NewPack (1,1) and NewPack (10,1) to select in order to observe the battery voltages. I believe the "Training Assessment" fails when I click submit because I don’t meet the criteria specified in the instructions. However, despite re-running the task multiple times, I consistently receive the same set of options to select, not the ones specified in the task instructions. Hence, I am unable to proceed further.
Could someone verify whether there are any problems with the assessment or the proposed solution?
I have attached screenshots for reference.Hello, I have recently started learning about Battery Pack Modelling using Simulink/Simscape through the "Battery Pack Modelling" Self-Paced Online Course offered by MathWorks. I am taking the course through the Chrome Browser (Simulink Online) for the simulinkR2024b version.
Presently, I am facing an issue under Section 2.1 – Pack Modelling of this course due to which my progress has come to a halt. The problem I am experiencing is related to Task 4 in the exercise "Exploring the Custom Battery Pack Block" of the particular section I mentioned above. I am unable to proceed ahead with the completion of the exercise as the "Training Assessment" fails each and every time I click the submit button even though I have clearly and carefully followed the instructions provided and completed the given task.
To give a brief summary and clarify the context, in Task 4, we have to observe the battery voltages in the simulation. We have to start by right-clicking the batteryVoltage port of the Battery Pack and selecting Log Selected Signals. Next, we have to change the Stop Time in the Simulate section to 200. After that, we have to navigate to the Simulation tab and click Run to execute the model. Once the simulation is complete, we have to access the Data Inspector from the Review Results section. The Simulation Data Inspector window appears, and we have to click and select NewPack(8). A dialog box titled Multidimensional Signal appears, where we have to select Convert to channels (24) and then choose NewPack (1,1) and NewPack (10,1) to view the battery voltages.
Now the difficulty I encountered while performing the task is that after running the simulation and opening up Data Inspector from the Review Results section, I am not shown the option of NewPack(8) as mentioned in the instructions and instead shown NewPack:3 (8). Also, when I click and select NewPack:3 (8), I am not presented with the option of Convert to channels (24) and instead presented with Convert to channels (8). As a result, there are no options such as NewPack (1,1) and NewPack (10,1) to select in order to observe the battery voltages. I believe the "Training Assessment" fails when I click submit because I don’t meet the criteria specified in the instructions. However, despite re-running the task multiple times, I consistently receive the same set of options to select, not the ones specified in the task instructions. Hence, I am unable to proceed further.
Could someone verify whether there are any problems with the assessment or the proposed solution?
I have attached screenshots for reference. Hello, I have recently started learning about Battery Pack Modelling using Simulink/Simscape through the "Battery Pack Modelling" Self-Paced Online Course offered by MathWorks. I am taking the course through the Chrome Browser (Simulink Online) for the simulinkR2024b version.
Presently, I am facing an issue under Section 2.1 – Pack Modelling of this course due to which my progress has come to a halt. The problem I am experiencing is related to Task 4 in the exercise "Exploring the Custom Battery Pack Block" of the particular section I mentioned above. I am unable to proceed ahead with the completion of the exercise as the "Training Assessment" fails each and every time I click the submit button even though I have clearly and carefully followed the instructions provided and completed the given task.
To give a brief summary and clarify the context, in Task 4, we have to observe the battery voltages in the simulation. We have to start by right-clicking the batteryVoltage port of the Battery Pack and selecting Log Selected Signals. Next, we have to change the Stop Time in the Simulate section to 200. After that, we have to navigate to the Simulation tab and click Run to execute the model. Once the simulation is complete, we have to access the Data Inspector from the Review Results section. The Simulation Data Inspector window appears, and we have to click and select NewPack(8). A dialog box titled Multidimensional Signal appears, where we have to select Convert to channels (24) and then choose NewPack (1,1) and NewPack (10,1) to view the battery voltages.
Now the difficulty I encountered while performing the task is that after running the simulation and opening up Data Inspector from the Review Results section, I am not shown the option of NewPack(8) as mentioned in the instructions and instead shown NewPack:3 (8). Also, when I click and select NewPack:3 (8), I am not presented with the option of Convert to channels (24) and instead presented with Convert to channels (8). As a result, there are no options such as NewPack (1,1) and NewPack (10,1) to select in order to observe the battery voltages. I believe the "Training Assessment" fails when I click submit because I don’t meet the criteria specified in the instructions. However, despite re-running the task multiple times, I consistently receive the same set of options to select, not the ones specified in the task instructions. Hence, I am unable to proceed further.
Could someone verify whether there are any problems with the assessment or the proposed solution?
I have attached screenshots for reference. battery pack modelling, self-paced online course, simscape, simulink MATLAB Answers — New Questions
在win11上运行matlabR2022b的实时仿真遇到错误
simulink运行real-time syn时报错
‘untitled/Real-Time Synchronization’ 中的 S-Function ‘sldrtsync’ 报告错误: Hardware timer cannot be allocated. Real-time kernel cannot run.
目前在网上没有找到解决方案,求问该如何解决
ps:在这之前有报错和hyper-v冲突,将hyper-v手动停止运行后就出现了上述错误simulink运行real-time syn时报错
‘untitled/Real-Time Synchronization’ 中的 S-Function ‘sldrtsync’ 报告错误: Hardware timer cannot be allocated. Real-time kernel cannot run.
目前在网上没有找到解决方案,求问该如何解决
ps:在这之前有报错和hyper-v冲突,将hyper-v手动停止运行后就出现了上述错误 simulink运行real-time syn时报错
‘untitled/Real-Time Synchronization’ 中的 S-Function ‘sldrtsync’ 报告错误: Hardware timer cannot be allocated. Real-time kernel cannot run.
目前在网上没有找到解决方案,求问该如何解决
ps:在这之前有报错和hyper-v冲突,将hyper-v手动停止运行后就出现了上述错误 simulink, 实时仿真, real-time syn MATLAB Answers — New Questions
Using a variable in an input prompt
I am trying to use the iterator (ii) of my for loop as a string in my input prompt. The code is shown below
for ii = 1:n
x = input(‘What is the orientation of molecule ‘ num2str(ii) ‘in the x-direction?’);
end
but this does not work. Any suggestions?I am trying to use the iterator (ii) of my for loop as a string in my input prompt. The code is shown below
for ii = 1:n
x = input(‘What is the orientation of molecule ‘ num2str(ii) ‘in the x-direction?’);
end
but this does not work. Any suggestions? I am trying to use the iterator (ii) of my for loop as a string in my input prompt. The code is shown below
for ii = 1:n
x = input(‘What is the orientation of molecule ‘ num2str(ii) ‘in the x-direction?’);
end
but this does not work. Any suggestions? input, prompt, for MATLAB Answers — New Questions
Adjusting sample rate in Simulink model to reflect transition from bitrate to symbol rate
I am trying to build a simple communication system in Simulink. I want to simulate a bit source that generates bits with a specific sample rate (bit rate). I then buffer the generate samples into frames of 1008 bits. For application specific reasons I then pad the frame with 16 zeros to a total of 1024 bits. The goal is then to BPSK modulate the bits and output the generated symbols at a specific symbol rate different to the bit rate.
The goal is that the spectrum analyzer shows a spectrum that reflects the intended symbol rate.
I have problems implementing this and I am confused about how Simulink handles frame time/sample time. Sample time in Simulink is defined as the rate at which a block generates output. So far so good, but I still want to enforce a specfic real sample time, i.e., time between consecutive samples (NOT frames).
Problem 1
Using the Vector Concatenate block for zero padding effectively seems to upsample the signal and the sample time in the resulting frame is smaller than the bitrate/sample rate specified in the bit source. I am using a Frame Transition block to remedy this where I specify the sample time (this is ambigous this specifies the frame time due to the Simulink sample time definition) property as (Frame_Size+16)*bit_rate. This does not seem to work as the output frames of the Rate Transition block is somewhat unpredictable. However, when placing a spectrum analyzer directly after the first Rate Transition block, the sample rate that is displayed in the spectrum analyzer shows the intended sample rate = bit_rate (10 kHz).
Problem 2
After the BPSK block I placed another Rate Transition Block to generate symbol frames where each symbol is output at a specific symbol rate. In my case the symbol rate is bit_rate/10. The spectrum analyzer shows the desired sample rate (1kHz). (see image below)
BUT: again, the output frames of the second Rate Transition block do not show the desired behaviour. I want it to buffer the incoming frames and output them at a slower rate. What happens though, is that the Rate Transition block subsamples the input and outputs every 10th frame and drops the other frames.
Any help is greatly appreciated! Thanks!I am trying to build a simple communication system in Simulink. I want to simulate a bit source that generates bits with a specific sample rate (bit rate). I then buffer the generate samples into frames of 1008 bits. For application specific reasons I then pad the frame with 16 zeros to a total of 1024 bits. The goal is then to BPSK modulate the bits and output the generated symbols at a specific symbol rate different to the bit rate.
The goal is that the spectrum analyzer shows a spectrum that reflects the intended symbol rate.
I have problems implementing this and I am confused about how Simulink handles frame time/sample time. Sample time in Simulink is defined as the rate at which a block generates output. So far so good, but I still want to enforce a specfic real sample time, i.e., time between consecutive samples (NOT frames).
Problem 1
Using the Vector Concatenate block for zero padding effectively seems to upsample the signal and the sample time in the resulting frame is smaller than the bitrate/sample rate specified in the bit source. I am using a Frame Transition block to remedy this where I specify the sample time (this is ambigous this specifies the frame time due to the Simulink sample time definition) property as (Frame_Size+16)*bit_rate. This does not seem to work as the output frames of the Rate Transition block is somewhat unpredictable. However, when placing a spectrum analyzer directly after the first Rate Transition block, the sample rate that is displayed in the spectrum analyzer shows the intended sample rate = bit_rate (10 kHz).
Problem 2
After the BPSK block I placed another Rate Transition Block to generate symbol frames where each symbol is output at a specific symbol rate. In my case the symbol rate is bit_rate/10. The spectrum analyzer shows the desired sample rate (1kHz). (see image below)
BUT: again, the output frames of the second Rate Transition block do not show the desired behaviour. I want it to buffer the incoming frames and output them at a slower rate. What happens though, is that the Rate Transition block subsamples the input and outputs every 10th frame and drops the other frames.
Any help is greatly appreciated! Thanks! I am trying to build a simple communication system in Simulink. I want to simulate a bit source that generates bits with a specific sample rate (bit rate). I then buffer the generate samples into frames of 1008 bits. For application specific reasons I then pad the frame with 16 zeros to a total of 1024 bits. The goal is then to BPSK modulate the bits and output the generated symbols at a specific symbol rate different to the bit rate.
The goal is that the spectrum analyzer shows a spectrum that reflects the intended symbol rate.
I have problems implementing this and I am confused about how Simulink handles frame time/sample time. Sample time in Simulink is defined as the rate at which a block generates output. So far so good, but I still want to enforce a specfic real sample time, i.e., time between consecutive samples (NOT frames).
Problem 1
Using the Vector Concatenate block for zero padding effectively seems to upsample the signal and the sample time in the resulting frame is smaller than the bitrate/sample rate specified in the bit source. I am using a Frame Transition block to remedy this where I specify the sample time (this is ambigous this specifies the frame time due to the Simulink sample time definition) property as (Frame_Size+16)*bit_rate. This does not seem to work as the output frames of the Rate Transition block is somewhat unpredictable. However, when placing a spectrum analyzer directly after the first Rate Transition block, the sample rate that is displayed in the spectrum analyzer shows the intended sample rate = bit_rate (10 kHz).
Problem 2
After the BPSK block I placed another Rate Transition Block to generate symbol frames where each symbol is output at a specific symbol rate. In my case the symbol rate is bit_rate/10. The spectrum analyzer shows the desired sample rate (1kHz). (see image below)
BUT: again, the output frames of the second Rate Transition block do not show the desired behaviour. I want it to buffer the incoming frames and output them at a slower rate. What happens though, is that the Rate Transition block subsamples the input and outputs every 10th frame and drops the other frames.
Any help is greatly appreciated! Thanks! simulink, sample time, rate transition, symbol rate, bit rate MATLAB Answers — New Questions
Why can’t we define properties on enumerations extending from built-in classes?
Trying to understand why we can’t subclass something like a uint8 and add a property. Say I want to enumerate data types and conveniently bundle the size of instances of the type in bytes.
In this first case, we specify which uint8 we want each enumeration member to correspond to in parens next to the name, and this works fine:
classdef DataTypeEnumeration < uint8
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
end
In totally user-defined classes we use these parens to set properties, like
classdef DataTypeEnumeration
properties
underlying_value
end
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
methods
function obj = DataTypeEnumeration(v)
obj.underlying_value = v
end
end
end
but it does not seem there is any way to use this syntax for the built-in type, even if I am not actually trying to define a new property:
classdef DataTypeEnumeration < uint8
properties
some_special_underlying_value_property
end
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
methods
function obj = DataTypeEnumeration(v)
obj.some_special_underlying_value_property = uint8(v)
end
end
end
or even just
classdef DataTypeEnumeration < uint8
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
methods
function obj = DataTypeEnumeration(v)
obj = uint8(v)
end
end
end
seems like it should work. It kind of feels like the only reason we can’t tack on a property to an enumeration of some built-in type is because the interface doesn’t support it, which would be sad. What would be the harm in being able to let the parent object be constructed with the first argument and set properties with following arguments, like
classdef DataTypeEnumeration < uint8
properties
bytes
end
enumeration
UINT8 (0, 1)
UINT16 (1, 2)
UINT32 (2, 4)
UINT64 (3, 8)
end
methods
function obj = DataTypeEnumeration(b)
obj.bytes = b
end
end
endTrying to understand why we can’t subclass something like a uint8 and add a property. Say I want to enumerate data types and conveniently bundle the size of instances of the type in bytes.
In this first case, we specify which uint8 we want each enumeration member to correspond to in parens next to the name, and this works fine:
classdef DataTypeEnumeration < uint8
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
end
In totally user-defined classes we use these parens to set properties, like
classdef DataTypeEnumeration
properties
underlying_value
end
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
methods
function obj = DataTypeEnumeration(v)
obj.underlying_value = v
end
end
end
but it does not seem there is any way to use this syntax for the built-in type, even if I am not actually trying to define a new property:
classdef DataTypeEnumeration < uint8
properties
some_special_underlying_value_property
end
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
methods
function obj = DataTypeEnumeration(v)
obj.some_special_underlying_value_property = uint8(v)
end
end
end
or even just
classdef DataTypeEnumeration < uint8
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
methods
function obj = DataTypeEnumeration(v)
obj = uint8(v)
end
end
end
seems like it should work. It kind of feels like the only reason we can’t tack on a property to an enumeration of some built-in type is because the interface doesn’t support it, which would be sad. What would be the harm in being able to let the parent object be constructed with the first argument and set properties with following arguments, like
classdef DataTypeEnumeration < uint8
properties
bytes
end
enumeration
UINT8 (0, 1)
UINT16 (1, 2)
UINT32 (2, 4)
UINT64 (3, 8)
end
methods
function obj = DataTypeEnumeration(b)
obj.bytes = b
end
end
end Trying to understand why we can’t subclass something like a uint8 and add a property. Say I want to enumerate data types and conveniently bundle the size of instances of the type in bytes.
In this first case, we specify which uint8 we want each enumeration member to correspond to in parens next to the name, and this works fine:
classdef DataTypeEnumeration < uint8
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
end
In totally user-defined classes we use these parens to set properties, like
classdef DataTypeEnumeration
properties
underlying_value
end
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
methods
function obj = DataTypeEnumeration(v)
obj.underlying_value = v
end
end
end
but it does not seem there is any way to use this syntax for the built-in type, even if I am not actually trying to define a new property:
classdef DataTypeEnumeration < uint8
properties
some_special_underlying_value_property
end
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
methods
function obj = DataTypeEnumeration(v)
obj.some_special_underlying_value_property = uint8(v)
end
end
end
or even just
classdef DataTypeEnumeration < uint8
enumeration
UINT8 (0)
UINT16 (1)
UINT32 (2)
UINT64 (3)
end
methods
function obj = DataTypeEnumeration(v)
obj = uint8(v)
end
end
end
seems like it should work. It kind of feels like the only reason we can’t tack on a property to an enumeration of some built-in type is because the interface doesn’t support it, which would be sad. What would be the harm in being able to let the parent object be constructed with the first argument and set properties with following arguments, like
classdef DataTypeEnumeration < uint8
properties
bytes
end
enumeration
UINT8 (0, 1)
UINT16 (1, 2)
UINT32 (2, 4)
UINT64 (3, 8)
end
methods
function obj = DataTypeEnumeration(b)
obj.bytes = b
end
end
end enumeration, subclass, built-in, properties MATLAB Answers — New Questions
How can I determine the angle between two vectors in MATLAB?
How can I determine the angle between two vectors in MATLAB?
I have two vectors. Is there a MATLAB function that can determine the angle between them?How can I determine the angle between two vectors in MATLAB?
I have two vectors. Is there a MATLAB function that can determine the angle between them? How can I determine the angle between two vectors in MATLAB?
I have two vectors. Is there a MATLAB function that can determine the angle between them? angle, vectors, dot, theta MATLAB Answers — New Questions
Optimal control of SEIR with RK4 method problem on updating
Hello everyone,
I am trying to implement an optimal control problem using Runge-Kutta 4th order for a SEIR model with two different categories. My code is running and provides an optimal control but the state variables S,E,I and R remain as if no intervention occurs, which means that the update of the second part is somehow not implemented in it? I don’t understand where is the problem. I ran it some times and the results were fine but then all of a sudden it just gives me S,E,I and R as if no control is imposed on the model. Can you please have a look? code follows
function y=odeNEW
test=-1;
T=400;
deltaError=0.001;
M=1000;
t=linspace(0,T,M+1);
h=T/M;
h2=h/2;
C=0.001; K=1000; B=1;
g=0.0625; bcc=0.25; bca=0.11; bac=0.11; baa=0.34;
Sc=zeros(1,M+1);
Sa=zeros(1,M+1);
Ic=zeros(1,M+1);
Ia=zeros(1,M+1);
Rc=zeros(1,M+1);
Ra=zeros(1,M+1);
%init
Sc(1)=0.199; Sa(1)=0.699; Ic(1)=0.001; Ia(1)=0.001; Ra(1)=0; Rc(1)=0;
u=zeros(1,M+1);
LSc=zeros(1,M+1); LSa=zeros(1,M+1); LIc=zeros(1,M+1); LIa=zeros(1,M+1);
%final time
LSc(M+1)=0; LSa(M+1)=0; LIc(M+1)=0; LIa(M+1)=0;
J=zeros(1,M+1);
while (test<0)
oldu=u;
oldSc=Sc;
oldSa=Sa;
oldIc=Ic;
oldIa=Ia;
oldRc=Rc;
oldRa=Ra;
oldLSa=LSa;
oldLSc=LSc;
oldLIc=LIc;
oldLIa=LIa;
for i=1:M
m11=-u(i)*bcc*Sc(i)*Ic(i)-bca*u(i)*Sc(i)*Ia(i);
m12=bcc*u(i)*Sc(i)*Ic(i)+bca*u(i)*Sc(i)*Ia(i)-g*Ic(i);
m13=g*Ic(i);
m14=-bac*u(i)*Sa(i)*Ic(i)-baa*u(i)*Sa(i)*Ia(i);
m15=bac*u(i)*Sa(i)*Ic(i)+baa*Sa(i)*u(i)*Ia(i)-g*Ia(i);
m16=g*Ia(i);
%
aux=0.5*(u(i)+u(i+1));
m21=-aux*bcc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sc(j-1)+(LSa(j)-h*n33)*baa*u(j-1)*Sa(j-1)- (LIa(j)-h*n34)*(baa*u(j-1)*Sa(j-1)-g);
%
LSc(j-1) = LSc(j)-(h/6)*( n11 + 2*n21 + 2*n31 + n41 ) ;
LIc(j-1) = LIc(j)-(h/6)*( n12 + 2*n22 + 2*n32 + n42 ) ;
LSa(j-1) = LSa(j)-(h/6)*( n13 + 2*n23 + 2*n33 + n43 ) ;
LIa(j-1) = LIa(j)-(h/6)*( n14 + 2*n24 + 2*n34 + n44 ) ;
end
%new control vector
for i=1:M+1
vAux(i)=0.5*(bcc*LSc(i)*Sc(i)*Ic(i)+bca*Sc(i)*Ia(i)-LIc(i)*(bcc*Sc(i)*Ic(i)+bca*Sc(i)*Ia(i))+LSa(i)*(bac*Sa(i)*Ic(i)+baa*Sc(i)*Ia(i))-LIa(i)*(bac*Sa(i)*Ic(i)+baa*Sa(i)*Ia(i)));
auxU = min([max([0 vAux(i)]) 0.9]);
u(i) = 0.5* (auxU + oldu(i));
end
b=10^2;
J= Ic(M+1)+Rc(M+1)+Ia(M+1)+Ra(M+1)-trapz( t,b*(u .^2) );
%absolute error for convergence
temp1=deltaError*sum(abs(Sc))-sum(abs(oldSc-Sc));
temp2=deltaError*sum(abs(Sa))-sum(abs(oldSa-Sa));
temp3=deltaError*sum(abs(Ic)-sum(abs(oldIc-Ic)));
temp4=deltaError*sum(abs(Ia))-sum(abs(oldIa-Ia));
temp5=deltaError*sum(abs(u))-sum(abs(oldu-u));
temp6=deltaError*sum(abs(LSc))-sum(abs(oldLSc-LSc));
temp7=deltaError*sum(abs(LSa))-sum(abs(oldLSa-LSa));
temp8=deltaError*sum(abs(LIc))-sum(abs(oldLIc-LIc));
% temp11=deltaError*sum(abs(LRc))-sum(abs(oldLRc-LRc));
%temp12=deltaError*sum(abs(LRa))-sum(abs(oldLRa-LRa));
temp9=deltaError*sum(abs(Rc))-sum(abs(oldRc-Rc));
temp10=deltaError*sum(abs(Ra))-sum(abs(oldRa-Ra));
test = min(temp1,min(temp2,min(temp3,min(temp4,min(temp5,min(temp6,min(temp7,min(temp8,min(temp9,min(temp10))))))))));
plot(t,u)
endHello everyone,
I am trying to implement an optimal control problem using Runge-Kutta 4th order for a SEIR model with two different categories. My code is running and provides an optimal control but the state variables S,E,I and R remain as if no intervention occurs, which means that the update of the second part is somehow not implemented in it? I don’t understand where is the problem. I ran it some times and the results were fine but then all of a sudden it just gives me S,E,I and R as if no control is imposed on the model. Can you please have a look? code follows
function y=odeNEW
test=-1;
T=400;
deltaError=0.001;
M=1000;
t=linspace(0,T,M+1);
h=T/M;
h2=h/2;
C=0.001; K=1000; B=1;
g=0.0625; bcc=0.25; bca=0.11; bac=0.11; baa=0.34;
Sc=zeros(1,M+1);
Sa=zeros(1,M+1);
Ic=zeros(1,M+1);
Ia=zeros(1,M+1);
Rc=zeros(1,M+1);
Ra=zeros(1,M+1);
%init
Sc(1)=0.199; Sa(1)=0.699; Ic(1)=0.001; Ia(1)=0.001; Ra(1)=0; Rc(1)=0;
u=zeros(1,M+1);
LSc=zeros(1,M+1); LSa=zeros(1,M+1); LIc=zeros(1,M+1); LIa=zeros(1,M+1);
%final time
LSc(M+1)=0; LSa(M+1)=0; LIc(M+1)=0; LIa(M+1)=0;
J=zeros(1,M+1);
while (test<0)
oldu=u;
oldSc=Sc;
oldSa=Sa;
oldIc=Ic;
oldIa=Ia;
oldRc=Rc;
oldRa=Ra;
oldLSa=LSa;
oldLSc=LSc;
oldLIc=LIc;
oldLIa=LIa;
for i=1:M
m11=-u(i)*bcc*Sc(i)*Ic(i)-bca*u(i)*Sc(i)*Ia(i);
m12=bcc*u(i)*Sc(i)*Ic(i)+bca*u(i)*Sc(i)*Ia(i)-g*Ic(i);
m13=g*Ic(i);
m14=-bac*u(i)*Sa(i)*Ic(i)-baa*u(i)*Sa(i)*Ia(i);
m15=bac*u(i)*Sa(i)*Ic(i)+baa*Sa(i)*u(i)*Ia(i)-g*Ia(i);
m16=g*Ia(i);
%
aux=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) -(LIc(j)-h*n32)*bca*u(j-1)*Sc(j-1)+(LSa(j)-h*n33)*baa*u(j-1)*Sa(j-1)- (LIa(j)-h*n34)*(baa*u(j-1)*Sa(j-1)-g);
%
LSc(j-1) = LSc(j)-(h/6)*( n11 + 2*n21 + 2*n31 + n41 ) ;
LIc(j-1) = LIc(j)-(h/6)*( n12 + 2*n22 + 2*n32 + n42 ) ;
LSa(j-1) = LSa(j)-(h/6)*( n13 + 2*n23 + 2*n33 + n43 ) ;
LIa(j-1) = LIa(j)-(h/6)*( n14 + 2*n24 + 2*n34 + n44 ) ;
end
%new control vector
for i=1:M+1
vAux(i)=0.5*(bcc*LSc(i)*Sc(i)*Ic(i)+bca*Sc(i)*Ia(i)-LIc(i)*(bcc*Sc(i)*Ic(i)+bca*Sc(i)*Ia(i))+LSa(i)*(bac*Sa(i)*Ic(i)+baa*Sc(i)*Ia(i))-LIa(i)*(bac*Sa(i)*Ic(i)+baa*Sa(i)*Ia(i)));
auxU = min([max([0 vAux(i)]) 0.9]);
u(i) = 0.5* (auxU + oldu(i));
end
b=10^2;
J= Ic(M+1)+Rc(M+1)+Ia(M+1)+Ra(M+1)-trapz( t,b*(u .^2) );
%absolute error for convergence
temp1=deltaError*sum(abs(Sc))-sum(abs(oldSc-Sc));
temp2=deltaError*sum(abs(Sa))-sum(abs(oldSa-Sa));
temp3=deltaError*sum(abs(Ic)-sum(abs(oldIc-Ic)));
temp4=deltaError*sum(abs(Ia))-sum(abs(oldIa-Ia));
temp5=deltaError*sum(abs(u))-sum(abs(oldu-u));
temp6=deltaError*sum(abs(LSc))-sum(abs(oldLSc-LSc));
temp7=deltaError*sum(abs(LSa))-sum(abs(oldLSa-LSa));
temp8=deltaError*sum(abs(LIc))-sum(abs(oldLIc-LIc));
% temp11=deltaError*sum(abs(LRc))-sum(abs(oldLRc-LRc));
%temp12=deltaError*sum(abs(LRa))-sum(abs(oldLRa-LRa));
temp9=deltaError*sum(abs(Rc))-sum(abs(oldRc-Rc));
temp10=deltaError*sum(abs(Ra))-sum(abs(oldRa-Ra));
test = min(temp1,min(temp2,min(temp3,min(temp4,min(temp5,min(temp6,min(temp7,min(temp8,min(temp9,min(temp10))))))))));
plot(t,u)
end Hello everyone,
I am trying to implement an optimal control problem using Runge-Kutta 4th order for a SEIR model with two different categories. My code is running and provides an optimal control but the state variables S,E,I and R remain as if no intervention occurs, which means that the update of the second part is somehow not implemented in it? I don’t understand where is the problem. I ran it some times and the results were fine but then all of a sudden it just gives me S,E,I and R as if no control is imposed on the model. Can you please have a look? code follows
function y=odeNEW
test=-1;
T=400;
deltaError=0.001;
M=1000;
t=linspace(0,T,M+1);
h=T/M;
h2=h/2;
C=0.001; K=1000; B=1;
g=0.0625; bcc=0.25; bca=0.11; bac=0.11; baa=0.34;
Sc=zeros(1,M+1);
Sa=zeros(1,M+1);
Ic=zeros(1,M+1);
Ia=zeros(1,M+1);
Rc=zeros(1,M+1);
Ra=zeros(1,M+1);
%init
Sc(1)=0.199; Sa(1)=0.699; Ic(1)=0.001; Ia(1)=0.001; Ra(1)=0; Rc(1)=0;
u=zeros(1,M+1);
LSc=zeros(1,M+1); LSa=zeros(1,M+1); LIc=zeros(1,M+1); LIa=zeros(1,M+1);
%final time
LSc(M+1)=0; LSa(M+1)=0; LIc(M+1)=0; LIa(M+1)=0;
J=zeros(1,M+1);
while (test<0)
oldu=u;
oldSc=Sc;
oldSa=Sa;
oldIc=Ic;
oldIa=Ia;
oldRc=Rc;
oldRa=Ra;
oldLSa=LSa;
oldLSc=LSc;
oldLIc=LIc;
oldLIa=LIa;
for i=1:M
m11=-u(i)*bcc*Sc(i)*Ic(i)-bca*u(i)*Sc(i)*Ia(i);
m12=bcc*u(i)*Sc(i)*Ic(i)+bca*u(i)*Sc(i)*Ia(i)-g*Ic(i);
m13=g*Ic(i);
m14=-bac*u(i)*Sa(i)*Ic(i)-baa*u(i)*Sa(i)*Ia(i);
m15=bac*u(i)*Sa(i)*Ic(i)+baa*Sa(i)*u(i)*Ia(i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c(j)-h*n31)*bca*u(j-1)*Sc(j-1) -(LIc(j)-h*n32)*bca*u(j-1)*Sc(j-1)+(LSa(j)-h*n33)*baa*u(j-1)*Sa(j-1)- (LIa(j)-h*n34)*(baa*u(j-1)*Sa(j-1)-g);
%
LSc(j-1) = LSc(j)-(h/6)*( n11 + 2*n21 + 2*n31 + n41 ) ;
LIc(j-1) = LIc(j)-(h/6)*( n12 + 2*n22 + 2*n32 + n42 ) ;
LSa(j-1) = LSa(j)-(h/6)*( n13 + 2*n23 + 2*n33 + n43 ) ;
LIa(j-1) = LIa(j)-(h/6)*( n14 + 2*n24 + 2*n34 + n44 ) ;
end
%new control vector
for i=1:M+1
vAux(i)=0.5*(bcc*LSc(i)*Sc(i)*Ic(i)+bca*Sc(i)*Ia(i)-LIc(i)*(bcc*Sc(i)*Ic(i)+bca*Sc(i)*Ia(i))+LSa(i)*(bac*Sa(i)*Ic(i)+baa*Sc(i)*Ia(i))-LIa(i)*(bac*Sa(i)*Ic(i)+baa*Sa(i)*Ia(i)));
auxU = min([max([0 vAux(i)]) 0.9]);
u(i) = 0.5* (auxU + oldu(i));
end
b=10^2;
J= Ic(M+1)+Rc(M+1)+Ia(M+1)+Ra(M+1)-trapz( t,b*(u .^2) );
%absolute error for convergence
temp1=deltaError*sum(abs(Sc))-sum(abs(oldSc-Sc));
temp2=deltaError*sum(abs(Sa))-sum(abs(oldSa-Sa));
temp3=deltaError*sum(abs(Ic)-sum(abs(oldIc-Ic)));
temp4=deltaError*sum(abs(Ia))-sum(abs(oldIa-Ia));
temp5=deltaError*sum(abs(u))-sum(abs(oldu-u));
temp6=deltaError*sum(abs(LSc))-sum(abs(oldLSc-LSc));
temp7=deltaError*sum(abs(LSa))-sum(abs(oldLSa-LSa));
temp8=deltaError*sum(abs(LIc))-sum(abs(oldLIc-LIc));
% temp11=deltaError*sum(abs(LRc))-sum(abs(oldLRc-LRc));
%temp12=deltaError*sum(abs(LRa))-sum(abs(oldLRa-LRa));
temp9=deltaError*sum(abs(Rc))-sum(abs(oldRc-Rc));
temp10=deltaError*sum(abs(Ra))-sum(abs(oldRa-Ra));
test = min(temp1,min(temp2,min(temp3,min(temp4,min(temp5,min(temp6,min(temp7,min(temp8,min(temp9,min(temp10))))))))));
plot(t,u)
end optimal control, seir, runge-kutta, backward forward sweep method MATLAB Answers — New Questions
when connecting to Raspberry Pi 4-B board: Error executing command “make ONLY_MATLAB_IO=1 -C /opt/MATLAB/mw_server_v22.1.0 -f Makefile”.
while trying to run MATLAB on my RPI 4 I get the following error. Any help as to what the problem is?
Error executing command "make ONLY_MATLAB_IO=0 -C /opt/MATLAB/mw_server_v23.1.0 -f Makefile". Details:
STDERR: t’
32 | void display_valid_parameters(char *name, void (*app_help)(char*));
| ~~~~~~^~~~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_INIT’:
frameBuffer.c:54:55: warning: comparison between pointer and zero character constant [-Wpointer-compare]
54 | for(ii=0;ii<100 & glob_buffer.gl_pathv[i] != ”;ii++)
| ^~
frameBuffer.c:54:31: note: did you mean to dereference the pointer?
54 | for(ii=0;ii<100 & glob_buffer.gl_pathv[i] != ”;ii++)
| ^
frameBuffer.c:54:24: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
54 | for(ii=0;ii<100 & glob_buffer.gl_pathv[i] != ”;ii++)
| ~~^~~~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_WRITEPIXEL’:
frameBuffer.c:80:9: warning: unused variable ‘ii’ [-Wunused-variable]
80 | int ii ;
| ^~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_DISPLAYIMAGE’:
frameBuffer.c:107:17: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
107 | for(ii=0; ii<100 & sh_fbname[ii] != ”; ii++)
| ~~^~~~
frameBuffer.c:105:10: warning: variable ‘fileName’ set but not used [-Wunused-but-set-variable]
105 | char fileName[100];
| ^~~~~~~~
frameBuffer.c:104:9: warning: unused variable ‘pxllocation’ [-Wunused-variable]
104 | int pxllocation=0;
| ^~~~~~~~~~~
joystick.c: In function ‘EXT_JOYSTICK_INIT’:
joystick.c:45:56: warning: comparison between pointer and zero character constant [-Wpointer-compare]
45 | for(ii=0; ii<100 & glob_buffer.gl_pathv[i] != ”; ii++)
| ^~
joystick.c:45:32: note: did you mean to dereference the pointer?
45 | for(ii=0; ii<100 & glob_buffer.gl_pathv[i] != ”; ii++)
| ^
joystick.c:45:25: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
45 | for(ii=0; ii<100 & glob_buffer.gl_pathv[i] != ”; ii++)
| ~~^~~~
joystick.c: In function ‘EXT_JOYSTICK_READ’:
joystick.c:82:17: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
82 | for(ii=0;(ii<100 & sh_evdevName[ii] != ”);ii++)
| ~~^~~~
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgPubInit’:
IO_wrapperNanomsgPubSub.c:49:13: warning: pointer targets in assignment from ‘uint8_T *’ {aka ‘unsigned char *’} to ‘char_T *’
{aka ‘char *’} differ in signedness [-Wpointer-sign]
49 | mdlName = &payloadBufferRx[1];
| ^
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgSubInit’:
IO_wrapperNanomsgPubSub.c:73:13: warning: pointer targets in assignment from ‘uint8_T *’ {aka ‘unsigned char *’} to ‘char_T *’
{aka ‘char *’} differ in signedness [-Wpointer-sign]
73 | mdlName = &payloadBufferRx[1];
| ^
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgClientSend’:
IO_wrapperNanomsgPubSub.c:101:14: warning: pointer targets in assignment from ‘uint8_T *’ {aka ‘unsigned char *’} to ‘char_T
*’ {aka ‘char *’} differ in signedness [-Wpointer-sign]
101 | jsonData = &payloadBufferRx[index];
| ^
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgClientRecv’:
IO_wrapperNanomsgPubSub.c:112:14: warning: unused variable ‘index’ [-Wunused-variable]
112 | uint32_T index = 0;
| ^~~~~
MW_Pyserver_control.c: In function ‘MW_execmd’:
MW_Pyserver_control.c:127:9: warning: unused variable ‘ret’ [-Wunused-variable]
127 | int ret = 0, bufferLoc = 0;
| ^~~
MW_Pyserver_control.c: In function ‘MW_getDefines’:
MW_Pyserver_control.c:43:29: warning: ‘MW_pyserver.py’ directive writing 14 bytes into a region of size between 1 and 65535
[-Wformat-overflow=]
43 | sprintf(pyserverLoc, "%sMW_pyserver.py", exePath);
| ^~~~~~~~~~~~~~
MW_Pyserver_control.c:43:5: note: ‘sprintf’ output between 15 and 65549 bytes into a destination of size 65535
43 | sprintf(pyserverLoc, "%sMW_pyserver.py", exePath);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MW_Pyserver_control.c: In function ‘MW_killPyserver’:
MW_Pyserver_control.c:69:34: warning: ‘%s’ directive writing up to 65534 bytes into a region of size 186 [-Wformat-overflow=]
69 | sprintf(buff, "sudo pkill -f %s", pyserverLoc);
| ^~ ~~~~~~~~~~~
MW_Pyserver_control.c:69:5: note: ‘sprintf’ output between 15 and 65549 bytes into a destination of size 200
69 | sprintf(buff, "sudo pkill -f %s", pyserverLoc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MW_Pyserver_control.c: In function ‘MW_launchPyserver’:
MW_Pyserver_control.c:95:24: warning: ‘%s’ directive writing up to 65534 bytes into a region of size 250 [-Wformat-overflow=]
95 | sprintf(cmd, "sudo %s %s >/tmp/mw_websoc_sl_io.log &", pyserverLoc, jsonFileLoc);
| ^~ ~~~~~~~~~~~
MW_Pyserver_control.c:95:5: note: ‘sprintf’ output between 35 and 66592 bytes into a destination of size 255
95 | sprintf(cmd, "sudo %s %s >/tmp/mw_websoc_sl_io.log &", pyserverLoc, jsonFileLoc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MW_JSONParser.c: In function ‘MW_getSignalStr’:
MW_JSONParser.c:22:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
22 | *SigStr = json_object_to_json_string(Signals);
| ^
MW_JSONParser.c: In function ‘MW_getDashboardSourceData’:
MW_JSONParser.c:40:20: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
40 | *BlockLabelStr = json_object_get_string(blocklabelWithID);
| ^
MW_JSONParser.c:44:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
44 | *BlockIDStr = json_object_get_string(blockID);
| ^
MW_JSONParser.c:35:9: warning: variable ‘keyExists’ set but not used [-Wunused-but-set-variable]
35 | int keyExists;
| ^~~~~~~~~
MW_JSONParser.c: In function ‘MW_getPortData’:
MW_JSONParser.c:62:13: warning: variable ‘dataOut’ set but not used [-Wunused-but-set-variable]
62 | double *dataOut;
| ^~~~~~~
MW_JSONParser.c:61:10: warning: unused variable ‘dataType’ [-Wunused-variable]
61 | char dataType[1024];
| ^~~~~~~~
/usr/bin/ld: cannot find -lmmal: No such file or directory
/usr/bin/ld: cannot find -lmmal_core: No such file or directory
/usr/bin/ld: cannot find -lmmal_util: No such file or directory
/usr/bin/ld: cannot find -lmmal_vc_client: No such file or directory
/usr/bin/ld: cannot find -lvcos: No such file or directory
/usr/bin/ld: cannot find -lbcm_host: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:93: build] Error 1
STDOUT: make: Entering directory ‘/opt/MATLAB/mw_server_v23.1.0’
[Compiling] IO_wrapperv4l2.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperv4l2.c -o obj/IO_wrapperv4l2.o
[Compiling] MW_PWM.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_PWM.c -o obj/MW_PWM.o
[Compiling] MW_pigs.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_pigs.c -o obj/MW_pigs.o
[Compiling] sharedServer.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE sharedServer.c -o obj/sharedServer.o
[Compiling] IO_wrapperCameraboard.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperCameraboard.c -o obj/IO_wrapperCameraboard.o
[Compiling] mw_wrapperCANChannel.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE mw_wrapperCANChannel.c -o obj/mw_wrapperCANChannel.o
[Compiling] LED.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE LED.c -o obj/LED.o
[Compiling] picam.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE picam.c -o obj/picam.o
[Compiling] system.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE system.c -o obj/system.o
[Compiling] IO_wrapperLED.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperLED.c -o obj/IO_wrapperLED.o
[Compiling] MW_digitalIO.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_digitalIO.c -o obj/MW_digitalIO.o
[Compiling] customFunction.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE customFunction.c -o obj/customFunction.o
[Compiling] servoRaspi.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE servoRaspi.c -o obj/servoRaspi.o
[Compiling] IO_checksum.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_checksum.c -o obj/IO_checksum.o
[Compiling] IO_packet.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_packet.c -o obj/IO_packet.o
[Compiling] IO_standardperipherals.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_standardperipherals.c -o obj/IO_standardperipherals.o
[Compiling] IO_wrapperI2C.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperI2C.c -o obj/IO_wrapperI2C.o
[Compiling] IO_wrapperPulseIn.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperPulseIn.c -o obj/IO_wrapperPulseIn.o
[Compiling] IO_wrapperSCI.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperSCI.c -o obj/IO_wrapperSCI.o
[Compiling] PeripheralToHandle.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE PeripheralToHandle.c -o obj/PeripheralToHandle.o
[Compiling] IO_debug.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_debug.c -o obj/IO_debug.o
[Compiling] IO_server.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_server.c -o obj/IO_server.o
[Compiling] IO_utilities.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_utilities.c -o obj/IO_utilities.o
[Compiling] IO_wrapperDigitalIO.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperDigitalIO.c -o obj/IO_wrapperDigitalIO.o
[Compiling] IO_wrapperPWM.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperPWM.c -o obj/IO_wrapperPWM.o
[Compiling] IO_wrapperSPI.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperSPI.c -o obj/IO_wrapperSPI.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiCamControl.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiCamControl.c
-o obj/RaspiCamControl.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiHelpers.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiHelpers.c -o
obj/RaspiHelpers.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiPreview.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiPreview.c -o
obj/RaspiPreview.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiCLI.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiCLI.c -o
obj/RaspiCLI.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiCommonSettings.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE
/opt/userland/host_applications/linux/apps/raspicam/RaspiCommonSettings.c -o obj/RaspiCommonSettings.o
[Compiling] frameBuffer.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE frameBuffer.c -o obj/frameBuffer.o
[Compiling] frameBufferRaspi.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE frameBufferRaspi.c -o obj/frameBufferRaspi.o
[Compiling] joystick.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE joystick.c -o obj/joystick.o
[Compiling] joystickRaspi.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE joystickRaspi.c -o obj/joystickRaspi.o
[Compiling] runCommand.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE runCommand.c -o obj/runCommand.o
[Compiling] IO_wrapperNanomsgPubSub.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperNanomsgPubSub.c -o obj/IO_wrapperNanomsgPubSub.o
[Compiling] MW_Pyserver_control.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_Pyserver_control.c -o obj/MW_Pyserver_control.o
[Compiling] MW_nanomsgClient.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_nanomsgClient.c -o obj/MW_nanomsgClient.o
[Compiling] MW_JSONParser.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_JSONParser.c -o obj/MW_JSONParser.o
[Compiling] IO_wrapperEncoder.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperEncoder.c -o obj/IO_wrapperEncoder.o
[Compiling] MW_RaspiEncoder.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_RaspiEncoder.c -o obj/MW_RaspiEncoder.o
[Compiling] IO_wrapper_i2c_pwm_pca9685.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapper_i2c_pwm_pca9685.c -o obj/IO_wrapper_i2c_pwm_pca9685.o
[Compiling] MW_i2c_pwm_pca9685.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_i2c_pwm_pca9685.c -o obj/MW_i2c_pwm_pca9685.o
echo [Linking]
[Linking]
make: Leaving directory ‘/opt/MATLAB/mw_server_v23.1.0’while trying to run MATLAB on my RPI 4 I get the following error. Any help as to what the problem is?
Error executing command "make ONLY_MATLAB_IO=0 -C /opt/MATLAB/mw_server_v23.1.0 -f Makefile". Details:
STDERR: t’
32 | void display_valid_parameters(char *name, void (*app_help)(char*));
| ~~~~~~^~~~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_INIT’:
frameBuffer.c:54:55: warning: comparison between pointer and zero character constant [-Wpointer-compare]
54 | for(ii=0;ii<100 & glob_buffer.gl_pathv[i] != ”;ii++)
| ^~
frameBuffer.c:54:31: note: did you mean to dereference the pointer?
54 | for(ii=0;ii<100 & glob_buffer.gl_pathv[i] != ”;ii++)
| ^
frameBuffer.c:54:24: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
54 | for(ii=0;ii<100 & glob_buffer.gl_pathv[i] != ”;ii++)
| ~~^~~~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_WRITEPIXEL’:
frameBuffer.c:80:9: warning: unused variable ‘ii’ [-Wunused-variable]
80 | int ii ;
| ^~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_DISPLAYIMAGE’:
frameBuffer.c:107:17: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
107 | for(ii=0; ii<100 & sh_fbname[ii] != ”; ii++)
| ~~^~~~
frameBuffer.c:105:10: warning: variable ‘fileName’ set but not used [-Wunused-but-set-variable]
105 | char fileName[100];
| ^~~~~~~~
frameBuffer.c:104:9: warning: unused variable ‘pxllocation’ [-Wunused-variable]
104 | int pxllocation=0;
| ^~~~~~~~~~~
joystick.c: In function ‘EXT_JOYSTICK_INIT’:
joystick.c:45:56: warning: comparison between pointer and zero character constant [-Wpointer-compare]
45 | for(ii=0; ii<100 & glob_buffer.gl_pathv[i] != ”; ii++)
| ^~
joystick.c:45:32: note: did you mean to dereference the pointer?
45 | for(ii=0; ii<100 & glob_buffer.gl_pathv[i] != ”; ii++)
| ^
joystick.c:45:25: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
45 | for(ii=0; ii<100 & glob_buffer.gl_pathv[i] != ”; ii++)
| ~~^~~~
joystick.c: In function ‘EXT_JOYSTICK_READ’:
joystick.c:82:17: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
82 | for(ii=0;(ii<100 & sh_evdevName[ii] != ”);ii++)
| ~~^~~~
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgPubInit’:
IO_wrapperNanomsgPubSub.c:49:13: warning: pointer targets in assignment from ‘uint8_T *’ {aka ‘unsigned char *’} to ‘char_T *’
{aka ‘char *’} differ in signedness [-Wpointer-sign]
49 | mdlName = &payloadBufferRx[1];
| ^
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgSubInit’:
IO_wrapperNanomsgPubSub.c:73:13: warning: pointer targets in assignment from ‘uint8_T *’ {aka ‘unsigned char *’} to ‘char_T *’
{aka ‘char *’} differ in signedness [-Wpointer-sign]
73 | mdlName = &payloadBufferRx[1];
| ^
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgClientSend’:
IO_wrapperNanomsgPubSub.c:101:14: warning: pointer targets in assignment from ‘uint8_T *’ {aka ‘unsigned char *’} to ‘char_T
*’ {aka ‘char *’} differ in signedness [-Wpointer-sign]
101 | jsonData = &payloadBufferRx[index];
| ^
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgClientRecv’:
IO_wrapperNanomsgPubSub.c:112:14: warning: unused variable ‘index’ [-Wunused-variable]
112 | uint32_T index = 0;
| ^~~~~
MW_Pyserver_control.c: In function ‘MW_execmd’:
MW_Pyserver_control.c:127:9: warning: unused variable ‘ret’ [-Wunused-variable]
127 | int ret = 0, bufferLoc = 0;
| ^~~
MW_Pyserver_control.c: In function ‘MW_getDefines’:
MW_Pyserver_control.c:43:29: warning: ‘MW_pyserver.py’ directive writing 14 bytes into a region of size between 1 and 65535
[-Wformat-overflow=]
43 | sprintf(pyserverLoc, "%sMW_pyserver.py", exePath);
| ^~~~~~~~~~~~~~
MW_Pyserver_control.c:43:5: note: ‘sprintf’ output between 15 and 65549 bytes into a destination of size 65535
43 | sprintf(pyserverLoc, "%sMW_pyserver.py", exePath);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MW_Pyserver_control.c: In function ‘MW_killPyserver’:
MW_Pyserver_control.c:69:34: warning: ‘%s’ directive writing up to 65534 bytes into a region of size 186 [-Wformat-overflow=]
69 | sprintf(buff, "sudo pkill -f %s", pyserverLoc);
| ^~ ~~~~~~~~~~~
MW_Pyserver_control.c:69:5: note: ‘sprintf’ output between 15 and 65549 bytes into a destination of size 200
69 | sprintf(buff, "sudo pkill -f %s", pyserverLoc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MW_Pyserver_control.c: In function ‘MW_launchPyserver’:
MW_Pyserver_control.c:95:24: warning: ‘%s’ directive writing up to 65534 bytes into a region of size 250 [-Wformat-overflow=]
95 | sprintf(cmd, "sudo %s %s >/tmp/mw_websoc_sl_io.log &", pyserverLoc, jsonFileLoc);
| ^~ ~~~~~~~~~~~
MW_Pyserver_control.c:95:5: note: ‘sprintf’ output between 35 and 66592 bytes into a destination of size 255
95 | sprintf(cmd, "sudo %s %s >/tmp/mw_websoc_sl_io.log &", pyserverLoc, jsonFileLoc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MW_JSONParser.c: In function ‘MW_getSignalStr’:
MW_JSONParser.c:22:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
22 | *SigStr = json_object_to_json_string(Signals);
| ^
MW_JSONParser.c: In function ‘MW_getDashboardSourceData’:
MW_JSONParser.c:40:20: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
40 | *BlockLabelStr = json_object_get_string(blocklabelWithID);
| ^
MW_JSONParser.c:44:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
44 | *BlockIDStr = json_object_get_string(blockID);
| ^
MW_JSONParser.c:35:9: warning: variable ‘keyExists’ set but not used [-Wunused-but-set-variable]
35 | int keyExists;
| ^~~~~~~~~
MW_JSONParser.c: In function ‘MW_getPortData’:
MW_JSONParser.c:62:13: warning: variable ‘dataOut’ set but not used [-Wunused-but-set-variable]
62 | double *dataOut;
| ^~~~~~~
MW_JSONParser.c:61:10: warning: unused variable ‘dataType’ [-Wunused-variable]
61 | char dataType[1024];
| ^~~~~~~~
/usr/bin/ld: cannot find -lmmal: No such file or directory
/usr/bin/ld: cannot find -lmmal_core: No such file or directory
/usr/bin/ld: cannot find -lmmal_util: No such file or directory
/usr/bin/ld: cannot find -lmmal_vc_client: No such file or directory
/usr/bin/ld: cannot find -lvcos: No such file or directory
/usr/bin/ld: cannot find -lbcm_host: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:93: build] Error 1
STDOUT: make: Entering directory ‘/opt/MATLAB/mw_server_v23.1.0’
[Compiling] IO_wrapperv4l2.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperv4l2.c -o obj/IO_wrapperv4l2.o
[Compiling] MW_PWM.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_PWM.c -o obj/MW_PWM.o
[Compiling] MW_pigs.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_pigs.c -o obj/MW_pigs.o
[Compiling] sharedServer.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE sharedServer.c -o obj/sharedServer.o
[Compiling] IO_wrapperCameraboard.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperCameraboard.c -o obj/IO_wrapperCameraboard.o
[Compiling] mw_wrapperCANChannel.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE mw_wrapperCANChannel.c -o obj/mw_wrapperCANChannel.o
[Compiling] LED.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE LED.c -o obj/LED.o
[Compiling] picam.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE picam.c -o obj/picam.o
[Compiling] system.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE system.c -o obj/system.o
[Compiling] IO_wrapperLED.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperLED.c -o obj/IO_wrapperLED.o
[Compiling] MW_digitalIO.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_digitalIO.c -o obj/MW_digitalIO.o
[Compiling] customFunction.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE customFunction.c -o obj/customFunction.o
[Compiling] servoRaspi.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE servoRaspi.c -o obj/servoRaspi.o
[Compiling] IO_checksum.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_checksum.c -o obj/IO_checksum.o
[Compiling] IO_packet.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_packet.c -o obj/IO_packet.o
[Compiling] IO_standardperipherals.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_standardperipherals.c -o obj/IO_standardperipherals.o
[Compiling] IO_wrapperI2C.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperI2C.c -o obj/IO_wrapperI2C.o
[Compiling] IO_wrapperPulseIn.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperPulseIn.c -o obj/IO_wrapperPulseIn.o
[Compiling] IO_wrapperSCI.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperSCI.c -o obj/IO_wrapperSCI.o
[Compiling] PeripheralToHandle.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE PeripheralToHandle.c -o obj/PeripheralToHandle.o
[Compiling] IO_debug.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_debug.c -o obj/IO_debug.o
[Compiling] IO_server.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_server.c -o obj/IO_server.o
[Compiling] IO_utilities.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_utilities.c -o obj/IO_utilities.o
[Compiling] IO_wrapperDigitalIO.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperDigitalIO.c -o obj/IO_wrapperDigitalIO.o
[Compiling] IO_wrapperPWM.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperPWM.c -o obj/IO_wrapperPWM.o
[Compiling] IO_wrapperSPI.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperSPI.c -o obj/IO_wrapperSPI.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiCamControl.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiCamControl.c
-o obj/RaspiCamControl.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiHelpers.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiHelpers.c -o
obj/RaspiHelpers.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiPreview.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiPreview.c -o
obj/RaspiPreview.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiCLI.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiCLI.c -o
obj/RaspiCLI.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiCommonSettings.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE
/opt/userland/host_applications/linux/apps/raspicam/RaspiCommonSettings.c -o obj/RaspiCommonSettings.o
[Compiling] frameBuffer.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE frameBuffer.c -o obj/frameBuffer.o
[Compiling] frameBufferRaspi.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE frameBufferRaspi.c -o obj/frameBufferRaspi.o
[Compiling] joystick.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE joystick.c -o obj/joystick.o
[Compiling] joystickRaspi.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE joystickRaspi.c -o obj/joystickRaspi.o
[Compiling] runCommand.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE runCommand.c -o obj/runCommand.o
[Compiling] IO_wrapperNanomsgPubSub.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperNanomsgPubSub.c -o obj/IO_wrapperNanomsgPubSub.o
[Compiling] MW_Pyserver_control.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_Pyserver_control.c -o obj/MW_Pyserver_control.o
[Compiling] MW_nanomsgClient.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_nanomsgClient.c -o obj/MW_nanomsgClient.o
[Compiling] MW_JSONParser.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_JSONParser.c -o obj/MW_JSONParser.o
[Compiling] IO_wrapperEncoder.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperEncoder.c -o obj/IO_wrapperEncoder.o
[Compiling] MW_RaspiEncoder.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_RaspiEncoder.c -o obj/MW_RaspiEncoder.o
[Compiling] IO_wrapper_i2c_pwm_pca9685.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapper_i2c_pwm_pca9685.c -o obj/IO_wrapper_i2c_pwm_pca9685.o
[Compiling] MW_i2c_pwm_pca9685.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_i2c_pwm_pca9685.c -o obj/MW_i2c_pwm_pca9685.o
echo [Linking]
[Linking]
make: Leaving directory ‘/opt/MATLAB/mw_server_v23.1.0’ while trying to run MATLAB on my RPI 4 I get the following error. Any help as to what the problem is?
Error executing command "make ONLY_MATLAB_IO=0 -C /opt/MATLAB/mw_server_v23.1.0 -f Makefile". Details:
STDERR: t’
32 | void display_valid_parameters(char *name, void (*app_help)(char*));
| ~~~~~~^~~~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_INIT’:
frameBuffer.c:54:55: warning: comparison between pointer and zero character constant [-Wpointer-compare]
54 | for(ii=0;ii<100 & glob_buffer.gl_pathv[i] != ”;ii++)
| ^~
frameBuffer.c:54:31: note: did you mean to dereference the pointer?
54 | for(ii=0;ii<100 & glob_buffer.gl_pathv[i] != ”;ii++)
| ^
frameBuffer.c:54:24: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
54 | for(ii=0;ii<100 & glob_buffer.gl_pathv[i] != ”;ii++)
| ~~^~~~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_WRITEPIXEL’:
frameBuffer.c:80:9: warning: unused variable ‘ii’ [-Wunused-variable]
80 | int ii ;
| ^~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_DISPLAYIMAGE’:
frameBuffer.c:107:17: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
107 | for(ii=0; ii<100 & sh_fbname[ii] != ”; ii++)
| ~~^~~~
frameBuffer.c:105:10: warning: variable ‘fileName’ set but not used [-Wunused-but-set-variable]
105 | char fileName[100];
| ^~~~~~~~
frameBuffer.c:104:9: warning: unused variable ‘pxllocation’ [-Wunused-variable]
104 | int pxllocation=0;
| ^~~~~~~~~~~
joystick.c: In function ‘EXT_JOYSTICK_INIT’:
joystick.c:45:56: warning: comparison between pointer and zero character constant [-Wpointer-compare]
45 | for(ii=0; ii<100 & glob_buffer.gl_pathv[i] != ”; ii++)
| ^~
joystick.c:45:32: note: did you mean to dereference the pointer?
45 | for(ii=0; ii<100 & glob_buffer.gl_pathv[i] != ”; ii++)
| ^
joystick.c:45:25: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
45 | for(ii=0; ii<100 & glob_buffer.gl_pathv[i] != ”; ii++)
| ~~^~~~
joystick.c: In function ‘EXT_JOYSTICK_READ’:
joystick.c:82:17: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
82 | for(ii=0;(ii<100 & sh_evdevName[ii] != ”);ii++)
| ~~^~~~
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgPubInit’:
IO_wrapperNanomsgPubSub.c:49:13: warning: pointer targets in assignment from ‘uint8_T *’ {aka ‘unsigned char *’} to ‘char_T *’
{aka ‘char *’} differ in signedness [-Wpointer-sign]
49 | mdlName = &payloadBufferRx[1];
| ^
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgSubInit’:
IO_wrapperNanomsgPubSub.c:73:13: warning: pointer targets in assignment from ‘uint8_T *’ {aka ‘unsigned char *’} to ‘char_T *’
{aka ‘char *’} differ in signedness [-Wpointer-sign]
73 | mdlName = &payloadBufferRx[1];
| ^
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgClientSend’:
IO_wrapperNanomsgPubSub.c:101:14: warning: pointer targets in assignment from ‘uint8_T *’ {aka ‘unsigned char *’} to ‘char_T
*’ {aka ‘char *’} differ in signedness [-Wpointer-sign]
101 | jsonData = &payloadBufferRx[index];
| ^
IO_wrapperNanomsgPubSub.c: In function ‘nanomsgClientRecv’:
IO_wrapperNanomsgPubSub.c:112:14: warning: unused variable ‘index’ [-Wunused-variable]
112 | uint32_T index = 0;
| ^~~~~
MW_Pyserver_control.c: In function ‘MW_execmd’:
MW_Pyserver_control.c:127:9: warning: unused variable ‘ret’ [-Wunused-variable]
127 | int ret = 0, bufferLoc = 0;
| ^~~
MW_Pyserver_control.c: In function ‘MW_getDefines’:
MW_Pyserver_control.c:43:29: warning: ‘MW_pyserver.py’ directive writing 14 bytes into a region of size between 1 and 65535
[-Wformat-overflow=]
43 | sprintf(pyserverLoc, "%sMW_pyserver.py", exePath);
| ^~~~~~~~~~~~~~
MW_Pyserver_control.c:43:5: note: ‘sprintf’ output between 15 and 65549 bytes into a destination of size 65535
43 | sprintf(pyserverLoc, "%sMW_pyserver.py", exePath);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MW_Pyserver_control.c: In function ‘MW_killPyserver’:
MW_Pyserver_control.c:69:34: warning: ‘%s’ directive writing up to 65534 bytes into a region of size 186 [-Wformat-overflow=]
69 | sprintf(buff, "sudo pkill -f %s", pyserverLoc);
| ^~ ~~~~~~~~~~~
MW_Pyserver_control.c:69:5: note: ‘sprintf’ output between 15 and 65549 bytes into a destination of size 200
69 | sprintf(buff, "sudo pkill -f %s", pyserverLoc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MW_Pyserver_control.c: In function ‘MW_launchPyserver’:
MW_Pyserver_control.c:95:24: warning: ‘%s’ directive writing up to 65534 bytes into a region of size 250 [-Wformat-overflow=]
95 | sprintf(cmd, "sudo %s %s >/tmp/mw_websoc_sl_io.log &", pyserverLoc, jsonFileLoc);
| ^~ ~~~~~~~~~~~
MW_Pyserver_control.c:95:5: note: ‘sprintf’ output between 35 and 66592 bytes into a destination of size 255
95 | sprintf(cmd, "sudo %s %s >/tmp/mw_websoc_sl_io.log &", pyserverLoc, jsonFileLoc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MW_JSONParser.c: In function ‘MW_getSignalStr’:
MW_JSONParser.c:22:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
22 | *SigStr = json_object_to_json_string(Signals);
| ^
MW_JSONParser.c: In function ‘MW_getDashboardSourceData’:
MW_JSONParser.c:40:20: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
40 | *BlockLabelStr = json_object_get_string(blocklabelWithID);
| ^
MW_JSONParser.c:44:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
44 | *BlockIDStr = json_object_get_string(blockID);
| ^
MW_JSONParser.c:35:9: warning: variable ‘keyExists’ set but not used [-Wunused-but-set-variable]
35 | int keyExists;
| ^~~~~~~~~
MW_JSONParser.c: In function ‘MW_getPortData’:
MW_JSONParser.c:62:13: warning: variable ‘dataOut’ set but not used [-Wunused-but-set-variable]
62 | double *dataOut;
| ^~~~~~~
MW_JSONParser.c:61:10: warning: unused variable ‘dataType’ [-Wunused-variable]
61 | char dataType[1024];
| ^~~~~~~~
/usr/bin/ld: cannot find -lmmal: No such file or directory
/usr/bin/ld: cannot find -lmmal_core: No such file or directory
/usr/bin/ld: cannot find -lmmal_util: No such file or directory
/usr/bin/ld: cannot find -lmmal_vc_client: No such file or directory
/usr/bin/ld: cannot find -lvcos: No such file or directory
/usr/bin/ld: cannot find -lbcm_host: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:93: build] Error 1
STDOUT: make: Entering directory ‘/opt/MATLAB/mw_server_v23.1.0’
[Compiling] IO_wrapperv4l2.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperv4l2.c -o obj/IO_wrapperv4l2.o
[Compiling] MW_PWM.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_PWM.c -o obj/MW_PWM.o
[Compiling] MW_pigs.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_pigs.c -o obj/MW_pigs.o
[Compiling] sharedServer.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE sharedServer.c -o obj/sharedServer.o
[Compiling] IO_wrapperCameraboard.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperCameraboard.c -o obj/IO_wrapperCameraboard.o
[Compiling] mw_wrapperCANChannel.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE mw_wrapperCANChannel.c -o obj/mw_wrapperCANChannel.o
[Compiling] LED.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE LED.c -o obj/LED.o
[Compiling] picam.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE picam.c -o obj/picam.o
[Compiling] system.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE system.c -o obj/system.o
[Compiling] IO_wrapperLED.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperLED.c -o obj/IO_wrapperLED.o
[Compiling] MW_digitalIO.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_digitalIO.c -o obj/MW_digitalIO.o
[Compiling] customFunction.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE customFunction.c -o obj/customFunction.o
[Compiling] servoRaspi.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE servoRaspi.c -o obj/servoRaspi.o
[Compiling] IO_checksum.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_checksum.c -o obj/IO_checksum.o
[Compiling] IO_packet.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_packet.c -o obj/IO_packet.o
[Compiling] IO_standardperipherals.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_standardperipherals.c -o obj/IO_standardperipherals.o
[Compiling] IO_wrapperI2C.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperI2C.c -o obj/IO_wrapperI2C.o
[Compiling] IO_wrapperPulseIn.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperPulseIn.c -o obj/IO_wrapperPulseIn.o
[Compiling] IO_wrapperSCI.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperSCI.c -o obj/IO_wrapperSCI.o
[Compiling] PeripheralToHandle.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE PeripheralToHandle.c -o obj/PeripheralToHandle.o
[Compiling] IO_debug.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_debug.c -o obj/IO_debug.o
[Compiling] IO_server.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_server.c -o obj/IO_server.o
[Compiling] IO_utilities.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_utilities.c -o obj/IO_utilities.o
[Compiling] IO_wrapperDigitalIO.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperDigitalIO.c -o obj/IO_wrapperDigitalIO.o
[Compiling] IO_wrapperPWM.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperPWM.c -o obj/IO_wrapperPWM.o
[Compiling] IO_wrapperSPI.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperSPI.c -o obj/IO_wrapperSPI.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiCamControl.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiCamControl.c
-o obj/RaspiCamControl.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiHelpers.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiHelpers.c -o
obj/RaspiHelpers.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiPreview.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiPreview.c -o
obj/RaspiPreview.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiCLI.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE /opt/userland/host_applications/linux/apps/raspicam/RaspiCLI.c -o
obj/RaspiCLI.o
[Compiling] /opt/userland/host_applications/linux/apps/raspicam/RaspiCommonSettings.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE
/opt/userland/host_applications/linux/apps/raspicam/RaspiCommonSettings.c -o obj/RaspiCommonSettings.o
[Compiling] frameBuffer.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE frameBuffer.c -o obj/frameBuffer.o
[Compiling] frameBufferRaspi.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE frameBufferRaspi.c -o obj/frameBufferRaspi.o
[Compiling] joystick.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE joystick.c -o obj/joystick.o
[Compiling] joystickRaspi.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE joystickRaspi.c -o obj/joystickRaspi.o
[Compiling] runCommand.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE runCommand.c -o obj/runCommand.o
[Compiling] IO_wrapperNanomsgPubSub.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperNanomsgPubSub.c -o obj/IO_wrapperNanomsgPubSub.o
[Compiling] MW_Pyserver_control.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_Pyserver_control.c -o obj/MW_Pyserver_control.o
[Compiling] MW_nanomsgClient.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_nanomsgClient.c -o obj/MW_nanomsgClient.o
[Compiling] MW_JSONParser.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_JSONParser.c -o obj/MW_JSONParser.o
[Compiling] IO_wrapperEncoder.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapperEncoder.c -o obj/IO_wrapperEncoder.o
[Compiling] MW_RaspiEncoder.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_RaspiEncoder.c -o obj/MW_RaspiEncoder.o
[Compiling] IO_wrapper_i2c_pwm_pca9685.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE IO_wrapper_i2c_pwm_pca9685.c -o obj/IO_wrapper_i2c_pwm_pca9685.o
[Compiling] MW_i2c_pwm_pca9685.c
gcc -c -g -O0 -D_DEBUG -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads -I/opt/userland/interface/vmcs_host/linux
-I/opt/userland/host_applications/linux/apps/raspicam -I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DMW_WEBSOC_INUSE -DMW_ENCODER_INUSE -DMW_PANTILT_INUSE MW_i2c_pwm_pca9685.c -o obj/MW_i2c_pwm_pca9685.o
echo [Linking]
[Linking]
make: Leaving directory ‘/opt/MATLAB/mw_server_v23.1.0’ rpi 4, raspberry pi MATLAB Answers — New Questions
I’m using ESP32 WROOM DevKitC and simply trying to ‘Monitor and tune’ a simple servo control simulink block but getting the error ‘Failed to run the model on hardware.’
The following error was encountered during evaluation of the external mode callback ‘getExtModeData’: codertarget.arduinobase.internal.getExternalModeMexArgs(‘Serial’) No ESP32-WROOM-DevKitV1(30 pin) board detected. Install or update the Arduino board driver and try again. If the problem persists, enter the host COM port number manually in the Host-board connection parameter and try again.The following error was encountered during evaluation of the external mode callback ‘getExtModeData’: codertarget.arduinobase.internal.getExternalModeMexArgs(‘Serial’) No ESP32-WROOM-DevKitV1(30 pin) board detected. Install or update the Arduino board driver and try again. If the problem persists, enter the host COM port number manually in the Host-board connection parameter and try again. The following error was encountered during evaluation of the external mode callback ‘getExtModeData’: codertarget.arduinobase.internal.getExternalModeMexArgs(‘Serial’) No ESP32-WROOM-DevKitV1(30 pin) board detected. Install or update the Arduino board driver and try again. If the problem persists, enter the host COM port number manually in the Host-board connection parameter and try again. simulink, esp32, servo MATLAB Answers — New Questions
Write Stream Binary Header with different precisions
I want to write a stream binary file that has different precisions for the header. Below is the header that I want to include with 256 Characters for the name of the file, double precision for the number of rows and columns, and then the data set is single precision.
256 Character -> "Unformatted file version=292498251"
Double -> "13"
Double -> "1000000"
Single -> "data" which is an array with 1000000 x 13 entries
Any help would be appreciated!I want to write a stream binary file that has different precisions for the header. Below is the header that I want to include with 256 Characters for the name of the file, double precision for the number of rows and columns, and then the data set is single precision.
256 Character -> "Unformatted file version=292498251"
Double -> "13"
Double -> "1000000"
Single -> "data" which is an array with 1000000 x 13 entries
Any help would be appreciated! I want to write a stream binary file that has different precisions for the header. Below is the header that I want to include with 256 Characters for the name of the file, double precision for the number of rows and columns, and then the data set is single precision.
256 Character -> "Unformatted file version=292498251"
Double -> "13"
Double -> "1000000"
Single -> "data" which is an array with 1000000 x 13 entries
Any help would be appreciated! stream binary, binary, fortran, fwrite MATLAB Answers — New Questions
Curve fitter limitation for equations in the form f(x,y)=a*x^n/(y+b)^m
Dear Community Members,
When I use curve fitter for equation in the form f(x,y)=a*x^n/(y+b)^m, the results are very bad (R-square is very, very low).
After removing "b" or changing it with a random number (for example 8, then f(x,y)=a*x^n/(y+8)^m), R-square is very good.
The question is: Is this a limitation of the software or there is a way to overcome this problem and to use "b", which value wiil be calculated by Curve fitter.Dear Community Members,
When I use curve fitter for equation in the form f(x,y)=a*x^n/(y+b)^m, the results are very bad (R-square is very, very low).
After removing "b" or changing it with a random number (for example 8, then f(x,y)=a*x^n/(y+8)^m), R-square is very good.
The question is: Is this a limitation of the software or there is a way to overcome this problem and to use "b", which value wiil be calculated by Curve fitter. Dear Community Members,
When I use curve fitter for equation in the form f(x,y)=a*x^n/(y+b)^m, the results are very bad (R-square is very, very low).
After removing "b" or changing it with a random number (for example 8, then f(x,y)=a*x^n/(y+8)^m), R-square is very good.
The question is: Is this a limitation of the software or there is a way to overcome this problem and to use "b", which value wiil be calculated by Curve fitter. curve fitter MATLAB Answers — New Questions
instantaneous power control of SCIM by FOC method
Hello. I am simulating the control of a squirrel-cage induction motor with FOC (Field-Oriented Control). When the speed range exceeds a certain threshold, the controller becomes unresponsive and diverges. Please advise🙏Hello. I am simulating the control of a squirrel-cage induction motor with FOC (Field-Oriented Control). When the speed range exceeds a certain threshold, the controller becomes unresponsive and diverges. Please advise🙏 Hello. I am simulating the control of a squirrel-cage induction motor with FOC (Field-Oriented Control). When the speed range exceeds a certain threshold, the controller becomes unresponsive and diverges. Please advise🙏 field oriented control, instantaneous torque control, asynchronous machine, power point tracking MATLAB Answers — New Questions
Invalid Mex File: Gateway Function is missing in compiled app
I’ve built an app in appdesigner that uses some C++ code and Mex. I then compiled this app and sent it to some users using Windows 10. It works fine on my computer and at least one of my users is able to get it to work, but another user is getting this error when she tries to run it:
Invalid Mex-file ‘C:UsersusernameappDataLocal…BackgroundSubtractorOCV.mexw64’ : Gateway function is missing.
I’m using a background subtractor script from openCV provided by Matlab.
None of the answers I’ve seen around this issue online have helped. Thanks for any help you can provide.I’ve built an app in appdesigner that uses some C++ code and Mex. I then compiled this app and sent it to some users using Windows 10. It works fine on my computer and at least one of my users is able to get it to work, but another user is getting this error when she tries to run it:
Invalid Mex-file ‘C:UsersusernameappDataLocal…BackgroundSubtractorOCV.mexw64’ : Gateway function is missing.
I’m using a background subtractor script from openCV provided by Matlab.
None of the answers I’ve seen around this issue online have helped. Thanks for any help you can provide. I’ve built an app in appdesigner that uses some C++ code and Mex. I then compiled this app and sent it to some users using Windows 10. It works fine on my computer and at least one of my users is able to get it to work, but another user is getting this error when she tries to run it:
Invalid Mex-file ‘C:UsersusernameappDataLocal…BackgroundSubtractorOCV.mexw64’ : Gateway function is missing.
I’m using a background subtractor script from openCV provided by Matlab.
None of the answers I’ve seen around this issue online have helped. Thanks for any help you can provide. mex, mex compiler, appdesigner MATLAB Answers — New Questions
Undefined function for input arguments of type ‘matlab.ui.Figure’.
Hi All,
Trying to run the following code by calling imspline (imspline is a defined class: classdef imspline < handle):
h = imspline(gca,’lineColor’,[1 0.5 0],’pointColor’,[0.2 0.8 0.4],’lineWidth’,5);
It gives this error: Undefined function ‘addImPoint’ for input arguments of type ‘matlab.ui.Figure’. Please give some suggestions. Would this error related to MATLAB versions? Thanks a lot in advance.
function obj = imspline(varargin)
% Set figure and axis
if nargin > 0 && isnumeric(varargin{1})%HD Original Code
obj.hAx = varargin{1};
obj.hFig = get(obj.hAx,’Parent’);
else
obj.hFig = figure;
obj.hAx = axes;
end
set(obj.hAx,’XlimMode’,’Manual’,’YlimMode’,’Manual’);
hold(obj.hAx);
% Crosshair over axis
hFig = obj.hFig;
idxCopy = find(strcmp(varargin,’copy’));
if ~isempty(idxCopy)
import_struct = varargin{idxCopy+1}.exportProperties;
obj.lineColor = import_struct.lineColor;
obj.pointColor = import_struct.pointColor;
obj.lineWidth = import_struct.lineWidth;
obj.saveState = import_struct.saveState;
obj.isOpen = 0;
obj.addGraphics;
return
end
iptPointerManager(hFig);
crosshair = @(hFig, currentPoint)…
set(hFig, ‘Pointer’, ‘crosshair’);
iptSetPointerBehavior(obj.hAx,crosshair);
% Add new point at buttonup
obj.id.addImPoint_id = iptaddcallback(obj.hFig,’WindowButtonUpFcn’,{@addImPoint,obj}); %HD Original Code (Error)
obj.id.animateSpline_id = [];
% Parse input arguments
for c = 1:length(varargin)
if ischar(varargin{c})
varargin{c} = lower(varargin{c});
end
end
idxLineColor = find(strcmp(varargin,’linecolor’));
idxPointColor = find(strcmp(varargin,’pointcolor’));
idxLineWidth = find(strcmp(varargin,’linewidth’));
if ~isempty(idxLineColor)
obj.lineColor = varargin{idxLineColor+1};
end
if ~isempty(idxPointColor)
obj.pointColor = varargin{idxPointColor+1};
end
if ~isempty(idxLineWidth)
obj.lineWidth = varargin{idxLineWidth+1};
end
end
function obj = addImPoint(src,event,obj)
pos = get(obj.hAx,’CurrentPoint’);
button = get(obj.hFig,’SelectionType’);
if strcmp(button,’normal’)
% add new impoint and set properties
x = pos(1,1);
y = pos(1,2);
if isempty(obj.hVert)
obj.hLine = line(x,y,’Parent’,obj.hAx);
set(obj.hLine,’Color’,obj.lineColor,’LineWidth’,obj.lineWidth);
end
hNewImpoint = impoint(obj.hAx,x,y);
hNewImpoint.setColor(obj.pointColor);
obj.hVert{end+1} = hNewImpoint;
if isempty(obj.id.animateSpline_id)
obj.id.animateSpline_id = iptaddcallback(obj.hFig,’WindowButtonMotionFcn’,{@animateSpline,obj});
end
elseif strcmp(button,’alt’)
% Remove old axis and figure properties
obj.isOpen = 0;
iptremovecallback(obj.hFig, ‘WindowButtonMotionFcn’,obj.id.animateSpline_id);
animateSpline_id = [];
iptremovecallback(obj.hFig, ‘WindowButtonUpFcn’,obj.id.addImPoint_id);
addImPoint_id = [];
iptSetPointerBehavior(obj.hAx,[]);
% Draw new spline and make it dragable
obj.drawSpline;
for cVert = 1:length(obj.hVert)
obj.hVert{cVert}.addNewPositionCallback(@refreshVertexPosition);
end
iptaddcallback(obj.hLine,’ButtonDownFcn’,{@lineButtonDown,obj});
% Set the arrow pointer for the line
hFig = obj.hFig;
iptPointerManager(hFig);
pointerBehavior.enterFcn = @(hFig,currentPoint) set(hFig,’Pointer’,’Crosshair’);
pointerBehavior.exitFcn = @(hFig,currentPoint) set(hFig,’Pointer’,’Arrow’);
pointerBehavior.traverseFcn = [];
iptSetPointerBehavior(obj.hLine,pointerBehavior);
obj.isOpen = 0;
notify(obj,’SplineClosing’);
notify(obj,’SplineUpdated’);
end
function animateSpline(varargin)
obj.drawSpline;
end
function refreshVertexPosition(varargin)
obj.drawSpline;
notify(obj,’SplineUpdated’);
end
endHi All,
Trying to run the following code by calling imspline (imspline is a defined class: classdef imspline < handle):
h = imspline(gca,’lineColor’,[1 0.5 0],’pointColor’,[0.2 0.8 0.4],’lineWidth’,5);
It gives this error: Undefined function ‘addImPoint’ for input arguments of type ‘matlab.ui.Figure’. Please give some suggestions. Would this error related to MATLAB versions? Thanks a lot in advance.
function obj = imspline(varargin)
% Set figure and axis
if nargin > 0 && isnumeric(varargin{1})%HD Original Code
obj.hAx = varargin{1};
obj.hFig = get(obj.hAx,’Parent’);
else
obj.hFig = figure;
obj.hAx = axes;
end
set(obj.hAx,’XlimMode’,’Manual’,’YlimMode’,’Manual’);
hold(obj.hAx);
% Crosshair over axis
hFig = obj.hFig;
idxCopy = find(strcmp(varargin,’copy’));
if ~isempty(idxCopy)
import_struct = varargin{idxCopy+1}.exportProperties;
obj.lineColor = import_struct.lineColor;
obj.pointColor = import_struct.pointColor;
obj.lineWidth = import_struct.lineWidth;
obj.saveState = import_struct.saveState;
obj.isOpen = 0;
obj.addGraphics;
return
end
iptPointerManager(hFig);
crosshair = @(hFig, currentPoint)…
set(hFig, ‘Pointer’, ‘crosshair’);
iptSetPointerBehavior(obj.hAx,crosshair);
% Add new point at buttonup
obj.id.addImPoint_id = iptaddcallback(obj.hFig,’WindowButtonUpFcn’,{@addImPoint,obj}); %HD Original Code (Error)
obj.id.animateSpline_id = [];
% Parse input arguments
for c = 1:length(varargin)
if ischar(varargin{c})
varargin{c} = lower(varargin{c});
end
end
idxLineColor = find(strcmp(varargin,’linecolor’));
idxPointColor = find(strcmp(varargin,’pointcolor’));
idxLineWidth = find(strcmp(varargin,’linewidth’));
if ~isempty(idxLineColor)
obj.lineColor = varargin{idxLineColor+1};
end
if ~isempty(idxPointColor)
obj.pointColor = varargin{idxPointColor+1};
end
if ~isempty(idxLineWidth)
obj.lineWidth = varargin{idxLineWidth+1};
end
end
function obj = addImPoint(src,event,obj)
pos = get(obj.hAx,’CurrentPoint’);
button = get(obj.hFig,’SelectionType’);
if strcmp(button,’normal’)
% add new impoint and set properties
x = pos(1,1);
y = pos(1,2);
if isempty(obj.hVert)
obj.hLine = line(x,y,’Parent’,obj.hAx);
set(obj.hLine,’Color’,obj.lineColor,’LineWidth’,obj.lineWidth);
end
hNewImpoint = impoint(obj.hAx,x,y);
hNewImpoint.setColor(obj.pointColor);
obj.hVert{end+1} = hNewImpoint;
if isempty(obj.id.animateSpline_id)
obj.id.animateSpline_id = iptaddcallback(obj.hFig,’WindowButtonMotionFcn’,{@animateSpline,obj});
end
elseif strcmp(button,’alt’)
% Remove old axis and figure properties
obj.isOpen = 0;
iptremovecallback(obj.hFig, ‘WindowButtonMotionFcn’,obj.id.animateSpline_id);
animateSpline_id = [];
iptremovecallback(obj.hFig, ‘WindowButtonUpFcn’,obj.id.addImPoint_id);
addImPoint_id = [];
iptSetPointerBehavior(obj.hAx,[]);
% Draw new spline and make it dragable
obj.drawSpline;
for cVert = 1:length(obj.hVert)
obj.hVert{cVert}.addNewPositionCallback(@refreshVertexPosition);
end
iptaddcallback(obj.hLine,’ButtonDownFcn’,{@lineButtonDown,obj});
% Set the arrow pointer for the line
hFig = obj.hFig;
iptPointerManager(hFig);
pointerBehavior.enterFcn = @(hFig,currentPoint) set(hFig,’Pointer’,’Crosshair’);
pointerBehavior.exitFcn = @(hFig,currentPoint) set(hFig,’Pointer’,’Arrow’);
pointerBehavior.traverseFcn = [];
iptSetPointerBehavior(obj.hLine,pointerBehavior);
obj.isOpen = 0;
notify(obj,’SplineClosing’);
notify(obj,’SplineUpdated’);
end
function animateSpline(varargin)
obj.drawSpline;
end
function refreshVertexPosition(varargin)
obj.drawSpline;
notify(obj,’SplineUpdated’);
end
end Hi All,
Trying to run the following code by calling imspline (imspline is a defined class: classdef imspline < handle):
h = imspline(gca,’lineColor’,[1 0.5 0],’pointColor’,[0.2 0.8 0.4],’lineWidth’,5);
It gives this error: Undefined function ‘addImPoint’ for input arguments of type ‘matlab.ui.Figure’. Please give some suggestions. Would this error related to MATLAB versions? Thanks a lot in advance.
function obj = imspline(varargin)
% Set figure and axis
if nargin > 0 && isnumeric(varargin{1})%HD Original Code
obj.hAx = varargin{1};
obj.hFig = get(obj.hAx,’Parent’);
else
obj.hFig = figure;
obj.hAx = axes;
end
set(obj.hAx,’XlimMode’,’Manual’,’YlimMode’,’Manual’);
hold(obj.hAx);
% Crosshair over axis
hFig = obj.hFig;
idxCopy = find(strcmp(varargin,’copy’));
if ~isempty(idxCopy)
import_struct = varargin{idxCopy+1}.exportProperties;
obj.lineColor = import_struct.lineColor;
obj.pointColor = import_struct.pointColor;
obj.lineWidth = import_struct.lineWidth;
obj.saveState = import_struct.saveState;
obj.isOpen = 0;
obj.addGraphics;
return
end
iptPointerManager(hFig);
crosshair = @(hFig, currentPoint)…
set(hFig, ‘Pointer’, ‘crosshair’);
iptSetPointerBehavior(obj.hAx,crosshair);
% Add new point at buttonup
obj.id.addImPoint_id = iptaddcallback(obj.hFig,’WindowButtonUpFcn’,{@addImPoint,obj}); %HD Original Code (Error)
obj.id.animateSpline_id = [];
% Parse input arguments
for c = 1:length(varargin)
if ischar(varargin{c})
varargin{c} = lower(varargin{c});
end
end
idxLineColor = find(strcmp(varargin,’linecolor’));
idxPointColor = find(strcmp(varargin,’pointcolor’));
idxLineWidth = find(strcmp(varargin,’linewidth’));
if ~isempty(idxLineColor)
obj.lineColor = varargin{idxLineColor+1};
end
if ~isempty(idxPointColor)
obj.pointColor = varargin{idxPointColor+1};
end
if ~isempty(idxLineWidth)
obj.lineWidth = varargin{idxLineWidth+1};
end
end
function obj = addImPoint(src,event,obj)
pos = get(obj.hAx,’CurrentPoint’);
button = get(obj.hFig,’SelectionType’);
if strcmp(button,’normal’)
% add new impoint and set properties
x = pos(1,1);
y = pos(1,2);
if isempty(obj.hVert)
obj.hLine = line(x,y,’Parent’,obj.hAx);
set(obj.hLine,’Color’,obj.lineColor,’LineWidth’,obj.lineWidth);
end
hNewImpoint = impoint(obj.hAx,x,y);
hNewImpoint.setColor(obj.pointColor);
obj.hVert{end+1} = hNewImpoint;
if isempty(obj.id.animateSpline_id)
obj.id.animateSpline_id = iptaddcallback(obj.hFig,’WindowButtonMotionFcn’,{@animateSpline,obj});
end
elseif strcmp(button,’alt’)
% Remove old axis and figure properties
obj.isOpen = 0;
iptremovecallback(obj.hFig, ‘WindowButtonMotionFcn’,obj.id.animateSpline_id);
animateSpline_id = [];
iptremovecallback(obj.hFig, ‘WindowButtonUpFcn’,obj.id.addImPoint_id);
addImPoint_id = [];
iptSetPointerBehavior(obj.hAx,[]);
% Draw new spline and make it dragable
obj.drawSpline;
for cVert = 1:length(obj.hVert)
obj.hVert{cVert}.addNewPositionCallback(@refreshVertexPosition);
end
iptaddcallback(obj.hLine,’ButtonDownFcn’,{@lineButtonDown,obj});
% Set the arrow pointer for the line
hFig = obj.hFig;
iptPointerManager(hFig);
pointerBehavior.enterFcn = @(hFig,currentPoint) set(hFig,’Pointer’,’Crosshair’);
pointerBehavior.exitFcn = @(hFig,currentPoint) set(hFig,’Pointer’,’Arrow’);
pointerBehavior.traverseFcn = [];
iptSetPointerBehavior(obj.hLine,pointerBehavior);
obj.isOpen = 0;
notify(obj,’SplineClosing’);
notify(obj,’SplineUpdated’);
end
function animateSpline(varargin)
obj.drawSpline;
end
function refreshVertexPosition(varargin)
obj.drawSpline;
notify(obj,’SplineUpdated’);
end
end gui callback MATLAB Answers — New Questions
Need Code for Kinematics
I need the code for the following Kinematics equation
" Velocity
VB= AA + ( AB x r AB )
VC = VB + ( ω BC x r BC )
Accelaration
AB = AA +( ( AB X (ω AB x r AB )) + ( α AB x rAB)
AC = AB + ( ( BC X ( BC x r BC )) + ( α BC x r BC )
r AB = AB( sin θ i + cos θ j )
r BC = BC( sin α i + cos α j )
User need to input:
Distance: AB and BC
Angle: α and θ
k value = AB and α AB"
Need user ask to inputI need the code for the following Kinematics equation
" Velocity
VB= AA + ( AB x r AB )
VC = VB + ( ω BC x r BC )
Accelaration
AB = AA +( ( AB X (ω AB x r AB )) + ( α AB x rAB)
AC = AB + ( ( BC X ( BC x r BC )) + ( α BC x r BC )
r AB = AB( sin θ i + cos θ j )
r BC = BC( sin α i + cos α j )
User need to input:
Distance: AB and BC
Angle: α and θ
k value = AB and α AB"
Need user ask to input I need the code for the following Kinematics equation
" Velocity
VB= AA + ( AB x r AB )
VC = VB + ( ω BC x r BC )
Accelaration
AB = AA +( ( AB X (ω AB x r AB )) + ( α AB x rAB)
AC = AB + ( ( BC X ( BC x r BC )) + ( α BC x r BC )
r AB = AB( sin θ i + cos θ j )
r BC = BC( sin α i + cos α j )
User need to input:
Distance: AB and BC
Angle: α and θ
k value = AB and α AB"
Need user ask to input cross product MATLAB Answers — New Questions
Trying to use for loop to create an array of bandpass filters, but gets error “conversion to double from dfilt.df2sos is not possible”
I have been trying to use a for loop to generate an array of bandpass filters using the dfilt.df2sos command in order to minimise numerical errors, and then using fvtool to analyze the filters. However, when running the command I keep running into the error "Unable to perform assignment because value of type ‘dfilt.df2sos’ is not convertible to ‘double’." on line bppf(i) = dfilt.df2sos(s,g);. I suspect this is probably due to how I initialised the array bppf, but I can’t seem to find a workaround for this. I am also trying to use the web browser to run this code, but I’m not sure if that’s really the cause of the problem. Any help would be much appreciated thank you.
Edit: I realised I accidentally missed out on variables ap and as when copying and pasting my code
fs = 48000; % sample frequency
wss1 = [5680 2840 1420 710 355 177 88 44]*2*pi/fs;
wss2 = [11360 5680 2840 1420 710 355 177 88 44]*2*pi/fs;
wpp1 = 0.9*[8000 4000 2000 1000 500 250 125 63]*2*pi/fs;
wpp2 = zeros(8);
dp = 0.05;
ds = 0.05;
% peak passband ripple and minimum stopband attenuation in dB
ap = -20*log10(1-dp); as = -20*log10(ds);
% append wpp2
for i = 1:length(wpp2)
wpp2(i) = wss1(i)*wss2(i)/wpp1(i);
end
% design of prototype butteworth bandpass filter
bppf = zeros(8);
for i = 1:8
% bandedge frequencies for analog filter (T=1)
omp1 = 2*tan(wpp1(i)/2);
omp2 = 2*tan(wpp2(i)/2);
oms1 = 2*tan(wss1(i)/2);
oms2 = 2*tan(wss2(i)/2);
% filter design
[N Wn] = buttord([omp1/pi omp2/pi],[oms1/pi oms2/pi],ap,as);
[z,p,k] = butter(N,Wn,’bandpass’);
[s,g] = zp2sos(z,p,k);
bppf(i) = dfilt.df2sos(s,g);
end
fvtool(bppf(1),bppf(2),bppf(3),bppf(4),bppf(5),bppf(6),bppf(7),bppf(8))I have been trying to use a for loop to generate an array of bandpass filters using the dfilt.df2sos command in order to minimise numerical errors, and then using fvtool to analyze the filters. However, when running the command I keep running into the error "Unable to perform assignment because value of type ‘dfilt.df2sos’ is not convertible to ‘double’." on line bppf(i) = dfilt.df2sos(s,g);. I suspect this is probably due to how I initialised the array bppf, but I can’t seem to find a workaround for this. I am also trying to use the web browser to run this code, but I’m not sure if that’s really the cause of the problem. Any help would be much appreciated thank you.
Edit: I realised I accidentally missed out on variables ap and as when copying and pasting my code
fs = 48000; % sample frequency
wss1 = [5680 2840 1420 710 355 177 88 44]*2*pi/fs;
wss2 = [11360 5680 2840 1420 710 355 177 88 44]*2*pi/fs;
wpp1 = 0.9*[8000 4000 2000 1000 500 250 125 63]*2*pi/fs;
wpp2 = zeros(8);
dp = 0.05;
ds = 0.05;
% peak passband ripple and minimum stopband attenuation in dB
ap = -20*log10(1-dp); as = -20*log10(ds);
% append wpp2
for i = 1:length(wpp2)
wpp2(i) = wss1(i)*wss2(i)/wpp1(i);
end
% design of prototype butteworth bandpass filter
bppf = zeros(8);
for i = 1:8
% bandedge frequencies for analog filter (T=1)
omp1 = 2*tan(wpp1(i)/2);
omp2 = 2*tan(wpp2(i)/2);
oms1 = 2*tan(wss1(i)/2);
oms2 = 2*tan(wss2(i)/2);
% filter design
[N Wn] = buttord([omp1/pi omp2/pi],[oms1/pi oms2/pi],ap,as);
[z,p,k] = butter(N,Wn,’bandpass’);
[s,g] = zp2sos(z,p,k);
bppf(i) = dfilt.df2sos(s,g);
end
fvtool(bppf(1),bppf(2),bppf(3),bppf(4),bppf(5),bppf(6),bppf(7),bppf(8)) I have been trying to use a for loop to generate an array of bandpass filters using the dfilt.df2sos command in order to minimise numerical errors, and then using fvtool to analyze the filters. However, when running the command I keep running into the error "Unable to perform assignment because value of type ‘dfilt.df2sos’ is not convertible to ‘double’." on line bppf(i) = dfilt.df2sos(s,g);. I suspect this is probably due to how I initialised the array bppf, but I can’t seem to find a workaround for this. I am also trying to use the web browser to run this code, but I’m not sure if that’s really the cause of the problem. Any help would be much appreciated thank you.
Edit: I realised I accidentally missed out on variables ap and as when copying and pasting my code
fs = 48000; % sample frequency
wss1 = [5680 2840 1420 710 355 177 88 44]*2*pi/fs;
wss2 = [11360 5680 2840 1420 710 355 177 88 44]*2*pi/fs;
wpp1 = 0.9*[8000 4000 2000 1000 500 250 125 63]*2*pi/fs;
wpp2 = zeros(8);
dp = 0.05;
ds = 0.05;
% peak passband ripple and minimum stopband attenuation in dB
ap = -20*log10(1-dp); as = -20*log10(ds);
% append wpp2
for i = 1:length(wpp2)
wpp2(i) = wss1(i)*wss2(i)/wpp1(i);
end
% design of prototype butteworth bandpass filter
bppf = zeros(8);
for i = 1:8
% bandedge frequencies for analog filter (T=1)
omp1 = 2*tan(wpp1(i)/2);
omp2 = 2*tan(wpp2(i)/2);
oms1 = 2*tan(wss1(i)/2);
oms2 = 2*tan(wss2(i)/2);
% filter design
[N Wn] = buttord([omp1/pi omp2/pi],[oms1/pi oms2/pi],ap,as);
[z,p,k] = butter(N,Wn,’bandpass’);
[s,g] = zp2sos(z,p,k);
bppf(i) = dfilt.df2sos(s,g);
end
fvtool(bppf(1),bppf(2),bppf(3),bppf(4),bppf(5),bppf(6),bppf(7),bppf(8)) filter, transfer function MATLAB Answers — New Questions
Unable to evaluate function model.
There was an error executing the ProcessExperienceFcn. Caused by: 错误使用 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.function.IFunction/evaluate’, ‘F:Matlab2024btoolboxrlrl+rl+internal+function@IFunctionIFunction.m’, 84)" style="font-weight:bold">rl.internal.function.IFunction/evaluate</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+function@IFunctionIFunction.m’,84,0)">第 84 行</a>) Unable to evaluate function model. 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.function.rlContinuousDeterministicActor/getAction_’, ‘F:Matlab2024btoolboxrlrl+rl+functionrlContinuousDeterministicActor.m’, 131)" style="font-weight:bold">rl.function.rlContinuousDeterministicActor/getAction_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+functionrlContinuousDeterministicActor.m’,131,0)">第 131 行</a>) [action,state] = evaluate(this,observation,varargin{:}); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.function.IGetAction/getAction’, ‘F:Matlab2024btoolboxrlrl+rl+internal+functionIGetAction.m’, 43)" style="font-weight:bold">rl.internal.function.IGetAction/getAction</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+functionIGetAction.m’,43,0)">第 43 行</a>) [action,state] = getAction_(this,observation,cargs{:}); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘deep.AcceleratedFunction/parenReferencePacked’, ‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’, 326)" style="font-weight:bold">deep.AcceleratedFunction/parenReferencePacked</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’,326,0)">第 326 行</a>) [varargout{1:nargout}] = obj.Function(struct(‘v’,matlab.lang.internal.move(inputs)).v); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘deep.AcceleratedFunction/feval’, ‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’, 388)" style="font-weight:bold">deep.AcceleratedFunction/feval</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’,388,0)">第 388 行</a>) [varargout{1:nargout}] = parenReferencePacked(obj, matlab.lang.internal.move(varargin)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.function.numericEval’, ‘F:Matlab2024btoolboxrlrl+rl+internal+functionnumericEval.m’, 24)" style="font-weight:bold">rl.internal.function.numericEval</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+functionnumericEval.m’,24,0)">第 24 行</a>) [varargout{1:nargout}] = feval(accelfcn,fcnobjs{:},varargin{:}); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.policy.rlAdditiveNoisePolicy/getAction_’, ‘F:Matlab2024btoolboxrlrl+rl+policyrlAdditiveNoisePolicy.m’, 162)" style="font-weight:bold">rl.policy.rlAdditiveNoisePolicy/getAction_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+policyrlAdditiveNoisePolicy.m’,162,0)">第 162 行</a>) [action,state] = rl.internal.function.numericEval(f,… ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.policy.PolicyInterface/getAction’, ‘F:Matlab2024btoolboxrlrl+rl+policyPolicyInterface.m’, 38)" style="font-weight:bold">rl.policy.PolicyInterface/getAction</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+policyPolicyInterface.m’,38,0)">第 38 行</a>) [action,this] = getAction_(this,observation); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.PolicyExperienceProcessorInterface/evaluateAction_’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalPolicyExperienceProcessorInterface.m’, 32)" style="font-weight:bold">rl.env.internal.PolicyExperienceProcessorInterface/evaluateAction_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalPolicyExperienceProcessorInterface.m’,32,0)">第 32 行</a>) [action,this.Policy_] = getAction(this.Policy_,observation); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.ExperienceProcessorInterface/evaluateAction’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalExperienceProcessorInterface.m’, 70)" style="font-weight:bold">rl.env.internal.ExperienceProcessorInterface/evaluateAction</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalExperienceProcessorInterface.m’,70,0)">第 70 行</a>) action = evaluateAction_(this,observation); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.MATLABSimulator/simInternal_’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’, 109)" style="font-weight:bold">rl.env.internal.MATLABSimulator/simInternal_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’,109,0)">第 109 行</a>) act = evaluateAction(expProcessor,obs); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.MATLABSimulator/sim_’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’, 67)" style="font-weight:bold">rl.env.internal.MATLABSimulator/sim_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’,67,0)">第 67 行</a>) out = simInternal_(this,simPkg); ^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.AbstractSimulator/sim’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalAbstractSimulator.m’, 30)" style="font-weight:bold">rl.env.internal.AbstractSimulator/sim</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalAbstractSimulator.m’,30,0)">第 30 行</a>) out = sim_(this,simData,policy,processExpFcn,processExpData); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.AbstractEnv/runEpisode’, ‘F:Matlab2024btoolboxrlrl+rl+env@AbstractEnvrunEpisode.m’, 144)" style="font-weight:bold">rl.env.AbstractEnv/runEpisode</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env@AbstractEnvrunEpisode.m’,144,0)">第 144 行</a>) out = sim(simulator,simData,policy,processExpFcn,processExpData); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.OffPolicyTrainer/run_internal_/nestedRunEpisode’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’, 284)" style="font-weight:bold">rl.internal.train.OffPolicyTrainer/run_internal_/nestedRunEpisode</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’,284,0)">第 284 行</a>) out_or_F = runEpisode(env,p,… ^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.OffPolicyTrainer/run_internal_’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’, 351)" style="font-weight:bold">rl.internal.train.OffPolicyTrainer/run_internal_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’,351,0)">第 351 行</a>) out = nestedRunEpisode(policy); ^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.OffPolicyTrainer/run_’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’, 39)" style="font-weight:bold">rl.internal.train.OffPolicyTrainer/run_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’,39,0)">第 39 行</a>) result = run_internal_(this); ^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.Trainer/run’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainTrainer.m’, 8)" style="font-weight:bold">rl.internal.train.Trainer/run</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainTrainer.m’,8,0)">第 8 行</a>) result = run_(this); ^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.trainmgr.OnlineTrainingManager/run_’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrOnlineTrainingManager.m’, 123)" style="font-weight:bold">rl.internal.trainmgr.OnlineTrainingManager/run_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrOnlineTrainingManager.m’,123,0)">第 123 行</a>) trainResult = run(trainer); ^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.trainmgr.TrainingManager/run’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrTrainingManager.m’, 4)" style="font-weight:bold">rl.internal.trainmgr.TrainingManager/run</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrTrainingManager.m’,4,0)">第 4 行</a>) result = run_(this); ^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.agent.AbstractAgent/train’, ‘F:Matlab2024btoolboxrlrl+rl+agent@AbstractAgenttrain.m’, 86)" style="font-weight:bold">rl.agent.AbstractAgent/train</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+agent@AbstractAgenttrain.m’,86,0)">第 86 行</a>) trainingResult = run(tm); ^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tool.TrainingSession/runTraining’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’, 169)" style="font-weight:bold">rl.internal.app.tool.TrainingSession/runTraining</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’,169,0)">第 169 行</a>) obj.TrainingResult = train(obj.TrainedAgent,obj.Environment,obj.Options,Evaluator=obj.Evaluator); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tool.TrainingSession/startTraining’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’, 106)" style="font-weight:bold">rl.internal.app.tool.TrainingSession/startTraining</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’,106,0)">第 106 行</a>) runTraining(obj); ^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.ReinforcementLearningApp/openTrainingSession’, ‘F:Matlab2024btoolboxrlrl+rl+internal+appReinforcementLearningApp.m’, 369)" style="font-weight:bold">rl.internal.app.ReinforcementLearningApp/openTrainingSession</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+appReinforcementLearningApp.m’,369,0)">第 369 行</a>) startTraining(obj.TrainingSession,Data,IsResume) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tab.TrainTab/trainCB’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’, 315)" style="font-weight:bold">rl.internal.app.tab.TrainTab/trainCB</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’,315,0)">第 315 行</a>) openTrainingSession(obj.App,obj.Data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tab.TrainTab>@(~,~)trainCB(obj)’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’, 210)" style="font-weight:bold">rl.internal.app.tab.TrainTab>@(~,~)trainCB(obj)</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’,210,0)">第 210 行</a>) obj.Widgets.TrainButton.ButtonPushedFcn = @(~, ~) trainCB(obj); ^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘internal.Callback.execute’, ‘F:Matlab2024btoolboxsharedtestmeaslibgeneral+internalCallback.m’, 128)" style="font-weight:bold">internal.Callback.execute</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxsharedtestmeaslibgeneral+internalCallback.m’,128,0)">第 128 行</a>) feval(callback, src, event); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘matlab.ui.internal.toolstrip.base.Action/PeerEventCallback’, ‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseAction.m’, 852)" style="font-weight:bold">matlab.ui.internal.toolstrip.base.Action/PeerEventCallback</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseAction.m’,852,0)">第 852 行</a>) internal.Callback.execute(this.PushPerformedFcn, this, eventdata); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘matlab.ui.internal.toolstrip.base.ActionInterface>@(event,data)PeerEventCallback(this,event,data)’, ‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseActionInterface.m’, 41)" style="font-weight:bold">matlab.ui.internal.toolstrip.base.ActionInterface>@(event,data)PeerEventCallback(this,event,data)</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseActionInterface.m’,41,0)">第 41 行</a>) this.PeerEventListener = addlistener(this.Peer, ‘peerEvent’, @(event, data) PeerEventCallback(this, event, data)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘viewmodel.internal.factory.ManagerFactoryProducer>@(src,event)callback(src,viewmodel.internal.factory.ManagerFactoryProducer.convertStructToEventData(event))’, ‘F:Matlab2024btoolboxsharedviewmodelviewmodel+viewmodel+internal+factoryManagerFactoryProducer.m’, 76)" style="font-weight:bold">viewmodel.internal.factory.ManagerFactoryProducer>@(src,event)callback(src,viewmodel.internal.factory.ManagerFactoryProducer.convertStructToEventData(event))</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxsharedviewmodelviewmodel+viewmodel+internal+factoryManagerFactoryProducer.m’,76,0)">第 76 行</a>) proxyCallback = @(src, event)callback(src, … ^^^^^^^^^^^^^^^^^ 原因: 错误使用 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘dlnetwork/predict’, ‘F:Matlab2024btoolboxnnetcnndlnetwork.m’, 700)" style="font-weight:bold">dlnetwork/predict</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetcnndlnetwork.m’,700,0)">第 700 行</a>) 在层 "fc_1" 期间执行失败。 错误使用 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘dlarray/fullyconnect>iReshapeMtimesAdd’, ‘F:Matlab2024btoolboxnnetdeepdeep@dlarrayfullyconnect.m’, 272)" style="font-weight:bold">dlarray/fullyconnect>iReshapeMtimesAdd</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetdeepdeep@dlarrayfullyconnect.m’,272,0)">第 272 行</a>) 不支持复数。There was an error executing the ProcessExperienceFcn. Caused by: 错误使用 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.function.IFunction/evaluate’, ‘F:Matlab2024btoolboxrlrl+rl+internal+function@IFunctionIFunction.m’, 84)" style="font-weight:bold">rl.internal.function.IFunction/evaluate</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+function@IFunctionIFunction.m’,84,0)">第 84 行</a>) Unable to evaluate function model. 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.function.rlContinuousDeterministicActor/getAction_’, ‘F:Matlab2024btoolboxrlrl+rl+functionrlContinuousDeterministicActor.m’, 131)" style="font-weight:bold">rl.function.rlContinuousDeterministicActor/getAction_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+functionrlContinuousDeterministicActor.m’,131,0)">第 131 行</a>) [action,state] = evaluate(this,observation,varargin{:}); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.function.IGetAction/getAction’, ‘F:Matlab2024btoolboxrlrl+rl+internal+functionIGetAction.m’, 43)" style="font-weight:bold">rl.internal.function.IGetAction/getAction</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+functionIGetAction.m’,43,0)">第 43 行</a>) [action,state] = getAction_(this,observation,cargs{:}); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘deep.AcceleratedFunction/parenReferencePacked’, ‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’, 326)" style="font-weight:bold">deep.AcceleratedFunction/parenReferencePacked</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’,326,0)">第 326 行</a>) [varargout{1:nargout}] = obj.Function(struct(‘v’,matlab.lang.internal.move(inputs)).v); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘deep.AcceleratedFunction/feval’, ‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’, 388)" style="font-weight:bold">deep.AcceleratedFunction/feval</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’,388,0)">第 388 行</a>) [varargout{1:nargout}] = parenReferencePacked(obj, matlab.lang.internal.move(varargin)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.function.numericEval’, ‘F:Matlab2024btoolboxrlrl+rl+internal+functionnumericEval.m’, 24)" style="font-weight:bold">rl.internal.function.numericEval</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+functionnumericEval.m’,24,0)">第 24 行</a>) [varargout{1:nargout}] = feval(accelfcn,fcnobjs{:},varargin{:}); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.policy.rlAdditiveNoisePolicy/getAction_’, ‘F:Matlab2024btoolboxrlrl+rl+policyrlAdditiveNoisePolicy.m’, 162)" style="font-weight:bold">rl.policy.rlAdditiveNoisePolicy/getAction_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+policyrlAdditiveNoisePolicy.m’,162,0)">第 162 行</a>) [action,state] = rl.internal.function.numericEval(f,… ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.policy.PolicyInterface/getAction’, ‘F:Matlab2024btoolboxrlrl+rl+policyPolicyInterface.m’, 38)" style="font-weight:bold">rl.policy.PolicyInterface/getAction</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+policyPolicyInterface.m’,38,0)">第 38 行</a>) [action,this] = getAction_(this,observation); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.PolicyExperienceProcessorInterface/evaluateAction_’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalPolicyExperienceProcessorInterface.m’, 32)" style="font-weight:bold">rl.env.internal.PolicyExperienceProcessorInterface/evaluateAction_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalPolicyExperienceProcessorInterface.m’,32,0)">第 32 行</a>) [action,this.Policy_] = getAction(this.Policy_,observation); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.ExperienceProcessorInterface/evaluateAction’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalExperienceProcessorInterface.m’, 70)" style="font-weight:bold">rl.env.internal.ExperienceProcessorInterface/evaluateAction</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalExperienceProcessorInterface.m’,70,0)">第 70 行</a>) action = evaluateAction_(this,observation); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.MATLABSimulator/simInternal_’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’, 109)" style="font-weight:bold">rl.env.internal.MATLABSimulator/simInternal_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’,109,0)">第 109 行</a>) act = evaluateAction(expProcessor,obs); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.MATLABSimulator/sim_’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’, 67)" style="font-weight:bold">rl.env.internal.MATLABSimulator/sim_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’,67,0)">第 67 行</a>) out = simInternal_(this,simPkg); ^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.AbstractSimulator/sim’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalAbstractSimulator.m’, 30)" style="font-weight:bold">rl.env.internal.AbstractSimulator/sim</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalAbstractSimulator.m’,30,0)">第 30 行</a>) out = sim_(this,simData,policy,processExpFcn,processExpData); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.AbstractEnv/runEpisode’, ‘F:Matlab2024btoolboxrlrl+rl+env@AbstractEnvrunEpisode.m’, 144)" style="font-weight:bold">rl.env.AbstractEnv/runEpisode</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env@AbstractEnvrunEpisode.m’,144,0)">第 144 行</a>) out = sim(simulator,simData,policy,processExpFcn,processExpData); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.OffPolicyTrainer/run_internal_/nestedRunEpisode’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’, 284)" style="font-weight:bold">rl.internal.train.OffPolicyTrainer/run_internal_/nestedRunEpisode</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’,284,0)">第 284 行</a>) out_or_F = runEpisode(env,p,… ^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.OffPolicyTrainer/run_internal_’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’, 351)" style="font-weight:bold">rl.internal.train.OffPolicyTrainer/run_internal_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’,351,0)">第 351 行</a>) out = nestedRunEpisode(policy); ^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.OffPolicyTrainer/run_’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’, 39)" style="font-weight:bold">rl.internal.train.OffPolicyTrainer/run_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’,39,0)">第 39 行</a>) result = run_internal_(this); ^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.Trainer/run’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainTrainer.m’, 8)" style="font-weight:bold">rl.internal.train.Trainer/run</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainTrainer.m’,8,0)">第 8 行</a>) result = run_(this); ^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.trainmgr.OnlineTrainingManager/run_’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrOnlineTrainingManager.m’, 123)" style="font-weight:bold">rl.internal.trainmgr.OnlineTrainingManager/run_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrOnlineTrainingManager.m’,123,0)">第 123 行</a>) trainResult = run(trainer); ^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.trainmgr.TrainingManager/run’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrTrainingManager.m’, 4)" style="font-weight:bold">rl.internal.trainmgr.TrainingManager/run</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrTrainingManager.m’,4,0)">第 4 行</a>) result = run_(this); ^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.agent.AbstractAgent/train’, ‘F:Matlab2024btoolboxrlrl+rl+agent@AbstractAgenttrain.m’, 86)" style="font-weight:bold">rl.agent.AbstractAgent/train</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+agent@AbstractAgenttrain.m’,86,0)">第 86 行</a>) trainingResult = run(tm); ^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tool.TrainingSession/runTraining’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’, 169)" style="font-weight:bold">rl.internal.app.tool.TrainingSession/runTraining</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’,169,0)">第 169 行</a>) obj.TrainingResult = train(obj.TrainedAgent,obj.Environment,obj.Options,Evaluator=obj.Evaluator); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tool.TrainingSession/startTraining’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’, 106)" style="font-weight:bold">rl.internal.app.tool.TrainingSession/startTraining</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’,106,0)">第 106 行</a>) runTraining(obj); ^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.ReinforcementLearningApp/openTrainingSession’, ‘F:Matlab2024btoolboxrlrl+rl+internal+appReinforcementLearningApp.m’, 369)" style="font-weight:bold">rl.internal.app.ReinforcementLearningApp/openTrainingSession</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+appReinforcementLearningApp.m’,369,0)">第 369 行</a>) startTraining(obj.TrainingSession,Data,IsResume) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tab.TrainTab/trainCB’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’, 315)" style="font-weight:bold">rl.internal.app.tab.TrainTab/trainCB</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’,315,0)">第 315 行</a>) openTrainingSession(obj.App,obj.Data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tab.TrainTab>@(~,~)trainCB(obj)’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’, 210)" style="font-weight:bold">rl.internal.app.tab.TrainTab>@(~,~)trainCB(obj)</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’,210,0)">第 210 行</a>) obj.Widgets.TrainButton.ButtonPushedFcn = @(~, ~) trainCB(obj); ^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘internal.Callback.execute’, ‘F:Matlab2024btoolboxsharedtestmeaslibgeneral+internalCallback.m’, 128)" style="font-weight:bold">internal.Callback.execute</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxsharedtestmeaslibgeneral+internalCallback.m’,128,0)">第 128 行</a>) feval(callback, src, event); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘matlab.ui.internal.toolstrip.base.Action/PeerEventCallback’, ‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseAction.m’, 852)" style="font-weight:bold">matlab.ui.internal.toolstrip.base.Action/PeerEventCallback</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseAction.m’,852,0)">第 852 行</a>) internal.Callback.execute(this.PushPerformedFcn, this, eventdata); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘matlab.ui.internal.toolstrip.base.ActionInterface>@(event,data)PeerEventCallback(this,event,data)’, ‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseActionInterface.m’, 41)" style="font-weight:bold">matlab.ui.internal.toolstrip.base.ActionInterface>@(event,data)PeerEventCallback(this,event,data)</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseActionInterface.m’,41,0)">第 41 行</a>) this.PeerEventListener = addlistener(this.Peer, ‘peerEvent’, @(event, data) PeerEventCallback(this, event, data)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘viewmodel.internal.factory.ManagerFactoryProducer>@(src,event)callback(src,viewmodel.internal.factory.ManagerFactoryProducer.convertStructToEventData(event))’, ‘F:Matlab2024btoolboxsharedviewmodelviewmodel+viewmodel+internal+factoryManagerFactoryProducer.m’, 76)" style="font-weight:bold">viewmodel.internal.factory.ManagerFactoryProducer>@(src,event)callback(src,viewmodel.internal.factory.ManagerFactoryProducer.convertStructToEventData(event))</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxsharedviewmodelviewmodel+viewmodel+internal+factoryManagerFactoryProducer.m’,76,0)">第 76 行</a>) proxyCallback = @(src, event)callback(src, … ^^^^^^^^^^^^^^^^^ 原因: 错误使用 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘dlnetwork/predict’, ‘F:Matlab2024btoolboxnnetcnndlnetwork.m’, 700)" style="font-weight:bold">dlnetwork/predict</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetcnndlnetwork.m’,700,0)">第 700 行</a>) 在层 "fc_1" 期间执行失败。 错误使用 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘dlarray/fullyconnect>iReshapeMtimesAdd’, ‘F:Matlab2024btoolboxnnetdeepdeep@dlarrayfullyconnect.m’, 272)" style="font-weight:bold">dlarray/fullyconnect>iReshapeMtimesAdd</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetdeepdeep@dlarrayfullyconnect.m’,272,0)">第 272 行</a>) 不支持复数。 There was an error executing the ProcessExperienceFcn. Caused by: 错误使用 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.function.IFunction/evaluate’, ‘F:Matlab2024btoolboxrlrl+rl+internal+function@IFunctionIFunction.m’, 84)" style="font-weight:bold">rl.internal.function.IFunction/evaluate</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+function@IFunctionIFunction.m’,84,0)">第 84 行</a>) Unable to evaluate function model. 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.function.rlContinuousDeterministicActor/getAction_’, ‘F:Matlab2024btoolboxrlrl+rl+functionrlContinuousDeterministicActor.m’, 131)" style="font-weight:bold">rl.function.rlContinuousDeterministicActor/getAction_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+functionrlContinuousDeterministicActor.m’,131,0)">第 131 行</a>) [action,state] = evaluate(this,observation,varargin{:}); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.function.IGetAction/getAction’, ‘F:Matlab2024btoolboxrlrl+rl+internal+functionIGetAction.m’, 43)" style="font-weight:bold">rl.internal.function.IGetAction/getAction</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+functionIGetAction.m’,43,0)">第 43 行</a>) [action,state] = getAction_(this,observation,cargs{:}); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘deep.AcceleratedFunction/parenReferencePacked’, ‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’, 326)" style="font-weight:bold">deep.AcceleratedFunction/parenReferencePacked</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’,326,0)">第 326 行</a>) [varargout{1:nargout}] = obj.Function(struct(‘v’,matlab.lang.internal.move(inputs)).v); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘deep.AcceleratedFunction/feval’, ‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’, 388)" style="font-weight:bold">deep.AcceleratedFunction/feval</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetdeepdeep+deepAcceleratedFunction.m’,388,0)">第 388 行</a>) [varargout{1:nargout}] = parenReferencePacked(obj, matlab.lang.internal.move(varargin)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.function.numericEval’, ‘F:Matlab2024btoolboxrlrl+rl+internal+functionnumericEval.m’, 24)" style="font-weight:bold">rl.internal.function.numericEval</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+functionnumericEval.m’,24,0)">第 24 行</a>) [varargout{1:nargout}] = feval(accelfcn,fcnobjs{:},varargin{:}); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.policy.rlAdditiveNoisePolicy/getAction_’, ‘F:Matlab2024btoolboxrlrl+rl+policyrlAdditiveNoisePolicy.m’, 162)" style="font-weight:bold">rl.policy.rlAdditiveNoisePolicy/getAction_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+policyrlAdditiveNoisePolicy.m’,162,0)">第 162 行</a>) [action,state] = rl.internal.function.numericEval(f,… ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.policy.PolicyInterface/getAction’, ‘F:Matlab2024btoolboxrlrl+rl+policyPolicyInterface.m’, 38)" style="font-weight:bold">rl.policy.PolicyInterface/getAction</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+policyPolicyInterface.m’,38,0)">第 38 行</a>) [action,this] = getAction_(this,observation); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.PolicyExperienceProcessorInterface/evaluateAction_’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalPolicyExperienceProcessorInterface.m’, 32)" style="font-weight:bold">rl.env.internal.PolicyExperienceProcessorInterface/evaluateAction_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalPolicyExperienceProcessorInterface.m’,32,0)">第 32 行</a>) [action,this.Policy_] = getAction(this.Policy_,observation); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.ExperienceProcessorInterface/evaluateAction’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalExperienceProcessorInterface.m’, 70)" style="font-weight:bold">rl.env.internal.ExperienceProcessorInterface/evaluateAction</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalExperienceProcessorInterface.m’,70,0)">第 70 行</a>) action = evaluateAction_(this,observation); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.MATLABSimulator/simInternal_’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’, 109)" style="font-weight:bold">rl.env.internal.MATLABSimulator/simInternal_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’,109,0)">第 109 行</a>) act = evaluateAction(expProcessor,obs); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.MATLABSimulator/sim_’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’, 67)" style="font-weight:bold">rl.env.internal.MATLABSimulator/sim_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalMATLABSimulator.m’,67,0)">第 67 行</a>) out = simInternal_(this,simPkg); ^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.internal.AbstractSimulator/sim’, ‘F:Matlab2024btoolboxrlrl+rl+env+internalAbstractSimulator.m’, 30)" style="font-weight:bold">rl.env.internal.AbstractSimulator/sim</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env+internalAbstractSimulator.m’,30,0)">第 30 行</a>) out = sim_(this,simData,policy,processExpFcn,processExpData); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.env.AbstractEnv/runEpisode’, ‘F:Matlab2024btoolboxrlrl+rl+env@AbstractEnvrunEpisode.m’, 144)" style="font-weight:bold">rl.env.AbstractEnv/runEpisode</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+env@AbstractEnvrunEpisode.m’,144,0)">第 144 行</a>) out = sim(simulator,simData,policy,processExpFcn,processExpData); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.OffPolicyTrainer/run_internal_/nestedRunEpisode’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’, 284)" style="font-weight:bold">rl.internal.train.OffPolicyTrainer/run_internal_/nestedRunEpisode</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’,284,0)">第 284 行</a>) out_or_F = runEpisode(env,p,… ^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.OffPolicyTrainer/run_internal_’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’, 351)" style="font-weight:bold">rl.internal.train.OffPolicyTrainer/run_internal_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’,351,0)">第 351 行</a>) out = nestedRunEpisode(policy); ^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.OffPolicyTrainer/run_’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’, 39)" style="font-weight:bold">rl.internal.train.OffPolicyTrainer/run_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainOffPolicyTrainer.m’,39,0)">第 39 行</a>) result = run_internal_(this); ^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.train.Trainer/run’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainTrainer.m’, 8)" style="font-weight:bold">rl.internal.train.Trainer/run</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainTrainer.m’,8,0)">第 8 行</a>) result = run_(this); ^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.trainmgr.OnlineTrainingManager/run_’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrOnlineTrainingManager.m’, 123)" style="font-weight:bold">rl.internal.trainmgr.OnlineTrainingManager/run_</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrOnlineTrainingManager.m’,123,0)">第 123 行</a>) trainResult = run(trainer); ^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.trainmgr.TrainingManager/run’, ‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrTrainingManager.m’, 4)" style="font-weight:bold">rl.internal.trainmgr.TrainingManager/run</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+trainmgrTrainingManager.m’,4,0)">第 4 行</a>) result = run_(this); ^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.agent.AbstractAgent/train’, ‘F:Matlab2024btoolboxrlrl+rl+agent@AbstractAgenttrain.m’, 86)" style="font-weight:bold">rl.agent.AbstractAgent/train</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+agent@AbstractAgenttrain.m’,86,0)">第 86 行</a>) trainingResult = run(tm); ^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tool.TrainingSession/runTraining’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’, 169)" style="font-weight:bold">rl.internal.app.tool.TrainingSession/runTraining</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’,169,0)">第 169 行</a>) obj.TrainingResult = train(obj.TrainedAgent,obj.Environment,obj.Options,Evaluator=obj.Evaluator); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tool.TrainingSession/startTraining’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’, 106)" style="font-weight:bold">rl.internal.app.tool.TrainingSession/startTraining</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+toolTrainingSession.m’,106,0)">第 106 行</a>) runTraining(obj); ^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.ReinforcementLearningApp/openTrainingSession’, ‘F:Matlab2024btoolboxrlrl+rl+internal+appReinforcementLearningApp.m’, 369)" style="font-weight:bold">rl.internal.app.ReinforcementLearningApp/openTrainingSession</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+appReinforcementLearningApp.m’,369,0)">第 369 行</a>) startTraining(obj.TrainingSession,Data,IsResume) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tab.TrainTab/trainCB’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’, 315)" style="font-weight:bold">rl.internal.app.tab.TrainTab/trainCB</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’,315,0)">第 315 行</a>) openTrainingSession(obj.App,obj.Data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘rl.internal.app.tab.TrainTab>@(~,~)trainCB(obj)’, ‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’, 210)" style="font-weight:bold">rl.internal.app.tab.TrainTab>@(~,~)trainCB(obj)</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxrlrl+rl+internal+app+tabTrainTab.m’,210,0)">第 210 行</a>) obj.Widgets.TrainButton.ButtonPushedFcn = @(~, ~) trainCB(obj); ^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘internal.Callback.execute’, ‘F:Matlab2024btoolboxsharedtestmeaslibgeneral+internalCallback.m’, 128)" style="font-weight:bold">internal.Callback.execute</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxsharedtestmeaslibgeneral+internalCallback.m’,128,0)">第 128 行</a>) feval(callback, src, event); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘matlab.ui.internal.toolstrip.base.Action/PeerEventCallback’, ‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseAction.m’, 852)" style="font-weight:bold">matlab.ui.internal.toolstrip.base.Action/PeerEventCallback</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseAction.m’,852,0)">第 852 行</a>) internal.Callback.execute(this.PushPerformedFcn, this, eventdata); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘matlab.ui.internal.toolstrip.base.ActionInterface>@(event,data)PeerEventCallback(this,event,data)’, ‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseActionInterface.m’, 41)" style="font-weight:bold">matlab.ui.internal.toolstrip.base.ActionInterface>@(event,data)PeerEventCallback(this,event,data)</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxmatlabtoolstrip+matlab+ui+internal+toolstrip+baseActionInterface.m’,41,0)">第 41 行</a>) this.PeerEventListener = addlistener(this.Peer, ‘peerEvent’, @(event, data) PeerEventCallback(this, event, data)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 出错 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘viewmodel.internal.factory.ManagerFactoryProducer>@(src,event)callback(src,viewmodel.internal.factory.ManagerFactoryProducer.convertStructToEventData(event))’, ‘F:Matlab2024btoolboxsharedviewmodelviewmodel+viewmodel+internal+factoryManagerFactoryProducer.m’, 76)" style="font-weight:bold">viewmodel.internal.factory.ManagerFactoryProducer>@(src,event)callback(src,viewmodel.internal.factory.ManagerFactoryProducer.convertStructToEventData(event))</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxsharedviewmodelviewmodel+viewmodel+internal+factoryManagerFactoryProducer.m’,76,0)">第 76 行</a>) proxyCallback = @(src, event)callback(src, … ^^^^^^^^^^^^^^^^^ 原因: 错误使用 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘dlnetwork/predict’, ‘F:Matlab2024btoolboxnnetcnndlnetwork.m’, 700)" style="font-weight:bold">dlnetwork/predict</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetcnndlnetwork.m’,700,0)">第 700 行</a>) 在层 "fc_1" 期间执行失败。 错误使用 <a href="matlab:matlab.lang.internal.introspective.errorDocCallback(‘dlarray/fullyconnect>iReshapeMtimesAdd’, ‘F:Matlab2024btoolboxnnetdeepdeep@dlarrayfullyconnect.m’, 272)" style="font-weight:bold">dlarray/fullyconnect>iReshapeMtimesAdd</a> (<a href="matlab: opentoline(‘F:Matlab2024btoolboxnnetdeepdeep@dlarrayfullyconnect.m’,272,0)">第 272 行</a>) 不支持复数。 rl MATLAB Answers — New Questions
Could I use double precision with `cusparse` or `cublas` function in mexcuda.cu file?
Hi,
I am trying to compile my .cu file with cudamex. In this file, I would like to write some functions in cusparse or cublas file. Because I don’t know much of setting the number of block or threads. But I find that all the cublas or cusparse functions are in float format, which is equal to single class in Matlab, imo. Could I have some way to input double precision numbers? Besides, must I include the cublas and cusparse library? Are there any version of them built in Matlab? The following is my example of copying float vector. It runs well. If it has some reundancy or irregular part, please let me know. Thank you.
#include "mex.h"
#include "gpu/mxGPUArray.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cuda_runtime.h>
#include <cusparse.h>
#include <cublas_v2.h>
#include <helper_functions.h>
#include <helper_cuda.h>
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, mxArray const *prhs[])
{
// =========================================================================
// input : x
// =========================================================================
mxGPUArray* x = mxGPUCopyFromMxArray(prhs[0]);
int N = (int)(mxGPUGetNumberOfElements(x));
// =========================================================================
// create other variable: y
// =========================================================================
auto dn = mxGPUGetNumberOfDimensions(x);
auto d = mxGPUGetDimensions(x);
mxGPUArray* y = mxGPUCreateGPUAraray(dn,d,mxSINGLE_CLASS,mxREAL,MX_GPU_INITIALIZE_VALUES);
// =========================================================================
// set device pointers: d_x, d_y
// =========================================================================
float *d_x = (float*)mxGPUGetData(x);
float *d_y = (float*)mxGPUGetData(y);
// =========================================================================
// gpu computing: initial
// =========================================================================
/* Get handle to the CUBLAS context */
cublasHandle_t cublasHandle = 0;
cublasStatus_t cublasStatus;
cublasStatus = cublasCreate(&cublasHandle);
checkCudaErrors(cublasStatus);
// =========================================================================
// step1
// =========================================================================
cublasScopy(cublasHandle, N, d_x,1,d_y,1);
// =========================================================================
// output
// =========================================================================
plhs[0] = mxGPUCreateMxArrayOnCPU(y);
// =========================================================================
// clear
// =========================================================================
mxGPUDestroyGPUArray(x);
mxGPUDestroyGPUArray(y);
}Hi,
I am trying to compile my .cu file with cudamex. In this file, I would like to write some functions in cusparse or cublas file. Because I don’t know much of setting the number of block or threads. But I find that all the cublas or cusparse functions are in float format, which is equal to single class in Matlab, imo. Could I have some way to input double precision numbers? Besides, must I include the cublas and cusparse library? Are there any version of them built in Matlab? The following is my example of copying float vector. It runs well. If it has some reundancy or irregular part, please let me know. Thank you.
#include "mex.h"
#include "gpu/mxGPUArray.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cuda_runtime.h>
#include <cusparse.h>
#include <cublas_v2.h>
#include <helper_functions.h>
#include <helper_cuda.h>
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, mxArray const *prhs[])
{
// =========================================================================
// input : x
// =========================================================================
mxGPUArray* x = mxGPUCopyFromMxArray(prhs[0]);
int N = (int)(mxGPUGetNumberOfElements(x));
// =========================================================================
// create other variable: y
// =========================================================================
auto dn = mxGPUGetNumberOfDimensions(x);
auto d = mxGPUGetDimensions(x);
mxGPUArray* y = mxGPUCreateGPUAraray(dn,d,mxSINGLE_CLASS,mxREAL,MX_GPU_INITIALIZE_VALUES);
// =========================================================================
// set device pointers: d_x, d_y
// =========================================================================
float *d_x = (float*)mxGPUGetData(x);
float *d_y = (float*)mxGPUGetData(y);
// =========================================================================
// gpu computing: initial
// =========================================================================
/* Get handle to the CUBLAS context */
cublasHandle_t cublasHandle = 0;
cublasStatus_t cublasStatus;
cublasStatus = cublasCreate(&cublasHandle);
checkCudaErrors(cublasStatus);
// =========================================================================
// step1
// =========================================================================
cublasScopy(cublasHandle, N, d_x,1,d_y,1);
// =========================================================================
// output
// =========================================================================
plhs[0] = mxGPUCreateMxArrayOnCPU(y);
// =========================================================================
// clear
// =========================================================================
mxGPUDestroyGPUArray(x);
mxGPUDestroyGPUArray(y);
} Hi,
I am trying to compile my .cu file with cudamex. In this file, I would like to write some functions in cusparse or cublas file. Because I don’t know much of setting the number of block or threads. But I find that all the cublas or cusparse functions are in float format, which is equal to single class in Matlab, imo. Could I have some way to input double precision numbers? Besides, must I include the cublas and cusparse library? Are there any version of them built in Matlab? The following is my example of copying float vector. It runs well. If it has some reundancy or irregular part, please let me know. Thank you.
#include "mex.h"
#include "gpu/mxGPUArray.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cuda_runtime.h>
#include <cusparse.h>
#include <cublas_v2.h>
#include <helper_functions.h>
#include <helper_cuda.h>
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, mxArray const *prhs[])
{
// =========================================================================
// input : x
// =========================================================================
mxGPUArray* x = mxGPUCopyFromMxArray(prhs[0]);
int N = (int)(mxGPUGetNumberOfElements(x));
// =========================================================================
// create other variable: y
// =========================================================================
auto dn = mxGPUGetNumberOfDimensions(x);
auto d = mxGPUGetDimensions(x);
mxGPUArray* y = mxGPUCreateGPUAraray(dn,d,mxSINGLE_CLASS,mxREAL,MX_GPU_INITIALIZE_VALUES);
// =========================================================================
// set device pointers: d_x, d_y
// =========================================================================
float *d_x = (float*)mxGPUGetData(x);
float *d_y = (float*)mxGPUGetData(y);
// =========================================================================
// gpu computing: initial
// =========================================================================
/* Get handle to the CUBLAS context */
cublasHandle_t cublasHandle = 0;
cublasStatus_t cublasStatus;
cublasStatus = cublasCreate(&cublasHandle);
checkCudaErrors(cublasStatus);
// =========================================================================
// step1
// =========================================================================
cublasScopy(cublasHandle, N, d_x,1,d_y,1);
// =========================================================================
// output
// =========================================================================
plhs[0] = mxGPUCreateMxArrayOnCPU(y);
// =========================================================================
// clear
// =========================================================================
mxGPUDestroyGPUArray(x);
mxGPUDestroyGPUArray(y);
} gpu, cublas MATLAB Answers — New Questions
Droplet size calculation of a spray image
Hi predecessors,
I have this kind of spray image and I want to calculate the droplet size and distribution of the particles, and wondering if there is a way to do that on MATLAB so that I can learn from it. Thanks!
Here are what I do now, I really appreciate you can help to point out the errors or mistakes,and if you are me, what code will you use to realize this function.
clc
clear all;
image=imread(‘E:picture_testheitu.tiff’);
jqimage=image(2000:2500,2000:2500);
imshow(jqimage,[0 4000]);title(‘jiequ’);
[gradthresh,numofiter]=imdiffuseest(jqimage);
diffusedImage=double(imdiffusefilt(jqimage,’GradientThresh’,gradthresh,’NumberOfIterations’,numofiter));
imshow(diffusedImage,[0 4000]);
[testx,testy]=size(diffusedImage);
array_x=zeros(501,501);
blank_x=zeros(501,501);
y=zeros(1,501);
for i=1:testx
testx_temp=diffusedImage(i,:);
for i1=2:testy-1
y(i1)=abs((testx_temp(i1+1)-testx_temp(i1-1))/2);
end
array_x(i,:)=y;
[pks,locs]=findpeaks(array_x(i,:),"MinPeakHeight",40);
blank_x_i=blank_x(i,:);
for i2=1:length(locs);
blank_x_i(locs(i2))=1;
end
blank_x(i,:)= blank_x_i;
end
array_y=zeros(501,501);
blank_y=zeros(501,501);
x=zeros(501,1);
for i=1:testy
testx_temp=diffusedImage(:,i);
for i1=2:testx-1
x(i1)=abs((testx_temp(i1+1)-testx_temp(i1-1))/2);
end
array_y(:,i)=x;
[pks,locs]=findpeaks(array_y(:,i),"MinPeakHeight",40);
blank_y_i=blank_y(:,i);
for i2=1:length(locs);
blank_y_i(locs(i2))=1;
end
blank_y(:,i)= blank_y_i;
end
figure;
imagesc(blank_x);
hold on;
imagesc(blank_y);
add_ab=blank_x+blank_y;
imagesc(add_ab);
figure;
binaryimage=im2bw(add_ab);
imshow(binaryimage);
binaryimage=imfill(binaryimage,’holes’);
imshow(binaryimage);title(‘binaryimage’);
figure
labeledimage=bwlabel(binaryimage,8);
imshow(labeledimage);
coloredlabels=label2rgb(labeledimage,’hsv’,’k’,’shuffle’);
hold on;
imshow(coloredlabels);
blobmeasurements=regionprops(labeledimage,add_ab,’all’);
numberofblobs=size(blobmeasurements,1);
boundaries=bwboundaries(binaryimage);
numberofboundaries=size(boundaries,1);
for k1=1:numberofboundaries
thisboundary=boundaries{k1};
plot(thisboundary(:,2),thisboundary(:,1),’g’,’LineWidth’,2);
end
for k2=1:numberofblobs
blobarea=blobmeasurements(k2).Area;
blobecd(k2)=sqrt(4*blobarea/pi);
fprintf(‘%dn’,blobecd(k2))
endHi predecessors,
I have this kind of spray image and I want to calculate the droplet size and distribution of the particles, and wondering if there is a way to do that on MATLAB so that I can learn from it. Thanks!
Here are what I do now, I really appreciate you can help to point out the errors or mistakes,and if you are me, what code will you use to realize this function.
clc
clear all;
image=imread(‘E:picture_testheitu.tiff’);
jqimage=image(2000:2500,2000:2500);
imshow(jqimage,[0 4000]);title(‘jiequ’);
[gradthresh,numofiter]=imdiffuseest(jqimage);
diffusedImage=double(imdiffusefilt(jqimage,’GradientThresh’,gradthresh,’NumberOfIterations’,numofiter));
imshow(diffusedImage,[0 4000]);
[testx,testy]=size(diffusedImage);
array_x=zeros(501,501);
blank_x=zeros(501,501);
y=zeros(1,501);
for i=1:testx
testx_temp=diffusedImage(i,:);
for i1=2:testy-1
y(i1)=abs((testx_temp(i1+1)-testx_temp(i1-1))/2);
end
array_x(i,:)=y;
[pks,locs]=findpeaks(array_x(i,:),"MinPeakHeight",40);
blank_x_i=blank_x(i,:);
for i2=1:length(locs);
blank_x_i(locs(i2))=1;
end
blank_x(i,:)= blank_x_i;
end
array_y=zeros(501,501);
blank_y=zeros(501,501);
x=zeros(501,1);
for i=1:testy
testx_temp=diffusedImage(:,i);
for i1=2:testx-1
x(i1)=abs((testx_temp(i1+1)-testx_temp(i1-1))/2);
end
array_y(:,i)=x;
[pks,locs]=findpeaks(array_y(:,i),"MinPeakHeight",40);
blank_y_i=blank_y(:,i);
for i2=1:length(locs);
blank_y_i(locs(i2))=1;
end
blank_y(:,i)= blank_y_i;
end
figure;
imagesc(blank_x);
hold on;
imagesc(blank_y);
add_ab=blank_x+blank_y;
imagesc(add_ab);
figure;
binaryimage=im2bw(add_ab);
imshow(binaryimage);
binaryimage=imfill(binaryimage,’holes’);
imshow(binaryimage);title(‘binaryimage’);
figure
labeledimage=bwlabel(binaryimage,8);
imshow(labeledimage);
coloredlabels=label2rgb(labeledimage,’hsv’,’k’,’shuffle’);
hold on;
imshow(coloredlabels);
blobmeasurements=regionprops(labeledimage,add_ab,’all’);
numberofblobs=size(blobmeasurements,1);
boundaries=bwboundaries(binaryimage);
numberofboundaries=size(boundaries,1);
for k1=1:numberofboundaries
thisboundary=boundaries{k1};
plot(thisboundary(:,2),thisboundary(:,1),’g’,’LineWidth’,2);
end
for k2=1:numberofblobs
blobarea=blobmeasurements(k2).Area;
blobecd(k2)=sqrt(4*blobarea/pi);
fprintf(‘%dn’,blobecd(k2))
end Hi predecessors,
I have this kind of spray image and I want to calculate the droplet size and distribution of the particles, and wondering if there is a way to do that on MATLAB so that I can learn from it. Thanks!
Here are what I do now, I really appreciate you can help to point out the errors or mistakes,and if you are me, what code will you use to realize this function.
clc
clear all;
image=imread(‘E:picture_testheitu.tiff’);
jqimage=image(2000:2500,2000:2500);
imshow(jqimage,[0 4000]);title(‘jiequ’);
[gradthresh,numofiter]=imdiffuseest(jqimage);
diffusedImage=double(imdiffusefilt(jqimage,’GradientThresh’,gradthresh,’NumberOfIterations’,numofiter));
imshow(diffusedImage,[0 4000]);
[testx,testy]=size(diffusedImage);
array_x=zeros(501,501);
blank_x=zeros(501,501);
y=zeros(1,501);
for i=1:testx
testx_temp=diffusedImage(i,:);
for i1=2:testy-1
y(i1)=abs((testx_temp(i1+1)-testx_temp(i1-1))/2);
end
array_x(i,:)=y;
[pks,locs]=findpeaks(array_x(i,:),"MinPeakHeight",40);
blank_x_i=blank_x(i,:);
for i2=1:length(locs);
blank_x_i(locs(i2))=1;
end
blank_x(i,:)= blank_x_i;
end
array_y=zeros(501,501);
blank_y=zeros(501,501);
x=zeros(501,1);
for i=1:testy
testx_temp=diffusedImage(:,i);
for i1=2:testx-1
x(i1)=abs((testx_temp(i1+1)-testx_temp(i1-1))/2);
end
array_y(:,i)=x;
[pks,locs]=findpeaks(array_y(:,i),"MinPeakHeight",40);
blank_y_i=blank_y(:,i);
for i2=1:length(locs);
blank_y_i(locs(i2))=1;
end
blank_y(:,i)= blank_y_i;
end
figure;
imagesc(blank_x);
hold on;
imagesc(blank_y);
add_ab=blank_x+blank_y;
imagesc(add_ab);
figure;
binaryimage=im2bw(add_ab);
imshow(binaryimage);
binaryimage=imfill(binaryimage,’holes’);
imshow(binaryimage);title(‘binaryimage’);
figure
labeledimage=bwlabel(binaryimage,8);
imshow(labeledimage);
coloredlabels=label2rgb(labeledimage,’hsv’,’k’,’shuffle’);
hold on;
imshow(coloredlabels);
blobmeasurements=regionprops(labeledimage,add_ab,’all’);
numberofblobs=size(blobmeasurements,1);
boundaries=bwboundaries(binaryimage);
numberofboundaries=size(boundaries,1);
for k1=1:numberofboundaries
thisboundary=boundaries{k1};
plot(thisboundary(:,2),thisboundary(:,1),’g’,’LineWidth’,2);
end
for k2=1:numberofblobs
blobarea=blobmeasurements(k2).Area;
blobecd(k2)=sqrt(4*blobarea/pi);
fprintf(‘%dn’,blobecd(k2))
end droplet size distribution, particle, image segmentation MATLAB Answers — New Questions
How can I configure to observe several cameras at the same time in MechanicsExplorer?
I’ve a design in Simscape multibody and I would like to show several views of the simulation in MechanicsExplorer with cameramanager at the same time, I have observed in examples like the image below that this is possible but I cannot find a way to replicate it.I’ve a design in Simscape multibody and I would like to show several views of the simulation in MechanicsExplorer with cameramanager at the same time, I have observed in examples like the image below that this is possible but I cannot find a way to replicate it. I’ve a design in Simscape multibody and I would like to show several views of the simulation in MechanicsExplorer with cameramanager at the same time, I have observed in examples like the image below that this is possible but I cannot find a way to replicate it. cameramanager, simscape, multiple views MATLAB Answers — New Questions