Month: January 2025
Modbus RTU Write Simulink Block error
Hi community,
I am starting with the setup of a modbus RTU communication between my matlab simulink model and some surrounding devices. Using the new simulink block "modbus client read", I can read the register of my external device, which shows me, that I’ve created a stable communication. However, if I want to write a register on the device, using the block "modbus client write", I get the following error:
Error:An error occurred during simulation and the simulation was terminated
Caused by:
MATLAB System block ‘untitled/Modbus Client Write/internalModbus’ error occurred when invoking ‘stepImpl’ method of ‘icomm.system.ModbusWrite’. The error was thrown from ‘
‘C:Program FilesMATLABR2024btoolboxicommmodbusmodbusmodbusblks+icomm+systemModbusWrite.p’ at line 0′.
The Modbus server returned an invalid address error. Address + number of values to write is out of range.
The config of the write-block is pictured:
As aforementioned, it’s the same connection as used for the reading process. The model is quite simple and broken down to the minimum, but I get the error anyway:
Now I am struggling how to proceed with this error. Maybe someone can help me out!
Best
MarcoHi community,
I am starting with the setup of a modbus RTU communication between my matlab simulink model and some surrounding devices. Using the new simulink block "modbus client read", I can read the register of my external device, which shows me, that I’ve created a stable communication. However, if I want to write a register on the device, using the block "modbus client write", I get the following error:
Error:An error occurred during simulation and the simulation was terminated
Caused by:
MATLAB System block ‘untitled/Modbus Client Write/internalModbus’ error occurred when invoking ‘stepImpl’ method of ‘icomm.system.ModbusWrite’. The error was thrown from ‘
‘C:Program FilesMATLABR2024btoolboxicommmodbusmodbusmodbusblks+icomm+systemModbusWrite.p’ at line 0′.
The Modbus server returned an invalid address error. Address + number of values to write is out of range.
The config of the write-block is pictured:
As aforementioned, it’s the same connection as used for the reading process. The model is quite simple and broken down to the minimum, but I get the error anyway:
Now I am struggling how to proceed with this error. Maybe someone can help me out!
Best
Marco Hi community,
I am starting with the setup of a modbus RTU communication between my matlab simulink model and some surrounding devices. Using the new simulink block "modbus client read", I can read the register of my external device, which shows me, that I’ve created a stable communication. However, if I want to write a register on the device, using the block "modbus client write", I get the following error:
Error:An error occurred during simulation and the simulation was terminated
Caused by:
MATLAB System block ‘untitled/Modbus Client Write/internalModbus’ error occurred when invoking ‘stepImpl’ method of ‘icomm.system.ModbusWrite’. The error was thrown from ‘
‘C:Program FilesMATLABR2024btoolboxicommmodbusmodbusmodbusblks+icomm+systemModbusWrite.p’ at line 0′.
The Modbus server returned an invalid address error. Address + number of values to write is out of range.
The config of the write-block is pictured:
As aforementioned, it’s the same connection as used for the reading process. The model is quite simple and broken down to the minimum, but I get the error anyway:
Now I am struggling how to proceed with this error. Maybe someone can help me out!
Best
Marco simulink, modbus, modbusrtu, writeregister MATLAB Answers — New Questions
How to use the Visual Studio Code for Simulink c-caller Debugging with MATLAB Coder Interface?
I have installed the MATLAB Coder Interface for VSCode, (matlab-coder-interface-vscode-debugging.vsix) and I have the C-caller simulink function and I’d like to know how can I use this extension for C-caller c-function to debug it.
and this link "Simulate custom code in a separate process" is not clear to me how to use external tool (VSCode) and seprate process …
Please can you suggest the steps to use VS Code to debug the c-code for C-caller simulink funtion?
Thank you very much.I have installed the MATLAB Coder Interface for VSCode, (matlab-coder-interface-vscode-debugging.vsix) and I have the C-caller simulink function and I’d like to know how can I use this extension for C-caller c-function to debug it.
and this link "Simulate custom code in a separate process" is not clear to me how to use external tool (VSCode) and seprate process …
Please can you suggest the steps to use VS Code to debug the c-code for C-caller simulink funtion?
Thank you very much. I have installed the MATLAB Coder Interface for VSCode, (matlab-coder-interface-vscode-debugging.vsix) and I have the C-caller simulink function and I’d like to know how can I use this extension for C-caller c-function to debug it.
and this link "Simulate custom code in a separate process" is not clear to me how to use external tool (VSCode) and seprate process …
Please can you suggest the steps to use VS Code to debug the c-code for C-caller simulink funtion?
Thank you very much. vscode to debug simulink MATLAB Answers — New Questions
How to view a 3D Figure from “below”, e.g. z-axis facing downwards
I’m looking for a possibility to view/rotate a North-East-Down Coordinate Frame in a 3D Figure.
By casually plotting a cartesian coordinate system z is facing upwards, and by rotating it with the hand tool, it is not possible to "flip" the figure so that z is facing down.
If you set the z-Axis to ‘reverse’ the right hand system becomes a left-hand system, thus this is not a solution.
figure
plot3(0,0,0)
line([0 0.1],[0 0],[0 0],’LineWidth’,5,’DisplayName’,’X’)
line([0 0],[0 0.1],[0 0],’LineWidth’,5,’DisplayName’,’Y’)
line([0 0],[0 0],[0 0.1],’LineWidth’,5,’DisplayName’,’Z’)
legend
Take the above picture, I would like a solution where the Z-Line is Facing downwards, without changing the coordinate-systemI’m looking for a possibility to view/rotate a North-East-Down Coordinate Frame in a 3D Figure.
By casually plotting a cartesian coordinate system z is facing upwards, and by rotating it with the hand tool, it is not possible to "flip" the figure so that z is facing down.
If you set the z-Axis to ‘reverse’ the right hand system becomes a left-hand system, thus this is not a solution.
figure
plot3(0,0,0)
line([0 0.1],[0 0],[0 0],’LineWidth’,5,’DisplayName’,’X’)
line([0 0],[0 0.1],[0 0],’LineWidth’,5,’DisplayName’,’Y’)
line([0 0],[0 0],[0 0.1],’LineWidth’,5,’DisplayName’,’Z’)
legend
Take the above picture, I would like a solution where the Z-Line is Facing downwards, without changing the coordinate-system I’m looking for a possibility to view/rotate a North-East-Down Coordinate Frame in a 3D Figure.
By casually plotting a cartesian coordinate system z is facing upwards, and by rotating it with the hand tool, it is not possible to "flip" the figure so that z is facing down.
If you set the z-Axis to ‘reverse’ the right hand system becomes a left-hand system, thus this is not a solution.
figure
plot3(0,0,0)
line([0 0.1],[0 0],[0 0],’LineWidth’,5,’DisplayName’,’X’)
line([0 0],[0 0.1],[0 0],’LineWidth’,5,’DisplayName’,’Y’)
line([0 0],[0 0],[0 0.1],’LineWidth’,5,’DisplayName’,’Z’)
legend
Take the above picture, I would like a solution where the Z-Line is Facing downwards, without changing the coordinate-system ned, coordinatesystem, rotation MATLAB Answers — New Questions
Troubleshooting Signal Logging in SDI for FPGA Outputs in Speedgoat Motion Control HDL I/O Blockset
In pwm_example_hdlc.slx example from Speedgoat Motion Control HDL I/O Blockset v1.0 (R2024b). I want to view logged signals in SDI. There are PWM and CAP signals in the example which are set to logging.
I succesfully generated bitstream and run example on Speedgoat P3 Perfomance. The hardware generates PWM signals as expected (confirmed with oscilloscope). However, the SDI does not have any signal available during or post model execution.
During model build the following warning(s) is issued:
Warning: Unable to instrument ‘gm_pwm_example_hdlc_slrt/DUT PWM and CAP/DataTypeConversion:1’: Unable to stream signal
‘gm_pwm_example_hdlc_slrt/DUT PWM and CAP/DataTypeConversion:1’. Possible reasons include:
(1) Signal is not available in application.
(2) Signal does not use globally accessible memory in application.
(3) Signal connects to a MessageSend block.
(4) Signal has inherited sample time.
(5) Signal is discontiguous.
For more suggestions to resolve this issue, see Troubleshoot Signals for Streaming or File Log logging.
I followed the advice given in Troubleshoot Signals for Streaming or File Log logging and in this post:
added test point
added Signal Copy Block
made PWM_A signal globally accessible
But the issue persist and no data appears in SDI (external mode, command line, slrtExplorer).
If I add the rate transition block, the signal appear in SDI, however the value is 0 (Output port sample time is 1e-4s), whereas PWM perion is 1e-3s.
If I add sine generator block in the model and log its output, this sine output signal appears in SDI as expected.
What can be the reason that the outputs from FPGA cannot be visualized in the model?In pwm_example_hdlc.slx example from Speedgoat Motion Control HDL I/O Blockset v1.0 (R2024b). I want to view logged signals in SDI. There are PWM and CAP signals in the example which are set to logging.
I succesfully generated bitstream and run example on Speedgoat P3 Perfomance. The hardware generates PWM signals as expected (confirmed with oscilloscope). However, the SDI does not have any signal available during or post model execution.
During model build the following warning(s) is issued:
Warning: Unable to instrument ‘gm_pwm_example_hdlc_slrt/DUT PWM and CAP/DataTypeConversion:1’: Unable to stream signal
‘gm_pwm_example_hdlc_slrt/DUT PWM and CAP/DataTypeConversion:1’. Possible reasons include:
(1) Signal is not available in application.
(2) Signal does not use globally accessible memory in application.
(3) Signal connects to a MessageSend block.
(4) Signal has inherited sample time.
(5) Signal is discontiguous.
For more suggestions to resolve this issue, see Troubleshoot Signals for Streaming or File Log logging.
I followed the advice given in Troubleshoot Signals for Streaming or File Log logging and in this post:
added test point
added Signal Copy Block
made PWM_A signal globally accessible
But the issue persist and no data appears in SDI (external mode, command line, slrtExplorer).
If I add the rate transition block, the signal appear in SDI, however the value is 0 (Output port sample time is 1e-4s), whereas PWM perion is 1e-3s.
If I add sine generator block in the model and log its output, this sine output signal appears in SDI as expected.
What can be the reason that the outputs from FPGA cannot be visualized in the model? In pwm_example_hdlc.slx example from Speedgoat Motion Control HDL I/O Blockset v1.0 (R2024b). I want to view logged signals in SDI. There are PWM and CAP signals in the example which are set to logging.
I succesfully generated bitstream and run example on Speedgoat P3 Perfomance. The hardware generates PWM signals as expected (confirmed with oscilloscope). However, the SDI does not have any signal available during or post model execution.
During model build the following warning(s) is issued:
Warning: Unable to instrument ‘gm_pwm_example_hdlc_slrt/DUT PWM and CAP/DataTypeConversion:1’: Unable to stream signal
‘gm_pwm_example_hdlc_slrt/DUT PWM and CAP/DataTypeConversion:1’. Possible reasons include:
(1) Signal is not available in application.
(2) Signal does not use globally accessible memory in application.
(3) Signal connects to a MessageSend block.
(4) Signal has inherited sample time.
(5) Signal is discontiguous.
For more suggestions to resolve this issue, see Troubleshoot Signals for Streaming or File Log logging.
I followed the advice given in Troubleshoot Signals for Streaming or File Log logging and in this post:
added test point
added Signal Copy Block
made PWM_A signal globally accessible
But the issue persist and no data appears in SDI (external mode, command line, slrtExplorer).
If I add the rate transition block, the signal appear in SDI, however the value is 0 (Output port sample time is 1e-4s), whereas PWM perion is 1e-3s.
If I add sine generator block in the model and log its output, this sine output signal appears in SDI as expected.
What can be the reason that the outputs from FPGA cannot be visualized in the model? real-time, speedgoat, sdi MATLAB Answers — New Questions
Simulating Induction motor inter-turn short circuit faults
Hi! Using Simulink / Simscape I wish to Simulate an Induction Motor for getting normal operation and inter-turn short circuit fault data for training my Machine learning based fault classifier. I basically desire a model that incorporates saturation and iron losses effects as well. Any help and guidance is requested.Hi! Using Simulink / Simscape I wish to Simulate an Induction Motor for getting normal operation and inter-turn short circuit fault data for training my Machine learning based fault classifier. I basically desire a model that incorporates saturation and iron losses effects as well. Any help and guidance is requested. Hi! Using Simulink / Simscape I wish to Simulate an Induction Motor for getting normal operation and inter-turn short circuit fault data for training my Machine learning based fault classifier. I basically desire a model that incorporates saturation and iron losses effects as well. Any help and guidance is requested. induction-motor model, simulink, simscape MATLAB Answers — New Questions
Assigning plot to an existing axes Matlab GUI
Hi,
I have a GUI in Matlab and several functions in it. One function is for plotting a figure, I need to assign it to an existing axes in GUI. I have tried several options, nothing has worked out yet.
Code below is the current option I had tried before I asked here.
set(‘CurrentAxes’,’axes11′)
plot(VyQRS(:,2));
grid on
The plot of VyQRS I need to assign to axes11.
Could you please give me any hint?Hi,
I have a GUI in Matlab and several functions in it. One function is for plotting a figure, I need to assign it to an existing axes in GUI. I have tried several options, nothing has worked out yet.
Code below is the current option I had tried before I asked here.
set(‘CurrentAxes’,’axes11′)
plot(VyQRS(:,2));
grid on
The plot of VyQRS I need to assign to axes11.
Could you please give me any hint? Hi,
I have a GUI in Matlab and several functions in it. One function is for plotting a figure, I need to assign it to an existing axes in GUI. I have tried several options, nothing has worked out yet.
Code below is the current option I had tried before I asked here.
set(‘CurrentAxes’,’axes11′)
plot(VyQRS(:,2));
grid on
The plot of VyQRS I need to assign to axes11.
Could you please give me any hint? matlab gui, plotting, guide MATLAB Answers — New Questions
Construction of subplots for the comparison of two models
Hi Everyone!
I would like to know what kind of subplot (code) I could use to make similar graphics.
Best regard,Hi Everyone!
I would like to know what kind of subplot (code) I could use to make similar graphics.
Best regard, Hi Everyone!
I would like to know what kind of subplot (code) I could use to make similar graphics.
Best regard, two mdels comparison, comparison models MATLAB Answers — New Questions
Execution times and the “pause” function
I have a question about a strange phenomenon I have been noticing for some time whilst working with Matlab and which has now become somewhat acute.
When I run scripts which are relatively demanding on my computer, pausing and immediately unpausing the execution weirdly appears to speed up the execution of the rest of the script.
The current example is this:
I am running a simulation model, which is essentially just one big loop representing simulation periods . Within this loop there is another loop which is entered only under a certain condition. If this second loop is entered in some simulation period t, the simualtion of this particular period naturally takes longer than that of the other ones as more operations are executed.
Essentially the programm looks like this:
for t=1:T
do stuff
if condition holds
for tt=1:TT
do more stuff
end
end
end
The problem I have is the following: After the second, inner loop is entered, all following simulation periods take longer to execute, even when the condition does not hold. I have gone into debug mode and can 100% confirm that the second loop is not entered in other simulation periods. Nevertheless those periods take longer to execute after the second loop has been entered once in a previous period.
Additionally, if i pause the execution of the script manually after the second loop has been entered and exited again and then continue, the script speeds back up and the rest of the periods are simulated at the usual speed. More generally, I often find that if a script runs slowly I can speed it up significantly by pausing and unpausing.
Does anyone know what might be causing this?
PS: After some additonal experimentation it seems that this phenomenon only occurs if I click the pause button in the GUI, i.e. if I enter debug mode and then pess continue. Simply inserting pause(n) under some condition into the script does not cause this change in execution speeds.I have a question about a strange phenomenon I have been noticing for some time whilst working with Matlab and which has now become somewhat acute.
When I run scripts which are relatively demanding on my computer, pausing and immediately unpausing the execution weirdly appears to speed up the execution of the rest of the script.
The current example is this:
I am running a simulation model, which is essentially just one big loop representing simulation periods . Within this loop there is another loop which is entered only under a certain condition. If this second loop is entered in some simulation period t, the simualtion of this particular period naturally takes longer than that of the other ones as more operations are executed.
Essentially the programm looks like this:
for t=1:T
do stuff
if condition holds
for tt=1:TT
do more stuff
end
end
end
The problem I have is the following: After the second, inner loop is entered, all following simulation periods take longer to execute, even when the condition does not hold. I have gone into debug mode and can 100% confirm that the second loop is not entered in other simulation periods. Nevertheless those periods take longer to execute after the second loop has been entered once in a previous period.
Additionally, if i pause the execution of the script manually after the second loop has been entered and exited again and then continue, the script speeds back up and the rest of the periods are simulated at the usual speed. More generally, I often find that if a script runs slowly I can speed it up significantly by pausing and unpausing.
Does anyone know what might be causing this?
PS: After some additonal experimentation it seems that this phenomenon only occurs if I click the pause button in the GUI, i.e. if I enter debug mode and then pess continue. Simply inserting pause(n) under some condition into the script does not cause this change in execution speeds. I have a question about a strange phenomenon I have been noticing for some time whilst working with Matlab and which has now become somewhat acute.
When I run scripts which are relatively demanding on my computer, pausing and immediately unpausing the execution weirdly appears to speed up the execution of the rest of the script.
The current example is this:
I am running a simulation model, which is essentially just one big loop representing simulation periods . Within this loop there is another loop which is entered only under a certain condition. If this second loop is entered in some simulation period t, the simualtion of this particular period naturally takes longer than that of the other ones as more operations are executed.
Essentially the programm looks like this:
for t=1:T
do stuff
if condition holds
for tt=1:TT
do more stuff
end
end
end
The problem I have is the following: After the second, inner loop is entered, all following simulation periods take longer to execute, even when the condition does not hold. I have gone into debug mode and can 100% confirm that the second loop is not entered in other simulation periods. Nevertheless those periods take longer to execute after the second loop has been entered once in a previous period.
Additionally, if i pause the execution of the script manually after the second loop has been entered and exited again and then continue, the script speeds back up and the rest of the periods are simulated at the usual speed. More generally, I often find that if a script runs slowly I can speed it up significantly by pausing and unpausing.
Does anyone know what might be causing this?
PS: After some additonal experimentation it seems that this phenomenon only occurs if I click the pause button in the GUI, i.e. if I enter debug mode and then pess continue. Simply inserting pause(n) under some condition into the script does not cause this change in execution speeds. execution time, pause, loops MATLAB Answers — New Questions
finding local maximum/minimum for a function
how to find the local extreme values of the function xy-x^2-y^2-2x-2y+4how to find the local extreme values of the function xy-x^2-y^2-2x-2y+4 how to find the local extreme values of the function xy-x^2-y^2-2x-2y+4 matlab, maxima MATLAB Answers — New Questions
How to reduce current ripple in a closed loop buck converter for a PV li-ion battery charger??
If i test the buck converter model alone i get a smooth current and voltage signal,
but when i add the battery and the control logic, the current signal has a very high peak to peak amplitude.
Do you know why us this behavior??
Thanks.If i test the buck converter model alone i get a smooth current and voltage signal,
but when i add the battery and the control logic, the current signal has a very high peak to peak amplitude.
Do you know why us this behavior??
Thanks. If i test the buck converter model alone i get a smooth current and voltage signal,
but when i add the battery and the control logic, the current signal has a very high peak to peak amplitude.
Do you know why us this behavior??
Thanks. li-ion, battery charger, buck converter, solar energy, current ripple, power_electronics_control, battery_system_management MATLAB Answers — New Questions
Passing data by reference to Matlab toolbox functions for code generation
Hello everyone.
I am working on optimization of generated code. My algorithm uses toolbox function interp1 for linear interpolation. Code for it is generated by Matlab embedded coder. I want to prevent copying of input arrays to it. Normally function doesn’t define input argument as in/out, but algorithm doesn’t use them afterwards and copy is redundant. Is there a way to tell Matlab coder about it to do optimization.Hello everyone.
I am working on optimization of generated code. My algorithm uses toolbox function interp1 for linear interpolation. Code for it is generated by Matlab embedded coder. I want to prevent copying of input arrays to it. Normally function doesn’t define input argument as in/out, but algorithm doesn’t use them afterwards and copy is redundant. Is there a way to tell Matlab coder about it to do optimization. Hello everyone.
I am working on optimization of generated code. My algorithm uses toolbox function interp1 for linear interpolation. Code for it is generated by Matlab embedded coder. I want to prevent copying of input arrays to it. Normally function doesn’t define input argument as in/out, but algorithm doesn’t use them afterwards and copy is redundant. Is there a way to tell Matlab coder about it to do optimization. matlab coder, memory, embedded coder MATLAB Answers — New Questions
Can pdepe solve a system of two second-order equations?
I am trying to figure out pdepe and how to use it to solve a higher order equation written as multiple second order equations. Even though I am trying to solve a more complex equation in the future I want to start with a simple case
.
My idea is to rewrite it by including a second variable
where
.
I chose the spatial coordinate to range from x=linsapce(0,2*pi,N) to ensure that my initial conditions satisfy my boundary conditions (see below).
In pdepe terms I wrote
function [c,f,s] = pdex1pde(x,t,u,dudx)
global D
c = [1 ; 0];
f = [D*dudx(2); dudx(1)];
s = [0; -u(2)]; %where q=u(2);
end
and providing some initial condition (from 0 to 2pi)
function u0 = pdex1ic(x)
init = 1-cos(x);
d2init_dx2 = cos(x);
u0 = [init; d2init_dx2]
end
For the boundary conditions I just used a Neumann boundary for each boundary
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)
pl = [0;0];
ql = [1;1];
pr = [0;0];
qr = [1;1];
end
Now pdepe gives me a warning that it could not converge at time t=0 and I don’t get a result.
Is there something that I am missing?
I had a look at other questions about this topic and already stumbled upon this github page (https://github.com/wgreene310/pdepe-examples), but I don’t really understand it without the written equations.
Thank you very much for answering.I am trying to figure out pdepe and how to use it to solve a higher order equation written as multiple second order equations. Even though I am trying to solve a more complex equation in the future I want to start with a simple case
.
My idea is to rewrite it by including a second variable
where
.
I chose the spatial coordinate to range from x=linsapce(0,2*pi,N) to ensure that my initial conditions satisfy my boundary conditions (see below).
In pdepe terms I wrote
function [c,f,s] = pdex1pde(x,t,u,dudx)
global D
c = [1 ; 0];
f = [D*dudx(2); dudx(1)];
s = [0; -u(2)]; %where q=u(2);
end
and providing some initial condition (from 0 to 2pi)
function u0 = pdex1ic(x)
init = 1-cos(x);
d2init_dx2 = cos(x);
u0 = [init; d2init_dx2]
end
For the boundary conditions I just used a Neumann boundary for each boundary
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)
pl = [0;0];
ql = [1;1];
pr = [0;0];
qr = [1;1];
end
Now pdepe gives me a warning that it could not converge at time t=0 and I don’t get a result.
Is there something that I am missing?
I had a look at other questions about this topic and already stumbled upon this github page (https://github.com/wgreene310/pdepe-examples), but I don’t really understand it without the written equations.
Thank you very much for answering. I am trying to figure out pdepe and how to use it to solve a higher order equation written as multiple second order equations. Even though I am trying to solve a more complex equation in the future I want to start with a simple case
.
My idea is to rewrite it by including a second variable
where
.
I chose the spatial coordinate to range from x=linsapce(0,2*pi,N) to ensure that my initial conditions satisfy my boundary conditions (see below).
In pdepe terms I wrote
function [c,f,s] = pdex1pde(x,t,u,dudx)
global D
c = [1 ; 0];
f = [D*dudx(2); dudx(1)];
s = [0; -u(2)]; %where q=u(2);
end
and providing some initial condition (from 0 to 2pi)
function u0 = pdex1ic(x)
init = 1-cos(x);
d2init_dx2 = cos(x);
u0 = [init; d2init_dx2]
end
For the boundary conditions I just used a Neumann boundary for each boundary
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)
pl = [0;0];
ql = [1;1];
pr = [0;0];
qr = [1;1];
end
Now pdepe gives me a warning that it could not converge at time t=0 and I don’t get a result.
Is there something that I am missing?
I had a look at other questions about this topic and already stumbled upon this github page (https://github.com/wgreene310/pdepe-examples), but I don’t really understand it without the written equations.
Thank you very much for answering. pdepe, pde, system of equations MATLAB Answers — New Questions
getrect and ginput are not supported by codegen
Hi guys. I am developing a .DLL using the command "codegen", and in an intermediate process I need to select some data from a plot made by the .DLL, then the operations dependent on this selected data continue. For this I am using the "getrect" and "ginput" functions, however, when compiling the .DLL a message appears saying that these functions are not supported by "codegen". In that sense, is there any other function that is supported by "codegen" that I can use?Hi guys. I am developing a .DLL using the command "codegen", and in an intermediate process I need to select some data from a plot made by the .DLL, then the operations dependent on this selected data continue. For this I am using the "getrect" and "ginput" functions, however, when compiling the .DLL a message appears saying that these functions are not supported by "codegen". In that sense, is there any other function that is supported by "codegen" that I can use? Hi guys. I am developing a .DLL using the command "codegen", and in an intermediate process I need to select some data from a plot made by the .DLL, then the operations dependent on this selected data continue. For this I am using the "getrect" and "ginput" functions, however, when compiling the .DLL a message appears saying that these functions are not supported by "codegen". In that sense, is there any other function that is supported by "codegen" that I can use? codegen, dll MATLAB Answers — New Questions
PAPR (Peak to Average Power Ratio) of OFDM(Orthogonal Frequency Division Multiplexing)
will the PAPR(Peak to Average Power Ratio) of OFDM (Orthogonal Frequency Division Multiplexing) be effected if we use different modulation schemes?
1) effect on PAPR using M-QAM
2) effect on PAPR using M-PSKwill the PAPR(Peak to Average Power Ratio) of OFDM (Orthogonal Frequency Division Multiplexing) be effected if we use different modulation schemes?
1) effect on PAPR using M-QAM
2) effect on PAPR using M-PSK will the PAPR(Peak to Average Power Ratio) of OFDM (Orthogonal Frequency Division Multiplexing) be effected if we use different modulation schemes?
1) effect on PAPR using M-QAM
2) effect on PAPR using M-PSK papr of ofdm, papr (peak to average power ratio) of ofdm(orthogonal frequency division multiplexing) MATLAB Answers — New Questions
Simulink : How to inject real and image current into three phase power grid by using discrete mode powergui
Hello,everyone.
I have trouble when I setting real and image current respectly and inject them to infinite bus.
I need to use powergui in discrete phasor mode to simulate the system,but I want to use powergui in discrete mode.
Is this possible to inject real and image current into three phase power system by powergui in discrete mode?
Thank you for your reply!!Hello,everyone.
I have trouble when I setting real and image current respectly and inject them to infinite bus.
I need to use powergui in discrete phasor mode to simulate the system,but I want to use powergui in discrete mode.
Is this possible to inject real and image current into three phase power system by powergui in discrete mode?
Thank you for your reply!! Hello,everyone.
I have trouble when I setting real and image current respectly and inject them to infinite bus.
I need to use powergui in discrete phasor mode to simulate the system,but I want to use powergui in discrete mode.
Is this possible to inject real and image current into three phase power system by powergui in discrete mode?
Thank you for your reply!! simscape, simulink MATLAB Answers — New Questions
Problem with mvregress when working with cell arrays
Hi,
I have a problem when using multivariate regression function (mvregress) available in matlab.
I have a cell array with 20 cells in each of which there are three values as inputs and my target output is a vector with 20 values. When I load this data and call mvregress function, it gives the error: "Undefined function ‘isnan’ for input arguments of type ‘cell’."
To eliminate this problem I tried using: data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But this makes all my values zero.
My code is given below:
load mywork1.mat
[beta,Sigma, resid] = mvregress(targetvalues’,originaldata)
Since it gives the error ("Undefined function ‘isnan’ for input arguments of type ‘cell’."), I tried the following
data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But then all my data cells are replaced with zeros.
How can I resolve this issue and perform multivariate regression on these data?
I have attached the data set.
Thank you in advance.Hi,
I have a problem when using multivariate regression function (mvregress) available in matlab.
I have a cell array with 20 cells in each of which there are three values as inputs and my target output is a vector with 20 values. When I load this data and call mvregress function, it gives the error: "Undefined function ‘isnan’ for input arguments of type ‘cell’."
To eliminate this problem I tried using: data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But this makes all my values zero.
My code is given below:
load mywork1.mat
[beta,Sigma, resid] = mvregress(targetvalues’,originaldata)
Since it gives the error ("Undefined function ‘isnan’ for input arguments of type ‘cell’."), I tried the following
data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But then all my data cells are replaced with zeros.
How can I resolve this issue and perform multivariate regression on these data?
I have attached the data set.
Thank you in advance. Hi,
I have a problem when using multivariate regression function (mvregress) available in matlab.
I have a cell array with 20 cells in each of which there are three values as inputs and my target output is a vector with 20 values. When I load this data and call mvregress function, it gives the error: "Undefined function ‘isnan’ for input arguments of type ‘cell’."
To eliminate this problem I tried using: data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But this makes all my values zero.
My code is given below:
load mywork1.mat
[beta,Sigma, resid] = mvregress(targetvalues’,originaldata)
Since it gives the error ("Undefined function ‘isnan’ for input arguments of type ‘cell’."), I tried the following
data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But then all my data cells are replaced with zeros.
How can I resolve this issue and perform multivariate regression on these data?
I have attached the data set.
Thank you in advance. regression, mvregress, isnan MATLAB Answers — New Questions
error in downloading trial version
following statement appears again and again after retry
The following error was detected while downloading foundation/httpproxy_win64_1550744841.enc:
Wrong number of bytes: Expected 74382, got 5291following statement appears again and again after retry
The following error was detected while downloading foundation/httpproxy_win64_1550744841.enc:
Wrong number of bytes: Expected 74382, got 5291 following statement appears again and again after retry
The following error was detected while downloading foundation/httpproxy_win64_1550744841.enc:
Wrong number of bytes: Expected 74382, got 5291 trial version, student version, wrong number of bytes MATLAB Answers — New Questions
Can’t get ‘ValueChangedFcn’ callback to work for ‘uidatepicker ‘
Hi,
I’m would like to have a date picker window on my main app window, and I’d like something to happen whenever the date is changed. The help file says I can call a function using the ‘ValueChangedFcn’ callback, but I can’t get it to work. This is the relevant piece of code:
methods (Access = private)
function test(app)
uialert(app.UIFigure, ‘It works!’, ‘It works!’, ‘Icon’,’help’);
end
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
uidatepicker(app.UIFigure, ‘Position’, [780 350 100 22], ‘ValueChangedFcn’, test(app))
I get this error message – Error using app1/test
Too many output arguments.
Error in app1 (line 431)
runStartupFcn(app, @startupFcn)
Any ideas?Hi,
I’m would like to have a date picker window on my main app window, and I’d like something to happen whenever the date is changed. The help file says I can call a function using the ‘ValueChangedFcn’ callback, but I can’t get it to work. This is the relevant piece of code:
methods (Access = private)
function test(app)
uialert(app.UIFigure, ‘It works!’, ‘It works!’, ‘Icon’,’help’);
end
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
uidatepicker(app.UIFigure, ‘Position’, [780 350 100 22], ‘ValueChangedFcn’, test(app))
I get this error message – Error using app1/test
Too many output arguments.
Error in app1 (line 431)
runStartupFcn(app, @startupFcn)
Any ideas? Hi,
I’m would like to have a date picker window on my main app window, and I’d like something to happen whenever the date is changed. The help file says I can call a function using the ‘ValueChangedFcn’ callback, but I can’t get it to work. This is the relevant piece of code:
methods (Access = private)
function test(app)
uialert(app.UIFigure, ‘It works!’, ‘It works!’, ‘Icon’,’help’);
end
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
uidatepicker(app.UIFigure, ‘Position’, [780 350 100 22], ‘ValueChangedFcn’, test(app))
I get this error message – Error using app1/test
Too many output arguments.
Error in app1 (line 431)
runStartupFcn(app, @startupFcn)
Any ideas? valuechangedfcn, uidatepicker MATLAB Answers — New Questions
How to click into the heatmap created inside a UI panel?
I’m working on building an interactive Heatmap in Matlab UI. added a UI Panel to the interface and populated the heatmap within the panel. Now that I know how to get the row and column upon clicking the Heatmap cell, the issue now is I’m not able to actually click into the heatmap within the UI Panel. I tried using the “WindowButtonDownFcn”, but was only able to click into any blank area within the UI Panel. Once I click on the heatmap in the UI panel, there is no response at all.
May I know how I could click into the heatmap created inside the UI Panel? Thanks!I’m working on building an interactive Heatmap in Matlab UI. added a UI Panel to the interface and populated the heatmap within the panel. Now that I know how to get the row and column upon clicking the Heatmap cell, the issue now is I’m not able to actually click into the heatmap within the UI Panel. I tried using the “WindowButtonDownFcn”, but was only able to click into any blank area within the UI Panel. Once I click on the heatmap in the UI panel, there is no response at all.
May I know how I could click into the heatmap created inside the UI Panel? Thanks! I’m working on building an interactive Heatmap in Matlab UI. added a UI Panel to the interface and populated the heatmap within the panel. Now that I know how to get the row and column upon clicking the Heatmap cell, the issue now is I’m not able to actually click into the heatmap within the UI Panel. I tried using the “WindowButtonDownFcn”, but was only able to click into any blank area within the UI Panel. Once I click on the heatmap in the UI panel, there is no response at all.
May I know how I could click into the heatmap created inside the UI Panel? Thanks! heatmap, appdesigner, matlab gui MATLAB Answers — New Questions
how to recombine blocks of an image into one?
Dear sir,
I am working on Watermarking. I divided a color host image into blocks using mat2cell. i hid watermark images in respective blocks. i wanted to know how i can recombine the watermarked blocks?Dear sir,
I am working on Watermarking. I divided a color host image into blocks using mat2cell. i hid watermark images in respective blocks. i wanted to know how i can recombine the watermarked blocks? Dear sir,
I am working on Watermarking. I divided a color host image into blocks using mat2cell. i hid watermark images in respective blocks. i wanted to know how i can recombine the watermarked blocks? watermarking, mat2cell MATLAB Answers — New Questions