Category: Matlab
Category Archives: Matlab
Rainflow Algorithm needs 3 samples
Hi,
I want to use the build-in rainflow(x,fs) algorithm to calculate the cycles a battery model has run by using it on the State of Charge (&) of the cell. When I try to use the algorithm on the SoC (see picture) I get the following error:
Input time series must have at least 3 samples.
But I set a sample rate fs and as you can see in the picture there is also enough data.
Anyone knows why?Hi,
I want to use the build-in rainflow(x,fs) algorithm to calculate the cycles a battery model has run by using it on the State of Charge (&) of the cell. When I try to use the algorithm on the SoC (see picture) I get the following error:
Input time series must have at least 3 samples.
But I set a sample rate fs and as you can see in the picture there is also enough data.
Anyone knows why? Hi,
I want to use the build-in rainflow(x,fs) algorithm to calculate the cycles a battery model has run by using it on the State of Charge (&) of the cell. When I try to use the algorithm on the SoC (see picture) I get the following error:
Input time series must have at least 3 samples.
But I set a sample rate fs and as you can see in the picture there is also enough data.
Anyone knows why? rainflow, battery MATLAB Answers — New Questions
Monitor and Tune PX4 Host Target Flight Controller with Simulink-Based Plant Model: Mismatched TCP Node
Hi, I’m following the Tutorial here and I’m getting stuck at the last step where the two MATLAB instances are failing to communicate with each other presumably due to mismatched TCP ports. I can’t determine where I may be able to set what ports to sned/receive from.
The following is the Simulink diagnostics output for the first MATLAB instance where I am running PX4Demo_FlightController_top
Updating Model Reference Code Generation Targets
### Starting serial model reference code generation build.
Building FlightController
### Checking status of model reference code generation target for model ‘FlightController’ used in ‘px4Demo_FlightController_top’.
### Model reference code generation target (FlightController.cpp) for model FlightController must be recompiled because FlightController.cpp changed since last build, or it was not compiled.
### Starting build procedure for: FlightController
### Generating code and artifacts to ‘Model specific’ folder structure
### Code for the model reference code generation target for model FlightController is up to date because no functional changes were found in referenced model.
Removing old px4_simulink_app directory: /home/USERNAME/Documents/PX4_Source/Firmware/src/modules/px4_simulink_app.
### Successful completion of build procedure for: FlightController
### Model reference code generation target for FlightController is up to date.
Top Model Build
### Starting build procedure for: px4Demo_FlightController_top
### Generating code and artifacts to ‘Model specific’ folder structure
### Generating code into build folder: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/px4Demo_FlightController_top_ert_rtw
Warning: The Simulink model contains a PX4 PWM Output block and the algorithm to be designed is set as "Design Path Follower in Simulink".
The PWM block output might conflict with the PWM values generated by the default PX4 Controllers in this case.
### Generated code for ‘px4Demo_FlightController_top’ is up to date because no structural, parameter or code replacement library changes were found.
### Saving binary information cache.
Removing old px4_simulink_app directory: /home/USERNAME/Documents/PX4_Source/Firmware/src/modules/px4_simulink_app.
Build path: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/px4Demo_FlightController_top_ert_rtw
### Successful completion of build procedure for: px4Demo_FlightController_top
Build process completed successfully
Build Summary
0 of 2 models built (2 models already up to date)
Build duration: 0h 0m 18.507s
action: EXT_INIT
Creating Target Handler (XCP on TCP/IP)…
Build directory: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/px4Demo_FlightController_top_ert_rtw
Target name: 127.0.0.1
Target port: 17725
Warning: The Simulink model contains a PX4 PWM Output block and the algorithm to be designed is set as "Design Path Follower in Simulink".
The PWM block output might conflict with the PWM values generated by the default PX4 Controllers in this case.
### Starting serial model reference code generation build.
### Checking status of model reference code generation target for model ‘FlightController’ used in ‘px4Demo_FlightController_top’.
### Model reference code generation target (FlightController.cpp) for model FlightController must be recompiled because FlightController.cpp changed since last build, or it was not compiled.
### Starting build procedure for: FlightController
### Generating code and artifacts to ‘Model specific’ folder structure
### Checking the status of code in build folder: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/slprj/ert/FlightController
### Code for the model reference code generation target for model FlightController is up to date because no functional changes were found in referenced model.
Removing old px4_simulink_app directory: /home/USERNAME/Documents/PX4_Source/Firmware/src/modules/px4_simulink_app.
### Successful completion of build procedure for: FlightController
### Model reference code generation target for FlightController is up to date.
Build Summary
0 of 1 models built (1 models already up to date)
Build duration: 0h 0m 3.612s
For referenced models, external mode simulations do not support the following:
The use of blocks to view signals from the target application.
Tuning or uploading of model parameters.
Component:Simulink | Category:Model warning
action: EXT_CONNECT
Connecting to the target…
External Mode Open Protocol Connect command failed
Caused by:
Could not connect to target application: XCP TCP/IP error: Connect failed
Component:Simulink | Category:Block diagram error
Unable to connect to the ‘PX4 Host Target’ target for ‘px4Demo_FlightController_top’.
As you might be able to tell, the code generation and compilation works just fine and I get the popup window saying that "the monitor and tune build is complete". The problematic bit I want to highlight is "Target port: 17725", which is in contrast with the port 4560 specified in Quad_Plant_top.slx. Here is the Simulink Diagnostics output from the Second MATLAB instance where I am running Quad_Plant_top:
An error occurred while running the simulation and the simulation was terminated
Caused by:
MATLAB System block ‘Quad_Plant_top/MATLAB System1’ error occurred when invoking ‘stepImpl’ method of ‘px4HostTarget_TCPIP_Write’. The error was thrown from ‘
‘/home/USERNAME/Documents/MATLAB/SupportPackages/R2022b/toolbox/target/supportpackages/px4/px4examples/exampleTCPFiles/px4HostTarget_TCPIP_Write.m’ at line 42′.
Failed to write from the server. A TCP/IP client must be connected to the server.
Am I just timing things wrong when starting one and resuming (hitting "ok") on the other? Or is there perhaps some setup step I may have forgotten? I could use some guidance.
I am on Ubuntu 18.04.6, using MATLAB/Simulink 2022b, and PX4 firmware v1.12.3.Hi, I’m following the Tutorial here and I’m getting stuck at the last step where the two MATLAB instances are failing to communicate with each other presumably due to mismatched TCP ports. I can’t determine where I may be able to set what ports to sned/receive from.
The following is the Simulink diagnostics output for the first MATLAB instance where I am running PX4Demo_FlightController_top
Updating Model Reference Code Generation Targets
### Starting serial model reference code generation build.
Building FlightController
### Checking status of model reference code generation target for model ‘FlightController’ used in ‘px4Demo_FlightController_top’.
### Model reference code generation target (FlightController.cpp) for model FlightController must be recompiled because FlightController.cpp changed since last build, or it was not compiled.
### Starting build procedure for: FlightController
### Generating code and artifacts to ‘Model specific’ folder structure
### Code for the model reference code generation target for model FlightController is up to date because no functional changes were found in referenced model.
Removing old px4_simulink_app directory: /home/USERNAME/Documents/PX4_Source/Firmware/src/modules/px4_simulink_app.
### Successful completion of build procedure for: FlightController
### Model reference code generation target for FlightController is up to date.
Top Model Build
### Starting build procedure for: px4Demo_FlightController_top
### Generating code and artifacts to ‘Model specific’ folder structure
### Generating code into build folder: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/px4Demo_FlightController_top_ert_rtw
Warning: The Simulink model contains a PX4 PWM Output block and the algorithm to be designed is set as "Design Path Follower in Simulink".
The PWM block output might conflict with the PWM values generated by the default PX4 Controllers in this case.
### Generated code for ‘px4Demo_FlightController_top’ is up to date because no structural, parameter or code replacement library changes were found.
### Saving binary information cache.
Removing old px4_simulink_app directory: /home/USERNAME/Documents/PX4_Source/Firmware/src/modules/px4_simulink_app.
Build path: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/px4Demo_FlightController_top_ert_rtw
### Successful completion of build procedure for: px4Demo_FlightController_top
Build process completed successfully
Build Summary
0 of 2 models built (2 models already up to date)
Build duration: 0h 0m 18.507s
action: EXT_INIT
Creating Target Handler (XCP on TCP/IP)…
Build directory: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/px4Demo_FlightController_top_ert_rtw
Target name: 127.0.0.1
Target port: 17725
Warning: The Simulink model contains a PX4 PWM Output block and the algorithm to be designed is set as "Design Path Follower in Simulink".
The PWM block output might conflict with the PWM values generated by the default PX4 Controllers in this case.
### Starting serial model reference code generation build.
### Checking status of model reference code generation target for model ‘FlightController’ used in ‘px4Demo_FlightController_top’.
### Model reference code generation target (FlightController.cpp) for model FlightController must be recompiled because FlightController.cpp changed since last build, or it was not compiled.
### Starting build procedure for: FlightController
### Generating code and artifacts to ‘Model specific’ folder structure
### Checking the status of code in build folder: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/slprj/ert/FlightController
### Code for the model reference code generation target for model FlightController is up to date because no functional changes were found in referenced model.
Removing old px4_simulink_app directory: /home/USERNAME/Documents/PX4_Source/Firmware/src/modules/px4_simulink_app.
### Successful completion of build procedure for: FlightController
### Model reference code generation target for FlightController is up to date.
Build Summary
0 of 1 models built (1 models already up to date)
Build duration: 0h 0m 3.612s
For referenced models, external mode simulations do not support the following:
The use of blocks to view signals from the target application.
Tuning or uploading of model parameters.
Component:Simulink | Category:Model warning
action: EXT_CONNECT
Connecting to the target…
External Mode Open Protocol Connect command failed
Caused by:
Could not connect to target application: XCP TCP/IP error: Connect failed
Component:Simulink | Category:Block diagram error
Unable to connect to the ‘PX4 Host Target’ target for ‘px4Demo_FlightController_top’.
As you might be able to tell, the code generation and compilation works just fine and I get the popup window saying that "the monitor and tune build is complete". The problematic bit I want to highlight is "Target port: 17725", which is in contrast with the port 4560 specified in Quad_Plant_top.slx. Here is the Simulink Diagnostics output from the Second MATLAB instance where I am running Quad_Plant_top:
An error occurred while running the simulation and the simulation was terminated
Caused by:
MATLAB System block ‘Quad_Plant_top/MATLAB System1’ error occurred when invoking ‘stepImpl’ method of ‘px4HostTarget_TCPIP_Write’. The error was thrown from ‘
‘/home/USERNAME/Documents/MATLAB/SupportPackages/R2022b/toolbox/target/supportpackages/px4/px4examples/exampleTCPFiles/px4HostTarget_TCPIP_Write.m’ at line 42′.
Failed to write from the server. A TCP/IP client must be connected to the server.
Am I just timing things wrong when starting one and resuming (hitting "ok") on the other? Or is there perhaps some setup step I may have forgotten? I could use some guidance.
I am on Ubuntu 18.04.6, using MATLAB/Simulink 2022b, and PX4 firmware v1.12.3. Hi, I’m following the Tutorial here and I’m getting stuck at the last step where the two MATLAB instances are failing to communicate with each other presumably due to mismatched TCP ports. I can’t determine where I may be able to set what ports to sned/receive from.
The following is the Simulink diagnostics output for the first MATLAB instance where I am running PX4Demo_FlightController_top
Updating Model Reference Code Generation Targets
### Starting serial model reference code generation build.
Building FlightController
### Checking status of model reference code generation target for model ‘FlightController’ used in ‘px4Demo_FlightController_top’.
### Model reference code generation target (FlightController.cpp) for model FlightController must be recompiled because FlightController.cpp changed since last build, or it was not compiled.
### Starting build procedure for: FlightController
### Generating code and artifacts to ‘Model specific’ folder structure
### Code for the model reference code generation target for model FlightController is up to date because no functional changes were found in referenced model.
Removing old px4_simulink_app directory: /home/USERNAME/Documents/PX4_Source/Firmware/src/modules/px4_simulink_app.
### Successful completion of build procedure for: FlightController
### Model reference code generation target for FlightController is up to date.
Top Model Build
### Starting build procedure for: px4Demo_FlightController_top
### Generating code and artifacts to ‘Model specific’ folder structure
### Generating code into build folder: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/px4Demo_FlightController_top_ert_rtw
Warning: The Simulink model contains a PX4 PWM Output block and the algorithm to be designed is set as "Design Path Follower in Simulink".
The PWM block output might conflict with the PWM values generated by the default PX4 Controllers in this case.
### Generated code for ‘px4Demo_FlightController_top’ is up to date because no structural, parameter or code replacement library changes were found.
### Saving binary information cache.
Removing old px4_simulink_app directory: /home/USERNAME/Documents/PX4_Source/Firmware/src/modules/px4_simulink_app.
Build path: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/px4Demo_FlightController_top_ert_rtw
### Successful completion of build procedure for: px4Demo_FlightController_top
Build process completed successfully
Build Summary
0 of 2 models built (2 models already up to date)
Build duration: 0h 0m 18.507s
action: EXT_INIT
Creating Target Handler (XCP on TCP/IP)…
Build directory: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/px4Demo_FlightController_top_ert_rtw
Target name: 127.0.0.1
Target port: 17725
Warning: The Simulink model contains a PX4 PWM Output block and the algorithm to be designed is set as "Design Path Follower in Simulink".
The PWM block output might conflict with the PWM values generated by the default PX4 Controllers in this case.
### Starting serial model reference code generation build.
### Checking status of model reference code generation target for model ‘FlightController’ used in ‘px4Demo_FlightController_top’.
### Model reference code generation target (FlightController.cpp) for model FlightController must be recompiled because FlightController.cpp changed since last build, or it was not compiled.
### Starting build procedure for: FlightController
### Generating code and artifacts to ‘Model specific’ folder structure
### Checking the status of code in build folder: /home/USERNAME/MATLAB/Projects/examples/Px4DemoHostTargetWithSimulinkPlant6/work/code/slprj/ert/FlightController
### Code for the model reference code generation target for model FlightController is up to date because no functional changes were found in referenced model.
Removing old px4_simulink_app directory: /home/USERNAME/Documents/PX4_Source/Firmware/src/modules/px4_simulink_app.
### Successful completion of build procedure for: FlightController
### Model reference code generation target for FlightController is up to date.
Build Summary
0 of 1 models built (1 models already up to date)
Build duration: 0h 0m 3.612s
For referenced models, external mode simulations do not support the following:
The use of blocks to view signals from the target application.
Tuning or uploading of model parameters.
Component:Simulink | Category:Model warning
action: EXT_CONNECT
Connecting to the target…
External Mode Open Protocol Connect command failed
Caused by:
Could not connect to target application: XCP TCP/IP error: Connect failed
Component:Simulink | Category:Block diagram error
Unable to connect to the ‘PX4 Host Target’ target for ‘px4Demo_FlightController_top’.
As you might be able to tell, the code generation and compilation works just fine and I get the popup window saying that "the monitor and tune build is complete". The problematic bit I want to highlight is "Target port: 17725", which is in contrast with the port 4560 specified in Quad_Plant_top.slx. Here is the Simulink Diagnostics output from the Second MATLAB instance where I am running Quad_Plant_top:
An error occurred while running the simulation and the simulation was terminated
Caused by:
MATLAB System block ‘Quad_Plant_top/MATLAB System1’ error occurred when invoking ‘stepImpl’ method of ‘px4HostTarget_TCPIP_Write’. The error was thrown from ‘
‘/home/USERNAME/Documents/MATLAB/SupportPackages/R2022b/toolbox/target/supportpackages/px4/px4examples/exampleTCPFiles/px4HostTarget_TCPIP_Write.m’ at line 42′.
Failed to write from the server. A TCP/IP client must be connected to the server.
Am I just timing things wrong when starting one and resuming (hitting "ok") on the other? Or is there perhaps some setup step I may have forgotten? I could use some guidance.
I am on Ubuntu 18.04.6, using MATLAB/Simulink 2022b, and PX4 firmware v1.12.3. px4 MATLAB Answers — New Questions
Use sfit object for multiobjective optimization
Hello everybody,
I want to solve an optimization problem regarding 3 objectives and 2 variables. The data that needs to be optimized may differ dependant on the users input.
My approach was to first generate arrays or vectors that hold the in- and output data. I can now generate 3 surface fit (sfit) objects for every objective that needs to be optimized. The gamultibj algorithm now suggests that I use these functions to create a fitness function, which then will be optimized. However I dont understand how I can create a useable fitness function out of the previously generated sfit objects. To me it seems the gamultiobj algorithm only wirks with a "hard coded" fitness function.
Relevant Code:
% v_n_ges / v_n_P holds all variables
% v_EW / v_T_med and v_K_med holds all objectives
% generate functions to optimize
EW_fit = fit([v_n_ges, v_n_P], v_EW, ‘poly22’);
T_med_fit = fit([v_n_ges, v_n_P], v_T_med, ‘poly22’);
K_med_fit = fit([v_n_ges, v_n_P], v_K_med, ‘poly22’);
% Multiobjective Optimization via fitness function
fitnessfcn = @Fitnessfcn;
numberOfVariables = 3;
[x, fval] = gamultiobj(fitnessfcn, numberOfVariables);
%% Generate fitness function (in progress)
function f = Fitnessfcn (x) % The fitness function would need an input row vector size 2 containing n_ges and n_P
% but also the sfit objects
% Allocate output
f = zeros(1,3);
f(1) = @EW_fit;
f(2) = @T_med_fit;
f(3) = @K_med_fit;
end
Also I was wondering if there is any way to skip the "sfit-step" and just directly work with the vectors/arrays.
Thanks in advance for your support and with best regardsHello everybody,
I want to solve an optimization problem regarding 3 objectives and 2 variables. The data that needs to be optimized may differ dependant on the users input.
My approach was to first generate arrays or vectors that hold the in- and output data. I can now generate 3 surface fit (sfit) objects for every objective that needs to be optimized. The gamultibj algorithm now suggests that I use these functions to create a fitness function, which then will be optimized. However I dont understand how I can create a useable fitness function out of the previously generated sfit objects. To me it seems the gamultiobj algorithm only wirks with a "hard coded" fitness function.
Relevant Code:
% v_n_ges / v_n_P holds all variables
% v_EW / v_T_med and v_K_med holds all objectives
% generate functions to optimize
EW_fit = fit([v_n_ges, v_n_P], v_EW, ‘poly22’);
T_med_fit = fit([v_n_ges, v_n_P], v_T_med, ‘poly22’);
K_med_fit = fit([v_n_ges, v_n_P], v_K_med, ‘poly22’);
% Multiobjective Optimization via fitness function
fitnessfcn = @Fitnessfcn;
numberOfVariables = 3;
[x, fval] = gamultiobj(fitnessfcn, numberOfVariables);
%% Generate fitness function (in progress)
function f = Fitnessfcn (x) % The fitness function would need an input row vector size 2 containing n_ges and n_P
% but also the sfit objects
% Allocate output
f = zeros(1,3);
f(1) = @EW_fit;
f(2) = @T_med_fit;
f(3) = @K_med_fit;
end
Also I was wondering if there is any way to skip the "sfit-step" and just directly work with the vectors/arrays.
Thanks in advance for your support and with best regards Hello everybody,
I want to solve an optimization problem regarding 3 objectives and 2 variables. The data that needs to be optimized may differ dependant on the users input.
My approach was to first generate arrays or vectors that hold the in- and output data. I can now generate 3 surface fit (sfit) objects for every objective that needs to be optimized. The gamultibj algorithm now suggests that I use these functions to create a fitness function, which then will be optimized. However I dont understand how I can create a useable fitness function out of the previously generated sfit objects. To me it seems the gamultiobj algorithm only wirks with a "hard coded" fitness function.
Relevant Code:
% v_n_ges / v_n_P holds all variables
% v_EW / v_T_med and v_K_med holds all objectives
% generate functions to optimize
EW_fit = fit([v_n_ges, v_n_P], v_EW, ‘poly22’);
T_med_fit = fit([v_n_ges, v_n_P], v_T_med, ‘poly22’);
K_med_fit = fit([v_n_ges, v_n_P], v_K_med, ‘poly22’);
% Multiobjective Optimization via fitness function
fitnessfcn = @Fitnessfcn;
numberOfVariables = 3;
[x, fval] = gamultiobj(fitnessfcn, numberOfVariables);
%% Generate fitness function (in progress)
function f = Fitnessfcn (x) % The fitness function would need an input row vector size 2 containing n_ges and n_P
% but also the sfit objects
% Allocate output
f = zeros(1,3);
f(1) = @EW_fit;
f(2) = @T_med_fit;
f(3) = @K_med_fit;
end
Also I was wondering if there is any way to skip the "sfit-step" and just directly work with the vectors/arrays.
Thanks in advance for your support and with best regards sfit, gamultiobj, multiobjective optimization MATLAB Answers — New Questions
The filtfilt function is different in different versions
When I used filtfilt in version R2019b, I had to use input data in double format, but in version R2024, functions can recognize data in single format.But when I increased the order of the filter from second to third order, it became clear that the single format version produced the wrong result, and the result using the double version is still right.
I want to know why, please help me.When I used filtfilt in version R2019b, I had to use input data in double format, but in version R2024, functions can recognize data in single format.But when I increased the order of the filter from second to third order, it became clear that the single format version produced the wrong result, and the result using the double version is still right.
I want to know why, please help me. When I used filtfilt in version R2019b, I had to use input data in double format, but in version R2024, functions can recognize data in single format.But when I increased the order of the filter from second to third order, it became clear that the single format version produced the wrong result, and the result using the double version is still right.
I want to know why, please help me. filtfilt, matlab, lowpass MATLAB Answers — New Questions
How can I solve this error message? ” The generated code exceeds the available memory on the processor. It uses 12.1% of available program memory and 186.6% of available Data memory.”
We are doing the simulink with arduino and chage the fft.
Our simulink cording is this photo.
But When we start Simulink We can’t solve this error message "
The generated code exceeds the available memory on the processor. It uses 12.1% of available program memory and 186.6% of available Data memory."
Please…We are doing the simulink with arduino and chage the fft.
Our simulink cording is this photo.
But When we start Simulink We can’t solve this error message "
The generated code exceeds the available memory on the processor. It uses 12.1% of available program memory and 186.6% of available Data memory."
Please… We are doing the simulink with arduino and chage the fft.
Our simulink cording is this photo.
But When we start Simulink We can’t solve this error message "
The generated code exceeds the available memory on the processor. It uses 12.1% of available program memory and 186.6% of available Data memory."
Please… fft MATLAB Answers — New Questions
create a 3D average curve from two 3D curves
I have curves M1 and M2 composed of x nodes in space.
Is it possible to create an average curve (up to a specific height, from bottom to top – red curve) as in the figure?
load M1_and_M2.mat
figure
plot3(M1(:,1),M1(:,2),M1(:,3),’mo’,’Markersize’,4);
hold on
plot3(M2(:,1),M2(:,2),M2(:,3),’go’,’Markersize’,4);
hold off
axis equal
xlabel(‘x’)
ylabel(‘y’)
zlabel(‘z’)
grid offI have curves M1 and M2 composed of x nodes in space.
Is it possible to create an average curve (up to a specific height, from bottom to top – red curve) as in the figure?
load M1_and_M2.mat
figure
plot3(M1(:,1),M1(:,2),M1(:,3),’mo’,’Markersize’,4);
hold on
plot3(M2(:,1),M2(:,2),M2(:,3),’go’,’Markersize’,4);
hold off
axis equal
xlabel(‘x’)
ylabel(‘y’)
zlabel(‘z’)
grid off I have curves M1 and M2 composed of x nodes in space.
Is it possible to create an average curve (up to a specific height, from bottom to top – red curve) as in the figure?
load M1_and_M2.mat
figure
plot3(M1(:,1),M1(:,2),M1(:,3),’mo’,’Markersize’,4);
hold on
plot3(M2(:,1),M2(:,2),M2(:,3),’go’,’Markersize’,4);
hold off
axis equal
xlabel(‘x’)
ylabel(‘y’)
zlabel(‘z’)
grid off curve, nodes, average, mean, 3d plots, 3d, interpolation, interp MATLAB Answers — New Questions
Why does my Frequency Division Multiplexer demultiplex to negative and not the message signal?
Hi,
I’m working on a project that involves on the practice of communication techniques, designed in simulink. I’m trying to design a Frequency Divison Multiplexer that multiplex 3 modulated signals (AM modulated signals), then demultiplex to obtain the original signals back. However, when designing the demodulation circuit to remove the carrier signal, I’m not sure why its giving a negative amplitude and not the orginal message signals.
I’m confused if its my demodulation circuit or its just the characeristic of an Frequency Divison Multiplexer.
Note: From the multiplexer and modulation, there aren’t any issues as its responding with the correct waveform of modulation and multiplex form.
Perameters:
Input 1 – 1volt, 100Hz message, 3kHz carrier, Sine
input 2 – 1volt, 150Hz message, 2.5Khz Carrier, Sine
input 3 – 1volt, 50Hz message, 1.2Khz Carrier, Sine
Saturation (for all) – 0 lower limit, 3 upper limit
Filter Desginer1 – Butterworth, Lowpass, filter order 3, pass band 3kHz
Filter Designer2 – Butterworth, Low pass, filter order 3, pass band 2.5kHz
Filter Designer3 – Butterworth, Low pass, filter order 3, pass band 1.2Khz
Constant (for all) = -0.3055
Figure 1: Circuit Diagram of Demultiplexer & Demodulation
Figure 2: Scope from the Demultiplex, saturation then the Low Pass Filter Output from order.
Figure 2: scope output from the demodulation stage of the cirucitHi,
I’m working on a project that involves on the practice of communication techniques, designed in simulink. I’m trying to design a Frequency Divison Multiplexer that multiplex 3 modulated signals (AM modulated signals), then demultiplex to obtain the original signals back. However, when designing the demodulation circuit to remove the carrier signal, I’m not sure why its giving a negative amplitude and not the orginal message signals.
I’m confused if its my demodulation circuit or its just the characeristic of an Frequency Divison Multiplexer.
Note: From the multiplexer and modulation, there aren’t any issues as its responding with the correct waveform of modulation and multiplex form.
Perameters:
Input 1 – 1volt, 100Hz message, 3kHz carrier, Sine
input 2 – 1volt, 150Hz message, 2.5Khz Carrier, Sine
input 3 – 1volt, 50Hz message, 1.2Khz Carrier, Sine
Saturation (for all) – 0 lower limit, 3 upper limit
Filter Desginer1 – Butterworth, Lowpass, filter order 3, pass band 3kHz
Filter Designer2 – Butterworth, Low pass, filter order 3, pass band 2.5kHz
Filter Designer3 – Butterworth, Low pass, filter order 3, pass band 1.2Khz
Constant (for all) = -0.3055
Figure 1: Circuit Diagram of Demultiplexer & Demodulation
Figure 2: Scope from the Demultiplex, saturation then the Low Pass Filter Output from order.
Figure 2: scope output from the demodulation stage of the cirucit Hi,
I’m working on a project that involves on the practice of communication techniques, designed in simulink. I’m trying to design a Frequency Divison Multiplexer that multiplex 3 modulated signals (AM modulated signals), then demultiplex to obtain the original signals back. However, when designing the demodulation circuit to remove the carrier signal, I’m not sure why its giving a negative amplitude and not the orginal message signals.
I’m confused if its my demodulation circuit or its just the characeristic of an Frequency Divison Multiplexer.
Note: From the multiplexer and modulation, there aren’t any issues as its responding with the correct waveform of modulation and multiplex form.
Perameters:
Input 1 – 1volt, 100Hz message, 3kHz carrier, Sine
input 2 – 1volt, 150Hz message, 2.5Khz Carrier, Sine
input 3 – 1volt, 50Hz message, 1.2Khz Carrier, Sine
Saturation (for all) – 0 lower limit, 3 upper limit
Filter Desginer1 – Butterworth, Lowpass, filter order 3, pass band 3kHz
Filter Designer2 – Butterworth, Low pass, filter order 3, pass band 2.5kHz
Filter Designer3 – Butterworth, Low pass, filter order 3, pass band 1.2Khz
Constant (for all) = -0.3055
Figure 1: Circuit Diagram of Demultiplexer & Demodulation
Figure 2: Scope from the Demultiplex, saturation then the Low Pass Filter Output from order.
Figure 2: scope output from the demodulation stage of the cirucit simulink, matlab, communication, filter MATLAB Answers — New Questions
Is it possible to change the Matlab preferences outside the MATLAB?
I would like to change the preferences outside the MATLAB which means that I do not want to open the MATLAB and change the preferences. Is there any way to do so?
I also have additional few questions :
Is it possible to replace the entire ML Preferences file before starting ML?
Where is the ML Preference file located?I would like to change the preferences outside the MATLAB which means that I do not want to open the MATLAB and change the preferences. Is there any way to do so?
I also have additional few questions :
Is it possible to replace the entire ML Preferences file before starting ML?
Where is the ML Preference file located? I would like to change the preferences outside the MATLAB which means that I do not want to open the MATLAB and change the preferences. Is there any way to do so?
I also have additional few questions :
Is it possible to replace the entire ML Preferences file before starting ML?
Where is the ML Preference file located? matlab MATLAB Answers — New Questions
Calculate total heat loss by conduction given temperature and depth profile vectors
Hi all,
I need to solve this problem in Matlab. I have a hot body placed over cold ground, this having a thermal conductivity k = 1.
I need to estimate the total heat loss by conduction into the substratum at each timestep.
For each of these timesteps I have a temperature profile and the associated vertical profile at 1cm intervals (see .mat files attached).
How can I estimate the total heat loss (w/m2) at each time interval (i.e., the heat loss for every profile)?
Any help woud be grately appreciated!Hi all,
I need to solve this problem in Matlab. I have a hot body placed over cold ground, this having a thermal conductivity k = 1.
I need to estimate the total heat loss by conduction into the substratum at each timestep.
For each of these timesteps I have a temperature profile and the associated vertical profile at 1cm intervals (see .mat files attached).
How can I estimate the total heat loss (w/m2) at each time interval (i.e., the heat loss for every profile)?
Any help woud be grately appreciated! Hi all,
I need to solve this problem in Matlab. I have a hot body placed over cold ground, this having a thermal conductivity k = 1.
I need to estimate the total heat loss by conduction into the substratum at each timestep.
For each of these timesteps I have a temperature profile and the associated vertical profile at 1cm intervals (see .mat files attached).
How can I estimate the total heat loss (w/m2) at each time interval (i.e., the heat loss for every profile)?
Any help woud be grately appreciated! heat loss, conduction, matlab MATLAB Answers — New Questions
No image is drawn in plots, Problem with low level Graphics error ?
I get this folowing warning on Matlab terminal –
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.
(I am unable to add file as it is confidential, I can maybe save the data in mat format and just give you the plotting script if you want it).
I have attached a picture of my system configurationI get this folowing warning on Matlab terminal –
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.
(I am unable to add file as it is confidential, I can maybe save the data in mat format and just give you the plotting script if you want it).
I have attached a picture of my system configuration I get this folowing warning on Matlab terminal –
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.
(I am unable to add file as it is confidential, I can maybe save the data in mat format and just give you the plotting script if you want it).
I have attached a picture of my system configuration figure graphics, plot image missing, plotting problems, plot, video MATLAB Answers — New Questions
Auto detecting multiple points and tracking their locations
I have a binary video with a few hundred moving white dots that I would like to track and get their respective x and y location individually. I tried following this example: https://www.mathworks.com/help/vision/ug/motion-based-multiple-object-tracking.html to auto track the points but it seems like the the white dots are too small or too dense to be picked up. Anyone have any advice?I have a binary video with a few hundred moving white dots that I would like to track and get their respective x and y location individually. I tried following this example: https://www.mathworks.com/help/vision/ug/motion-based-multiple-object-tracking.html to auto track the points but it seems like the the white dots are too small or too dense to be picked up. Anyone have any advice? I have a binary video with a few hundred moving white dots that I would like to track and get their respective x and y location individually. I tried following this example: https://www.mathworks.com/help/vision/ug/motion-based-multiple-object-tracking.html to auto track the points but it seems like the the white dots are too small or too dense to be picked up. Anyone have any advice? computer vision, binary image, video, tracking MATLAB Answers — New Questions
Why my matlab can’t show and save images?
clear all;
clc
%————————Menentukan Parameter—————%
L=2000; % panjang kanal(m)
T=3600; % lama simulasi (s)
dx=20; % lebar grid (m)
ln=0:dx:L;
y=length(ln); % panjang grid
n=L/dx; % jumlah grid
dt=2;
t=0:dt:T;
var=length(t); % panjang waktu
u1=-0.245;
u2=0.215;
pc=75; % polutan kontinu
pdc=100; % polutan diskontinu
%—————–Menentukan Domain——————-%
%skenario 1 (u1 polutan kontinu)
kk1=zeros(var,y); % nilai awal
kk1(:,15)=pc; % nilai konsentrasi polutan kontinu
%skenario 2 (u2 polutan kontinu)
kk2=zeros(var,y); % nilai awal
kk2(:,15)=pc; % nilai konsentrasi polutan kontinu
%skenario 3 (u1 polutan diskontinu)
kd1=zeros(var,y); % nilai awal
kd1(19,11)=pdc; % nilai konsentrasi polutan kontinu
%skenario 4 (u2 polutan diskontinu)
kd2=zeros(var,y); % nilai awal
kd2(19,11)=pdc; % nilai konsentrasi polutan kontinu
%—————-Perhitungan Upstream—————%
%%—skenario 1 dan 3 (untuk polutan u1)—–%%
lam1=(dt/(2*dx)); % konstanta untk numerik untuk polutan u1
if(-1<=lam1<=1); % syarat perhitungan upstream
disp(‘Model Jalan’);
else
return
end
%%% u1 kontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u1-abs(u1);
b=kk1(np,i+1)-kk1(np,i);
c=u1+abs(u1);
d=kk1(np,i)-kk1(np,i-1);
kk1(np+1,i)=kk1(np,i)-lam1*((a*b)+(c*d));
end;
kk1(:,15)=pc;
kk1(np,1)=kk1(np,2); %nilai batas kiri
kk1(np,y)=kk1(np,y-1); %niai batas kanan
end;
%%% u1 diskontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u1-abs(u1);
b=kd1(np,i+1)-kd1(np,i);
c=u1+abs(u1);
d=kd1(np,i)-kd1(np,i-1);
kd1(np+1,i)=kd1(np,i)-lam1*((a*b)+(c*d));
end;
kd1(19,11)=pc;
kd1(np,1)=kd1(np,2);
kd1(np,y)=kd1(np,y-1);
end;
%%———–skenario 2 dan 4 (untuk polutan u2)————-%
%%% u2 kontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u2-abs(u2);
b=kk2(np,i+1)-kk2(np,i);
c=u2+abs(u2);
d=kk2(np,i)-kk2(np,i-1);
kk2(np+1,i)=kk2(np,i)-lam1*((a*b)+(c*d));
end;
kk2(:,15)=pc;
kk2(np,1)=kk2(np,2);
kk2(np,y)=kk2(np,y-1);
end;
%% u2 diskontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u2-abs(u2);
b=kd2(np,i+1)-kd2(np,i);
c=u2+abs(u2);
d=kd2(np,i)-kd2(np,i-1);
kd2(np+1,i)=kd2(np,i)-lam1*((a*b)+(c*d));
end;
kd2(19,11)=pc;
kd2(np,1)=kd2(np,2);
kd2(np,y)=kd2(np,y-1);
end;
%—————ploting——————–%
timev=[300 600 900 1200 1500];
tiv=[5 25 50 75 100];
%ploting u1 kontinu
figure(17);
plot(t,kk1(:,tiv(1)),t,kk1(:,tiv(2)),t,kk1(:,tiv(3)),t,kk1(:,tiv(4)),t,kk1(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u1 polutan kontinu dengan metode Upstream’);
set(17,’Position’,get(0,’Screensize’));
saveas(17,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u1 Polutan Kontinu dengan Metode Upstream.jpg’);
figure (18);
plot(ln,kk1(timev(1),:),ln,kk1(timev(2),:),ln,kk1(timev(3),:),ln,kk1(timev(4),:),ln,kk1(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u1 Polutan Kontinu dengan Metode Upstream’);
set(18,’Position’,get(0,’Screensize’));
saveas(18,’Grafik Perubahan Konsentrasi terhadap ruang untuk u1 Polutan Kontinu dengan Metode Upstream.jpg’);
%%Ploting u2 kontinu
figure(19);
plot(t,kk2(:,tiv(1)),t,kk2(:,tiv(2)),t,kk2(:,tiv(3)),t,kk2(:,tiv(4)),t,kk2(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u2 Polutan Kontinu dengan Metode Upstream’);
set(19,’Position’,get(0,’Screensize’));
saveas(19,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u2 Polutan Kontinu dengan Metode Upstream.jpg’);
figure(20);
plot(ln,kk2(timev(1),:),ln,kk2(timev(2),:),ln,kk2(timev(3),:),ln,kk2(timev(4),:),ln,kk2(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u2 Polutan Kontinu dengan Metode Upstream’);
set(20,’Position’,get(0,’Screensize’));
saveas(20,’Grafik Perubahan Konsentrasi terhadap Ruang untuk u2 Polutan Kontinu dengan Metode Upstream.jpg’);
%%ploting u1 diskontinu
figure(21);
plot(t,kd1(:,tiv(1)),t,kd1(:,tiv(2)),t,kd1(:,tiv(3)),t,kd1(:,tiv(4)),t,kd1(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u1 Polutan diskontinu dengan Metode Upstream’);
set(21,’Position’,get(0,’Screensize’));
saveas(21,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u1 Polutan diskontinu dengan Metode Upstream.jpg’);
figure(22);
plot(ln,kd1(timev(1),:),ln,kd1(timev(2),:),ln,kd1(timev(3),:),ln,kd1(timev(4),:),ln,kd1(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u1 Polutan diskontinu dengan Metode Upstream’);
set(22,’Position’,get(0,’Screensize’));
saveas(22,’Grafik Perubahan Konsentrasi terhadap Ruang untuk u1 Polutan diskontinu dengan Metode Upstream.jpg’);
%%ploting u2 diskontinu
figure(23);
plot(t,kd2(:,tiv(1)),t,kd2(:,tiv(2)),t,kd2(:,tiv(3)),t,kd2(:,tiv(4)),t,kd2(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u2 Polutan diskontinu dengan Metode Upstream’);
set(23,’Position’,get(0,’Screensize’));
saveas(23,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u2 Polutan diskontinu dengan Metode Upstream.jpg’);
figure(24);
plot(ln,kd2(timev(1),:),ln,kd2(timev(2),:),ln,kd2(timev(3),:),ln,kd2(timev(4),:),ln,kd2(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u2 Polutan diskontinu dengan Metode Upstream’);
set(24,’Position’,get(0,’Screensize’));
saveas(24,’Grafik Perubahan Konsentrasi terhadap Ruang untuk u2 Polutan diskontinu dengan Metode Upstream.jpg’);
|when i tried to run it appear error like this|
Warning: File ‘./Grafik Perubahan
Konsentrasi terhadap Waktu untuk u2
Polutan diskontinu dengan Metode
Upstream.jpg’ not found.
> In matlab.graphics.internal.name (line 108)
In print (line 71)
In saveas (line 181)
In UpStreamTUGAS (line 166)
Error using print (line 90)
Output file ‘./Grafik Perubahan
Konsentrasi terhadap Waktu untuk u2
Polutan diskontinu dengan Metode
Upstream.jpg’ was not created. The file
name may not be valid.
Error in saveas (line 181)
print( h, name, [‘-d’ dev{i}] )
Error in UpStreamTUGAS (line 166)
saveas(23,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u2 Polutan diskontinu dengan Metode Upstream.jpg’);clear all;
clc
%————————Menentukan Parameter—————%
L=2000; % panjang kanal(m)
T=3600; % lama simulasi (s)
dx=20; % lebar grid (m)
ln=0:dx:L;
y=length(ln); % panjang grid
n=L/dx; % jumlah grid
dt=2;
t=0:dt:T;
var=length(t); % panjang waktu
u1=-0.245;
u2=0.215;
pc=75; % polutan kontinu
pdc=100; % polutan diskontinu
%—————–Menentukan Domain——————-%
%skenario 1 (u1 polutan kontinu)
kk1=zeros(var,y); % nilai awal
kk1(:,15)=pc; % nilai konsentrasi polutan kontinu
%skenario 2 (u2 polutan kontinu)
kk2=zeros(var,y); % nilai awal
kk2(:,15)=pc; % nilai konsentrasi polutan kontinu
%skenario 3 (u1 polutan diskontinu)
kd1=zeros(var,y); % nilai awal
kd1(19,11)=pdc; % nilai konsentrasi polutan kontinu
%skenario 4 (u2 polutan diskontinu)
kd2=zeros(var,y); % nilai awal
kd2(19,11)=pdc; % nilai konsentrasi polutan kontinu
%—————-Perhitungan Upstream—————%
%%—skenario 1 dan 3 (untuk polutan u1)—–%%
lam1=(dt/(2*dx)); % konstanta untk numerik untuk polutan u1
if(-1<=lam1<=1); % syarat perhitungan upstream
disp(‘Model Jalan’);
else
return
end
%%% u1 kontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u1-abs(u1);
b=kk1(np,i+1)-kk1(np,i);
c=u1+abs(u1);
d=kk1(np,i)-kk1(np,i-1);
kk1(np+1,i)=kk1(np,i)-lam1*((a*b)+(c*d));
end;
kk1(:,15)=pc;
kk1(np,1)=kk1(np,2); %nilai batas kiri
kk1(np,y)=kk1(np,y-1); %niai batas kanan
end;
%%% u1 diskontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u1-abs(u1);
b=kd1(np,i+1)-kd1(np,i);
c=u1+abs(u1);
d=kd1(np,i)-kd1(np,i-1);
kd1(np+1,i)=kd1(np,i)-lam1*((a*b)+(c*d));
end;
kd1(19,11)=pc;
kd1(np,1)=kd1(np,2);
kd1(np,y)=kd1(np,y-1);
end;
%%———–skenario 2 dan 4 (untuk polutan u2)————-%
%%% u2 kontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u2-abs(u2);
b=kk2(np,i+1)-kk2(np,i);
c=u2+abs(u2);
d=kk2(np,i)-kk2(np,i-1);
kk2(np+1,i)=kk2(np,i)-lam1*((a*b)+(c*d));
end;
kk2(:,15)=pc;
kk2(np,1)=kk2(np,2);
kk2(np,y)=kk2(np,y-1);
end;
%% u2 diskontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u2-abs(u2);
b=kd2(np,i+1)-kd2(np,i);
c=u2+abs(u2);
d=kd2(np,i)-kd2(np,i-1);
kd2(np+1,i)=kd2(np,i)-lam1*((a*b)+(c*d));
end;
kd2(19,11)=pc;
kd2(np,1)=kd2(np,2);
kd2(np,y)=kd2(np,y-1);
end;
%—————ploting——————–%
timev=[300 600 900 1200 1500];
tiv=[5 25 50 75 100];
%ploting u1 kontinu
figure(17);
plot(t,kk1(:,tiv(1)),t,kk1(:,tiv(2)),t,kk1(:,tiv(3)),t,kk1(:,tiv(4)),t,kk1(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u1 polutan kontinu dengan metode Upstream’);
set(17,’Position’,get(0,’Screensize’));
saveas(17,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u1 Polutan Kontinu dengan Metode Upstream.jpg’);
figure (18);
plot(ln,kk1(timev(1),:),ln,kk1(timev(2),:),ln,kk1(timev(3),:),ln,kk1(timev(4),:),ln,kk1(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u1 Polutan Kontinu dengan Metode Upstream’);
set(18,’Position’,get(0,’Screensize’));
saveas(18,’Grafik Perubahan Konsentrasi terhadap ruang untuk u1 Polutan Kontinu dengan Metode Upstream.jpg’);
%%Ploting u2 kontinu
figure(19);
plot(t,kk2(:,tiv(1)),t,kk2(:,tiv(2)),t,kk2(:,tiv(3)),t,kk2(:,tiv(4)),t,kk2(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u2 Polutan Kontinu dengan Metode Upstream’);
set(19,’Position’,get(0,’Screensize’));
saveas(19,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u2 Polutan Kontinu dengan Metode Upstream.jpg’);
figure(20);
plot(ln,kk2(timev(1),:),ln,kk2(timev(2),:),ln,kk2(timev(3),:),ln,kk2(timev(4),:),ln,kk2(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u2 Polutan Kontinu dengan Metode Upstream’);
set(20,’Position’,get(0,’Screensize’));
saveas(20,’Grafik Perubahan Konsentrasi terhadap Ruang untuk u2 Polutan Kontinu dengan Metode Upstream.jpg’);
%%ploting u1 diskontinu
figure(21);
plot(t,kd1(:,tiv(1)),t,kd1(:,tiv(2)),t,kd1(:,tiv(3)),t,kd1(:,tiv(4)),t,kd1(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u1 Polutan diskontinu dengan Metode Upstream’);
set(21,’Position’,get(0,’Screensize’));
saveas(21,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u1 Polutan diskontinu dengan Metode Upstream.jpg’);
figure(22);
plot(ln,kd1(timev(1),:),ln,kd1(timev(2),:),ln,kd1(timev(3),:),ln,kd1(timev(4),:),ln,kd1(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u1 Polutan diskontinu dengan Metode Upstream’);
set(22,’Position’,get(0,’Screensize’));
saveas(22,’Grafik Perubahan Konsentrasi terhadap Ruang untuk u1 Polutan diskontinu dengan Metode Upstream.jpg’);
%%ploting u2 diskontinu
figure(23);
plot(t,kd2(:,tiv(1)),t,kd2(:,tiv(2)),t,kd2(:,tiv(3)),t,kd2(:,tiv(4)),t,kd2(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u2 Polutan diskontinu dengan Metode Upstream’);
set(23,’Position’,get(0,’Screensize’));
saveas(23,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u2 Polutan diskontinu dengan Metode Upstream.jpg’);
figure(24);
plot(ln,kd2(timev(1),:),ln,kd2(timev(2),:),ln,kd2(timev(3),:),ln,kd2(timev(4),:),ln,kd2(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u2 Polutan diskontinu dengan Metode Upstream’);
set(24,’Position’,get(0,’Screensize’));
saveas(24,’Grafik Perubahan Konsentrasi terhadap Ruang untuk u2 Polutan diskontinu dengan Metode Upstream.jpg’);
|when i tried to run it appear error like this|
Warning: File ‘./Grafik Perubahan
Konsentrasi terhadap Waktu untuk u2
Polutan diskontinu dengan Metode
Upstream.jpg’ not found.
> In matlab.graphics.internal.name (line 108)
In print (line 71)
In saveas (line 181)
In UpStreamTUGAS (line 166)
Error using print (line 90)
Output file ‘./Grafik Perubahan
Konsentrasi terhadap Waktu untuk u2
Polutan diskontinu dengan Metode
Upstream.jpg’ was not created. The file
name may not be valid.
Error in saveas (line 181)
print( h, name, [‘-d’ dev{i}] )
Error in UpStreamTUGAS (line 166)
saveas(23,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u2 Polutan diskontinu dengan Metode Upstream.jpg’); clear all;
clc
%————————Menentukan Parameter—————%
L=2000; % panjang kanal(m)
T=3600; % lama simulasi (s)
dx=20; % lebar grid (m)
ln=0:dx:L;
y=length(ln); % panjang grid
n=L/dx; % jumlah grid
dt=2;
t=0:dt:T;
var=length(t); % panjang waktu
u1=-0.245;
u2=0.215;
pc=75; % polutan kontinu
pdc=100; % polutan diskontinu
%—————–Menentukan Domain——————-%
%skenario 1 (u1 polutan kontinu)
kk1=zeros(var,y); % nilai awal
kk1(:,15)=pc; % nilai konsentrasi polutan kontinu
%skenario 2 (u2 polutan kontinu)
kk2=zeros(var,y); % nilai awal
kk2(:,15)=pc; % nilai konsentrasi polutan kontinu
%skenario 3 (u1 polutan diskontinu)
kd1=zeros(var,y); % nilai awal
kd1(19,11)=pdc; % nilai konsentrasi polutan kontinu
%skenario 4 (u2 polutan diskontinu)
kd2=zeros(var,y); % nilai awal
kd2(19,11)=pdc; % nilai konsentrasi polutan kontinu
%—————-Perhitungan Upstream—————%
%%—skenario 1 dan 3 (untuk polutan u1)—–%%
lam1=(dt/(2*dx)); % konstanta untk numerik untuk polutan u1
if(-1<=lam1<=1); % syarat perhitungan upstream
disp(‘Model Jalan’);
else
return
end
%%% u1 kontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u1-abs(u1);
b=kk1(np,i+1)-kk1(np,i);
c=u1+abs(u1);
d=kk1(np,i)-kk1(np,i-1);
kk1(np+1,i)=kk1(np,i)-lam1*((a*b)+(c*d));
end;
kk1(:,15)=pc;
kk1(np,1)=kk1(np,2); %nilai batas kiri
kk1(np,y)=kk1(np,y-1); %niai batas kanan
end;
%%% u1 diskontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u1-abs(u1);
b=kd1(np,i+1)-kd1(np,i);
c=u1+abs(u1);
d=kd1(np,i)-kd1(np,i-1);
kd1(np+1,i)=kd1(np,i)-lam1*((a*b)+(c*d));
end;
kd1(19,11)=pc;
kd1(np,1)=kd1(np,2);
kd1(np,y)=kd1(np,y-1);
end;
%%———–skenario 2 dan 4 (untuk polutan u2)————-%
%%% u2 kontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u2-abs(u2);
b=kk2(np,i+1)-kk2(np,i);
c=u2+abs(u2);
d=kk2(np,i)-kk2(np,i-1);
kk2(np+1,i)=kk2(np,i)-lam1*((a*b)+(c*d));
end;
kk2(:,15)=pc;
kk2(np,1)=kk2(np,2);
kk2(np,y)=kk2(np,y-1);
end;
%% u2 diskontinu
for np=1:var-1; % looping waktu
for i=2:y-1; % looping ruang
a=u2-abs(u2);
b=kd2(np,i+1)-kd2(np,i);
c=u2+abs(u2);
d=kd2(np,i)-kd2(np,i-1);
kd2(np+1,i)=kd2(np,i)-lam1*((a*b)+(c*d));
end;
kd2(19,11)=pc;
kd2(np,1)=kd2(np,2);
kd2(np,y)=kd2(np,y-1);
end;
%—————ploting——————–%
timev=[300 600 900 1200 1500];
tiv=[5 25 50 75 100];
%ploting u1 kontinu
figure(17);
plot(t,kk1(:,tiv(1)),t,kk1(:,tiv(2)),t,kk1(:,tiv(3)),t,kk1(:,tiv(4)),t,kk1(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u1 polutan kontinu dengan metode Upstream’);
set(17,’Position’,get(0,’Screensize’));
saveas(17,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u1 Polutan Kontinu dengan Metode Upstream.jpg’);
figure (18);
plot(ln,kk1(timev(1),:),ln,kk1(timev(2),:),ln,kk1(timev(3),:),ln,kk1(timev(4),:),ln,kk1(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u1 Polutan Kontinu dengan Metode Upstream’);
set(18,’Position’,get(0,’Screensize’));
saveas(18,’Grafik Perubahan Konsentrasi terhadap ruang untuk u1 Polutan Kontinu dengan Metode Upstream.jpg’);
%%Ploting u2 kontinu
figure(19);
plot(t,kk2(:,tiv(1)),t,kk2(:,tiv(2)),t,kk2(:,tiv(3)),t,kk2(:,tiv(4)),t,kk2(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u2 Polutan Kontinu dengan Metode Upstream’);
set(19,’Position’,get(0,’Screensize’));
saveas(19,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u2 Polutan Kontinu dengan Metode Upstream.jpg’);
figure(20);
plot(ln,kk2(timev(1),:),ln,kk2(timev(2),:),ln,kk2(timev(3),:),ln,kk2(timev(4),:),ln,kk2(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u2 Polutan Kontinu dengan Metode Upstream’);
set(20,’Position’,get(0,’Screensize’));
saveas(20,’Grafik Perubahan Konsentrasi terhadap Ruang untuk u2 Polutan Kontinu dengan Metode Upstream.jpg’);
%%ploting u1 diskontinu
figure(21);
plot(t,kd1(:,tiv(1)),t,kd1(:,tiv(2)),t,kd1(:,tiv(3)),t,kd1(:,tiv(4)),t,kd1(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u1 Polutan diskontinu dengan Metode Upstream’);
set(21,’Position’,get(0,’Screensize’));
saveas(21,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u1 Polutan diskontinu dengan Metode Upstream.jpg’);
figure(22);
plot(ln,kd1(timev(1),:),ln,kd1(timev(2),:),ln,kd1(timev(3),:),ln,kd1(timev(4),:),ln,kd1(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u1 Polutan diskontinu dengan Metode Upstream’);
set(22,’Position’,get(0,’Screensize’));
saveas(22,’Grafik Perubahan Konsentrasi terhadap Ruang untuk u1 Polutan diskontinu dengan Metode Upstream.jpg’);
%%ploting u2 diskontinu
figure(23);
plot(t,kd2(:,tiv(1)),t,kd2(:,tiv(2)),t,kd2(:,tiv(3)),t,kd2(:,tiv(4)),t,kd2(:,tiv(5)));
xlabel(‘waktu (s)’);ylabel(‘konsentrasi’);
legend(‘100 m’,’500 m’,’1000 m’,’1500 m’,’2000 m’);
title(‘Grafik Perubahan Konsentrasi Terhadap waktu untuk u2 Polutan diskontinu dengan Metode Upstream’);
set(23,’Position’,get(0,’Screensize’));
saveas(23,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u2 Polutan diskontinu dengan Metode Upstream.jpg’);
figure(24);
plot(ln,kd2(timev(1),:),ln,kd2(timev(2),:),ln,kd2(timev(3),:),ln,kd2(timev(4),:),ln,kd2(timev(5),:)),
xlabel(‘Kanal’);ylabel(‘Konsentrasi’);
legend(‘600 s’,’1200 s’,’1800 s’,’2400 s’,’3000 s’);
title(‘Grafik Perubahan Konsentrasi Terhadap Ruang untuk u2 Polutan diskontinu dengan Metode Upstream’);
set(24,’Position’,get(0,’Screensize’));
saveas(24,’Grafik Perubahan Konsentrasi terhadap Ruang untuk u2 Polutan diskontinu dengan Metode Upstream.jpg’);
|when i tried to run it appear error like this|
Warning: File ‘./Grafik Perubahan
Konsentrasi terhadap Waktu untuk u2
Polutan diskontinu dengan Metode
Upstream.jpg’ not found.
> In matlab.graphics.internal.name (line 108)
In print (line 71)
In saveas (line 181)
In UpStreamTUGAS (line 166)
Error using print (line 90)
Output file ‘./Grafik Perubahan
Konsentrasi terhadap Waktu untuk u2
Polutan diskontinu dengan Metode
Upstream.jpg’ was not created. The file
name may not be valid.
Error in saveas (line 181)
print( h, name, [‘-d’ dev{i}] )
Error in UpStreamTUGAS (line 166)
saveas(23,’Grafik Perubahan Konsentrasi terhadap Waktu untuk u2 Polutan diskontinu dengan Metode Upstream.jpg’); saveas, save, image, jpg, upstream MATLAB Answers — New Questions
[0:0.1:1] whys is not exactly 0.1 steps ?
Anyone know why this code does not return verification 1
it seems instead of being 0.1 is actually makaing 0.10000000001
step=0.1;
max_value=1;
array = 0:step:max_value;
array1 = round(0:step:max_value,1);
check=[array’,array1′];
test=[array==array1]’;
% Why not 1 ?
verification=all(test)Anyone know why this code does not return verification 1
it seems instead of being 0.1 is actually makaing 0.10000000001
step=0.1;
max_value=1;
array = 0:step:max_value;
array1 = round(0:step:max_value,1);
check=[array’,array1′];
test=[array==array1]’;
% Why not 1 ?
verification=all(test) Anyone know why this code does not return verification 1
it seems instead of being 0.1 is actually makaing 0.10000000001
step=0.1;
max_value=1;
array = 0:step:max_value;
array1 = round(0:step:max_value,1);
check=[array’,array1′];
test=[array==array1]’;
% Why not 1 ?
verification=all(test) resolution MATLAB Answers — New Questions
What is the fcnLossLayer in the generatePolicyFunction network and how can I implement it myself?
I wish to use my trained SAC agent in Matlab only as a policy function. For this, I tried the generatePolicyFunction option. The code and the network works as intended, but I’m having a hard time figuring out the last layer of the network. It says it’s a fcnLossLayer, although I have no idea what does it mean or how does it work. It’s description is very vauge:
>> policy.Layers(11, 1)
ans =
FcnLossLayer with properties:
LossFcn: []
IsNetworkStateful: 0
Name: ‘RepresentationLoss’
ResponseNames: {}
Description: ”
Type: "GenericLossLayer"
This is the only information I get from the DAGNetwork object and it makes no sense to me. Also I couldn’t find any relevant information in the documentation, or in the referenced articles, or anywhere on the internet. I found it’s type is rl.layer.FcnLossLayer, but searching for this I still got nothing. This seams to me like a focalLossLayer, but even if it is, I don’t know its parameters.
This is important to me because I want to use this policy in a previous Matlab version (R2020a), and it doesn’t seem to support this layer, so I want to try and implement it as a custom layer. Thank you for your help in advance!I wish to use my trained SAC agent in Matlab only as a policy function. For this, I tried the generatePolicyFunction option. The code and the network works as intended, but I’m having a hard time figuring out the last layer of the network. It says it’s a fcnLossLayer, although I have no idea what does it mean or how does it work. It’s description is very vauge:
>> policy.Layers(11, 1)
ans =
FcnLossLayer with properties:
LossFcn: []
IsNetworkStateful: 0
Name: ‘RepresentationLoss’
ResponseNames: {}
Description: ”
Type: "GenericLossLayer"
This is the only information I get from the DAGNetwork object and it makes no sense to me. Also I couldn’t find any relevant information in the documentation, or in the referenced articles, or anywhere on the internet. I found it’s type is rl.layer.FcnLossLayer, but searching for this I still got nothing. This seams to me like a focalLossLayer, but even if it is, I don’t know its parameters.
This is important to me because I want to use this policy in a previous Matlab version (R2020a), and it doesn’t seem to support this layer, so I want to try and implement it as a custom layer. Thank you for your help in advance! I wish to use my trained SAC agent in Matlab only as a policy function. For this, I tried the generatePolicyFunction option. The code and the network works as intended, but I’m having a hard time figuring out the last layer of the network. It says it’s a fcnLossLayer, although I have no idea what does it mean or how does it work. It’s description is very vauge:
>> policy.Layers(11, 1)
ans =
FcnLossLayer with properties:
LossFcn: []
IsNetworkStateful: 0
Name: ‘RepresentationLoss’
ResponseNames: {}
Description: ”
Type: "GenericLossLayer"
This is the only information I get from the DAGNetwork object and it makes no sense to me. Also I couldn’t find any relevant information in the documentation, or in the referenced articles, or anywhere on the internet. I found it’s type is rl.layer.FcnLossLayer, but searching for this I still got nothing. This seams to me like a focalLossLayer, but even if it is, I don’t know its parameters.
This is important to me because I want to use this policy in a previous Matlab version (R2020a), and it doesn’t seem to support this layer, so I want to try and implement it as a custom layer. Thank you for your help in advance! rlsacagent, generatepolicyfunction, fcnlosslayer, matlab, neural network, rl.layer.fcnlosslayer MATLAB Answers — New Questions
how I solve the two equation and two unknown variables using ‘levenberg-marquardt’ method?
I wnat to solve follow two equations.
F = @(X) [d(1,3).*(abs(X(1)./(X(2).^2.*ar))+d(2,3).*(X(1)./(X(2).^2.*ar))).^d(3,3).*(bg_loc_M)+d(4,3).*(X(2)).^d(5,3)-l./X(2);
abs(c(1,3)).*(bg_loc_M).^c(2,3).*X(2).^c(3,3).*(ar).^c(4,3).*exp(-abs(c(5,3)).*abs(X(1)+c(6,3).*abs(X(1))).^abs(c(7,3)))-foc];
here, I don’t know X(1) & X(2), and kown others
how I solve the X(1) and X(2)?
I want to use levenberg-marquardt method.
I did follow.
F = @(X) [d(1,3).*(abs(X(1)./(X(2).^2.*ar))+d(2,3).*(X(1)./(X(2).^2.*ar))).^d(3,3).*(bg_loc_M)+d(4,3).*(X(2)).^d(5,3)-l./X(2);
abs(c(1,3)).*(bg_loc_M).^c(2,3).*X(2).^c(3,3).*(ar).^c(4,3).*exp(-abs(c(5,3)).*abs(X(1)+c(6,3).*abs(X(1))).^abs(c(7,3)))-foc];
x0=[0 l];
opts.Algorithm = ‘levenberg-marquardt’;
opts.TolX = 1e-10;
recal=fsolve(F,x0,opts);
But, results of X(1) & X(2) are different real value…..
I need your advice.I wnat to solve follow two equations.
F = @(X) [d(1,3).*(abs(X(1)./(X(2).^2.*ar))+d(2,3).*(X(1)./(X(2).^2.*ar))).^d(3,3).*(bg_loc_M)+d(4,3).*(X(2)).^d(5,3)-l./X(2);
abs(c(1,3)).*(bg_loc_M).^c(2,3).*X(2).^c(3,3).*(ar).^c(4,3).*exp(-abs(c(5,3)).*abs(X(1)+c(6,3).*abs(X(1))).^abs(c(7,3)))-foc];
here, I don’t know X(1) & X(2), and kown others
how I solve the X(1) and X(2)?
I want to use levenberg-marquardt method.
I did follow.
F = @(X) [d(1,3).*(abs(X(1)./(X(2).^2.*ar))+d(2,3).*(X(1)./(X(2).^2.*ar))).^d(3,3).*(bg_loc_M)+d(4,3).*(X(2)).^d(5,3)-l./X(2);
abs(c(1,3)).*(bg_loc_M).^c(2,3).*X(2).^c(3,3).*(ar).^c(4,3).*exp(-abs(c(5,3)).*abs(X(1)+c(6,3).*abs(X(1))).^abs(c(7,3)))-foc];
x0=[0 l];
opts.Algorithm = ‘levenberg-marquardt’;
opts.TolX = 1e-10;
recal=fsolve(F,x0,opts);
But, results of X(1) & X(2) are different real value…..
I need your advice. I wnat to solve follow two equations.
F = @(X) [d(1,3).*(abs(X(1)./(X(2).^2.*ar))+d(2,3).*(X(1)./(X(2).^2.*ar))).^d(3,3).*(bg_loc_M)+d(4,3).*(X(2)).^d(5,3)-l./X(2);
abs(c(1,3)).*(bg_loc_M).^c(2,3).*X(2).^c(3,3).*(ar).^c(4,3).*exp(-abs(c(5,3)).*abs(X(1)+c(6,3).*abs(X(1))).^abs(c(7,3)))-foc];
here, I don’t know X(1) & X(2), and kown others
how I solve the X(1) and X(2)?
I want to use levenberg-marquardt method.
I did follow.
F = @(X) [d(1,3).*(abs(X(1)./(X(2).^2.*ar))+d(2,3).*(X(1)./(X(2).^2.*ar))).^d(3,3).*(bg_loc_M)+d(4,3).*(X(2)).^d(5,3)-l./X(2);
abs(c(1,3)).*(bg_loc_M).^c(2,3).*X(2).^c(3,3).*(ar).^c(4,3).*exp(-abs(c(5,3)).*abs(X(1)+c(6,3).*abs(X(1))).^abs(c(7,3)))-foc];
x0=[0 l];
opts.Algorithm = ‘levenberg-marquardt’;
opts.TolX = 1e-10;
recal=fsolve(F,x0,opts);
But, results of X(1) & X(2) are different real value…..
I need your advice. levenberg-marquardt, non-liner, fsolve, lsqcurvefit MATLAB Answers — New Questions
I have a hexacopter simulink model attached with the controllers and after a particular simulation time my roll pitch and yaw values rapidly increases and simulation stops.
Post Content Post Content solver MATLAB Answers — New Questions
Find intercept point with three boundary conditions
Hi,
Im trying to find a point in a straight line given by an equation F(x)=mx+b, with the following boundary conditions:
-is a tangent of a semicircle
-The semicircle has a center on the horizontal axis
-the semicircle goes thru the origin (x=0, y=0)
Initially I was plotting the line and then start modifying the radius manually of the semicircle until I found one intersection point using InterX, but I think it might exist a way to avoid the manual modification.Hi,
Im trying to find a point in a straight line given by an equation F(x)=mx+b, with the following boundary conditions:
-is a tangent of a semicircle
-The semicircle has a center on the horizontal axis
-the semicircle goes thru the origin (x=0, y=0)
Initially I was plotting the line and then start modifying the radius manually of the semicircle until I found one intersection point using InterX, but I think it might exist a way to avoid the manual modification. Hi,
Im trying to find a point in a straight line given by an equation F(x)=mx+b, with the following boundary conditions:
-is a tangent of a semicircle
-The semicircle has a center on the horizontal axis
-the semicircle goes thru the origin (x=0, y=0)
Initially I was plotting the line and then start modifying the radius manually of the semicircle until I found one intersection point using InterX, but I think it might exist a way to avoid the manual modification. semicirle tangent MATLAB Answers — New Questions
Can I used hte Spi WriteRead Block with just any SPI device or should it be only with arduino
I have a SPI slave device which is modeled in Simulink via the FIL ( FPGA in LOOP) approach. Would it be possible to use the SPI WriteRead Block available to communicate to this model ?I have a SPI slave device which is modeled in Simulink via the FIL ( FPGA in LOOP) approach. Would it be possible to use the SPI WriteRead Block available to communicate to this model ? I have a SPI slave device which is modeled in Simulink via the FIL ( FPGA in LOOP) approach. Would it be possible to use the SPI WriteRead Block available to communicate to this model ? spi, writeread, simulink, fil, fpga in loop MATLAB Answers — New Questions
Channel Equalization for the comm.RayleighFading communication toolbox for Frequency Selective channel?
I recently used the comm.rayleighfading communication toolbox to create random channel taps with some correlation (Jakes, Clarkes Models). In flat fading it is easy to obtain the H matrix and equalize accordingly. However, I dont know how it should be done using this toolbox in multipath frequency selective channels.
I want to use the channel output y and the path gains h to reconstruct the input signal x.
Thanks in advanceI recently used the comm.rayleighfading communication toolbox to create random channel taps with some correlation (Jakes, Clarkes Models). In flat fading it is easy to obtain the H matrix and equalize accordingly. However, I dont know how it should be done using this toolbox in multipath frequency selective channels.
I want to use the channel output y and the path gains h to reconstruct the input signal x.
Thanks in advance I recently used the comm.rayleighfading communication toolbox to create random channel taps with some correlation (Jakes, Clarkes Models). In flat fading it is easy to obtain the H matrix and equalize accordingly. However, I dont know how it should be done using this toolbox in multipath frequency selective channels.
I want to use the channel output y and the path gains h to reconstruct the input signal x.
Thanks in advance communications, channel, ofdm, rayleigh, equalization MATLAB Answers — New Questions
How is cell to cell gap in battery builder app is depicted in electrical circuit?
hi,
battery pack can be made either using simulink battery blocks or newly introduced "battery builder app". The latter gives an additional advantage of specifying the gap between cell to cell, parallel assembly and module assembly. i want to know how the "gap" that we provide during building battery pack in battery builder app is depicted in eletrical circuit or in the final battery pack? also can it be made a runtime parameter during simulation? if yes, please tell me how it can be done?
thank you.hi,
battery pack can be made either using simulink battery blocks or newly introduced "battery builder app". The latter gives an additional advantage of specifying the gap between cell to cell, parallel assembly and module assembly. i want to know how the "gap" that we provide during building battery pack in battery builder app is depicted in eletrical circuit or in the final battery pack? also can it be made a runtime parameter during simulation? if yes, please tell me how it can be done?
thank you. hi,
battery pack can be made either using simulink battery blocks or newly introduced "battery builder app". The latter gives an additional advantage of specifying the gap between cell to cell, parallel assembly and module assembly. i want to know how the "gap" that we provide during building battery pack in battery builder app is depicted in eletrical circuit or in the final battery pack? also can it be made a runtime parameter during simulation? if yes, please tell me how it can be done?
thank you. battery_system_management, simscape battery MATLAB Answers — New Questions