Category: Matlab
Category Archives: Matlab
Machine learning in matlab
Can i call the matpower file in matlab using machine learning?Can i call the matpower file in matlab using machine learning? Can i call the matpower file in matlab using machine learning? matpower, machine learning MATLAB Answers — New Questions
Python Script Simulink Real Time
Good afternoon,
In Simulink you can intergrate Python script into the model, does that also work for External Mode Simulation for Simulink Real Time?
Kind regards,
DiedeGood afternoon,
In Simulink you can intergrate Python script into the model, does that also work for External Mode Simulation for Simulink Real Time?
Kind regards,
Diede Good afternoon,
In Simulink you can intergrate Python script into the model, does that also work for External Mode Simulation for Simulink Real Time?
Kind regards,
Diede python, simulink, real time, matlab MATLAB Answers — New Questions
Run Initialization for Task (5) Mask creation
I need to ensure that the string is up to date by running the mask initialization commands I wrote in the previous task. However, I’m unable to find a way to do this or the code to run the initialization. The attached images provides additional context.
Could you please guide me through the process or help with the necessary code?
How can I run the initialization so that the label on the mask display is Kp=50 and Ki=50 just like the codes in the second image.I need to ensure that the string is up to date by running the mask initialization commands I wrote in the previous task. However, I’m unable to find a way to do this or the code to run the initialization. The attached images provides additional context.
Could you please guide me through the process or help with the necessary code?
How can I run the initialization so that the label on the mask display is Kp=50 and Ki=50 just like the codes in the second image. I need to ensure that the string is up to date by running the mask initialization commands I wrote in the previous task. However, I’m unable to find a way to do this or the code to run the initialization. The attached images provides additional context.
Could you please guide me through the process or help with the necessary code?
How can I run the initialization so that the label on the mask display is Kp=50 and Ki=50 just like the codes in the second image. mask editor, run initialization MATLAB Answers — New Questions
py.importlib.import_module(‘gplearn’) ???
gplearn = py.importlib.import_module(‘gplearn’);
sklearn = py.importlib.import_module(‘sklearn’);
why they are different???gplearn = py.importlib.import_module(‘gplearn’);
sklearn = py.importlib.import_module(‘sklearn’);
why they are different??? gplearn = py.importlib.import_module(‘gplearn’);
sklearn = py.importlib.import_module(‘sklearn’);
why they are different??? python MATLAB Answers — New Questions
Error: Unable to update models referenced by Testsystem_w_CLB.
Testsystem_w_CLB is the project.
Caused by: Error encountered while building "SmartValveControls_msf"
SmartValveControls_msf is MATLAB mex file.
any one can suggest how to fix the error.Testsystem_w_CLB is the project.
Caused by: Error encountered while building "SmartValveControls_msf"
SmartValveControls_msf is MATLAB mex file.
any one can suggest how to fix the error. Testsystem_w_CLB is the project.
Caused by: Error encountered while building "SmartValveControls_msf"
SmartValveControls_msf is MATLAB mex file.
any one can suggest how to fix the error. error in building the matlab mex file MATLAB Answers — New Questions
Cooperative spectral sensing with majority fusion rule
I´m MSc student.
I´m doing my thesis on "cooperative spectral sensing with majority fusion rule, energy detector". So ,i need matlab code for it. Anyone who can provide me a basic code pls.
My email: alcides.tomas@mtel.inatel.brI´m MSc student.
I´m doing my thesis on "cooperative spectral sensing with majority fusion rule, energy detector". So ,i need matlab code for it. Anyone who can provide me a basic code pls.
My email: alcides.tomas@mtel.inatel.br I´m MSc student.
I´m doing my thesis on "cooperative spectral sensing with majority fusion rule, energy detector". So ,i need matlab code for it. Anyone who can provide me a basic code pls.
My email: alcides.tomas@mtel.inatel.br cooperative spectral sensing, cognitive radio, majoritary fusion rule, energy detector MATLAB Answers — New Questions
How to improve precision of lsqnonlin analysis
I used lsqnonlin annlysis to fit a model to two sets of data. The results showed that the differences between original data and fitted line are rather huge (see in Figure1). How to improve this analysis to obtain better results? Thanks! Below are my codes.
function Result = myfunc1(a,p,G,m,fraction)
totalconcentration = 0.0000254;
n = 2;
K = exp(-((G + m .* fraction)./(8.314*298)));
opts = optimoptions(‘fsolve’,’Algorithm’, ‘levenberg-marquardt’,’FunctionTolerance’,1.0000e-12);
monomerconcentration = fsolve(@denaturationfun,0.999,opts);
function y = denaturationfun(x)
y = K.*totalconcentration – a.^(-1).*(((a.*x).^(n+1)).*(n.*a.*x-n-1)./((a.*x-1).^2)+a.*x./((a.*x-1).^2))+a.^(n-1).*((x^(n+1)).*(n.*x-n-1)./((x-1).^2));
end
Result = p * (1- (monomerconcentration ./ ( K * totalconcentration )));
end
clc;
clear;
close all;
fractiondata = [0.0431 0.0478 0.0525 0.0571 0.0617 0.0662 0.0707 0.0751 0.0795 0.0839 0.0882 0.0925 0.0967 0.1009 0.1051 0.1092 0.1133 0.1174 0.1253];
DegreeofAggdata = [0.86089 0.90051 0.84268 0.9543 0.98855 0.98538 1 0.98493 0.91339 0.92209 0.85817 0.78529 0.64172 0.45712 0.24855 0.11291 0.00812 0 0.0169];
fun = @(x)DegreeofAggdata – myfunc1(x(1),x(2),x(3),x(4),fractiondata);
x0 = [0.001,1,-50000,100000];
lb = [0,0.7,-150000,20000];
ub = [1,1.3,-5000,150000];
options = optimoptions(‘lsqnonlin’,’Algorithm’,’levenberg-marquardt’);
R = lsqnonlin(fun,x0,lb,ub); %% fit model to exp data
A = 0.03:0.001:0.15;
D = zeros(length(A),1);
for i = 1:length(A)
y = myfunc1(R(1),R(2),R(3),R(4),A(i));
D(i)= y;
end
figure(1);
plot(A,D,’r-‘); %% draw lines with fitted parameters
hold on;
plot (fractiondata,DegreeofAggdata,’-go’);I used lsqnonlin annlysis to fit a model to two sets of data. The results showed that the differences between original data and fitted line are rather huge (see in Figure1). How to improve this analysis to obtain better results? Thanks! Below are my codes.
function Result = myfunc1(a,p,G,m,fraction)
totalconcentration = 0.0000254;
n = 2;
K = exp(-((G + m .* fraction)./(8.314*298)));
opts = optimoptions(‘fsolve’,’Algorithm’, ‘levenberg-marquardt’,’FunctionTolerance’,1.0000e-12);
monomerconcentration = fsolve(@denaturationfun,0.999,opts);
function y = denaturationfun(x)
y = K.*totalconcentration – a.^(-1).*(((a.*x).^(n+1)).*(n.*a.*x-n-1)./((a.*x-1).^2)+a.*x./((a.*x-1).^2))+a.^(n-1).*((x^(n+1)).*(n.*x-n-1)./((x-1).^2));
end
Result = p * (1- (monomerconcentration ./ ( K * totalconcentration )));
end
clc;
clear;
close all;
fractiondata = [0.0431 0.0478 0.0525 0.0571 0.0617 0.0662 0.0707 0.0751 0.0795 0.0839 0.0882 0.0925 0.0967 0.1009 0.1051 0.1092 0.1133 0.1174 0.1253];
DegreeofAggdata = [0.86089 0.90051 0.84268 0.9543 0.98855 0.98538 1 0.98493 0.91339 0.92209 0.85817 0.78529 0.64172 0.45712 0.24855 0.11291 0.00812 0 0.0169];
fun = @(x)DegreeofAggdata – myfunc1(x(1),x(2),x(3),x(4),fractiondata);
x0 = [0.001,1,-50000,100000];
lb = [0,0.7,-150000,20000];
ub = [1,1.3,-5000,150000];
options = optimoptions(‘lsqnonlin’,’Algorithm’,’levenberg-marquardt’);
R = lsqnonlin(fun,x0,lb,ub); %% fit model to exp data
A = 0.03:0.001:0.15;
D = zeros(length(A),1);
for i = 1:length(A)
y = myfunc1(R(1),R(2),R(3),R(4),A(i));
D(i)= y;
end
figure(1);
plot(A,D,’r-‘); %% draw lines with fitted parameters
hold on;
plot (fractiondata,DegreeofAggdata,’-go’); I used lsqnonlin annlysis to fit a model to two sets of data. The results showed that the differences between original data and fitted line are rather huge (see in Figure1). How to improve this analysis to obtain better results? Thanks! Below are my codes.
function Result = myfunc1(a,p,G,m,fraction)
totalconcentration = 0.0000254;
n = 2;
K = exp(-((G + m .* fraction)./(8.314*298)));
opts = optimoptions(‘fsolve’,’Algorithm’, ‘levenberg-marquardt’,’FunctionTolerance’,1.0000e-12);
monomerconcentration = fsolve(@denaturationfun,0.999,opts);
function y = denaturationfun(x)
y = K.*totalconcentration – a.^(-1).*(((a.*x).^(n+1)).*(n.*a.*x-n-1)./((a.*x-1).^2)+a.*x./((a.*x-1).^2))+a.^(n-1).*((x^(n+1)).*(n.*x-n-1)./((x-1).^2));
end
Result = p * (1- (monomerconcentration ./ ( K * totalconcentration )));
end
clc;
clear;
close all;
fractiondata = [0.0431 0.0478 0.0525 0.0571 0.0617 0.0662 0.0707 0.0751 0.0795 0.0839 0.0882 0.0925 0.0967 0.1009 0.1051 0.1092 0.1133 0.1174 0.1253];
DegreeofAggdata = [0.86089 0.90051 0.84268 0.9543 0.98855 0.98538 1 0.98493 0.91339 0.92209 0.85817 0.78529 0.64172 0.45712 0.24855 0.11291 0.00812 0 0.0169];
fun = @(x)DegreeofAggdata – myfunc1(x(1),x(2),x(3),x(4),fractiondata);
x0 = [0.001,1,-50000,100000];
lb = [0,0.7,-150000,20000];
ub = [1,1.3,-5000,150000];
options = optimoptions(‘lsqnonlin’,’Algorithm’,’levenberg-marquardt’);
R = lsqnonlin(fun,x0,lb,ub); %% fit model to exp data
A = 0.03:0.001:0.15;
D = zeros(length(A),1);
for i = 1:length(A)
y = myfunc1(R(1),R(2),R(3),R(4),A(i));
D(i)= y;
end
figure(1);
plot(A,D,’r-‘); %% draw lines with fitted parameters
hold on;
plot (fractiondata,DegreeofAggdata,’-go’); lsqnonlin MATLAB Answers — New Questions
how image sharpening is perform in matlab?
please suggest.
% Filter 1
kernel3 = [-1 -1 -1; -1 8 -1; -1 -1 -1]/3;
% Filter the image. Need to cast to single so it can be floating point
% which allows the image to have negative values.
filteredImage = imfilter(single(im), kernel3);
filteredImage =im2double(filteredImage);
filteredImage =1.5 .*filteredImage;
figure(),imshow(filteredImage);
out1=imadd(im,filteredImage);
figure(), imshow(out1);
Z = imabsdiff(im,out1);
% figure(),
imtool(Z);please suggest.
% Filter 1
kernel3 = [-1 -1 -1; -1 8 -1; -1 -1 -1]/3;
% Filter the image. Need to cast to single so it can be floating point
% which allows the image to have negative values.
filteredImage = imfilter(single(im), kernel3);
filteredImage =im2double(filteredImage);
filteredImage =1.5 .*filteredImage;
figure(),imshow(filteredImage);
out1=imadd(im,filteredImage);
figure(), imshow(out1);
Z = imabsdiff(im,out1);
% figure(),
imtool(Z); please suggest.
% Filter 1
kernel3 = [-1 -1 -1; -1 8 -1; -1 -1 -1]/3;
% Filter the image. Need to cast to single so it can be floating point
% which allows the image to have negative values.
filteredImage = imfilter(single(im), kernel3);
filteredImage =im2double(filteredImage);
filteredImage =1.5 .*filteredImage;
figure(),imshow(filteredImage);
out1=imadd(im,filteredImage);
figure(), imshow(out1);
Z = imabsdiff(im,out1);
% figure(),
imtool(Z); image processing, image sharpening, image enhancement, sharpness MATLAB Answers — New Questions
how to display a string in simulink display block
In a simulink model ,i want to display the result in the display block of sinks library .result should be string,like if result is 1 than it should display on ,else if result is 0 it should display off.In a simulink model ,i want to display the result in the display block of sinks library .result should be string,like if result is 1 than it should display on ,else if result is 0 it should display off. In a simulink model ,i want to display the result in the display block of sinks library .result should be string,like if result is 1 than it should display on ,else if result is 0 it should display off. in simulink sinks library display block MATLAB Answers — New Questions
TI C2000 : In Simulink, how to set ePWM output to a GPIO pin ?
Hi Sir,
I am using TI C2000 processor(TMS320F28335), and had just placed an ePWM module into the Simulink and set some parameters.
(I guess C2833x is for TMS320F28335, am I correct ?)
now I want to set the ePWM output to a GPIO pin, but under "Hardware setting" -> "Hardware Implementation" -> "Target hardware resource"->"ePWM", there is no relevant settings for GPIO
On the other hand, refer to : www.mathworks.com/…/sub-modules-of-epwm-type-1-4.html
GPIO mapping for ePWM output can be set in the same window(the green mark in the below picture), I guess it’s due to different C2000 part (?)
I am new to both C2000 processor and Simulink, sorry for such a simple question, very appreciate for your help, thanks.Hi Sir,
I am using TI C2000 processor(TMS320F28335), and had just placed an ePWM module into the Simulink and set some parameters.
(I guess C2833x is for TMS320F28335, am I correct ?)
now I want to set the ePWM output to a GPIO pin, but under "Hardware setting" -> "Hardware Implementation" -> "Target hardware resource"->"ePWM", there is no relevant settings for GPIO
On the other hand, refer to : www.mathworks.com/…/sub-modules-of-epwm-type-1-4.html
GPIO mapping for ePWM output can be set in the same window(the green mark in the below picture), I guess it’s due to different C2000 part (?)
I am new to both C2000 processor and Simulink, sorry for such a simple question, very appreciate for your help, thanks. Hi Sir,
I am using TI C2000 processor(TMS320F28335), and had just placed an ePWM module into the Simulink and set some parameters.
(I guess C2833x is for TMS320F28335, am I correct ?)
now I want to set the ePWM output to a GPIO pin, but under "Hardware setting" -> "Hardware Implementation" -> "Target hardware resource"->"ePWM", there is no relevant settings for GPIO
On the other hand, refer to : www.mathworks.com/…/sub-modules-of-epwm-type-1-4.html
GPIO mapping for ePWM output can be set in the same window(the green mark in the below picture), I guess it’s due to different C2000 part (?)
I am new to both C2000 processor and Simulink, sorry for such a simple question, very appreciate for your help, thanks. c2000 MATLAB Answers — New Questions
LIN pack/unpack ldf file not working
hello everyone,
when i want to upload mine ldf file in th block i wil get a error messages.
error messages:error evaluating "maskParameterCallback" callback of lin unpack block (mask) ‘unittled/lin pack’.
insufficient number of outputs from right hand side of equal sign to satisfy assignmenthello everyone,
when i want to upload mine ldf file in th block i wil get a error messages.
error messages:error evaluating "maskParameterCallback" callback of lin unpack block (mask) ‘unittled/lin pack’.
insufficient number of outputs from right hand side of equal sign to satisfy assignment hello everyone,
when i want to upload mine ldf file in th block i wil get a error messages.
error messages:error evaluating "maskParameterCallback" callback of lin unpack block (mask) ‘unittled/lin pack’.
insufficient number of outputs from right hand side of equal sign to satisfy assignment ldf, pack, communication MATLAB Answers — New Questions
Calculate Bit Error Rate and Block Error Rate using MATLAB
I require a way to calculate Block Error and Bit Error Rate of QAM Signals. How should I take the approach.
eg: I have a TxData = [0.707+0.707*j,0.707-0.707*j, -0.707-0.707*j, -0.707+0.707*j] and RxData = [0.707-0.707*j,0.707-0.707*j, +0.707-0.707*j, -0.707-0.707*j]
I require Matlab code to calculate the Block and Bit error rate of these Tx and Rx Data.I require a way to calculate Block Error and Bit Error Rate of QAM Signals. How should I take the approach.
eg: I have a TxData = [0.707+0.707*j,0.707-0.707*j, -0.707-0.707*j, -0.707+0.707*j] and RxData = [0.707-0.707*j,0.707-0.707*j, +0.707-0.707*j, -0.707-0.707*j]
I require Matlab code to calculate the Block and Bit error rate of these Tx and Rx Data. I require a way to calculate Block Error and Bit Error Rate of QAM Signals. How should I take the approach.
eg: I have a TxData = [0.707+0.707*j,0.707-0.707*j, -0.707-0.707*j, -0.707+0.707*j] and RxData = [0.707-0.707*j,0.707-0.707*j, +0.707-0.707*j, -0.707-0.707*j]
I require Matlab code to calculate the Block and Bit error rate of these Tx and Rx Data. matlab, qam MATLAB Answers — New Questions
How to use two releases of MATLAB (R2017a and R2022b) simultaneously on my laptop?
I had one relaese of MATLAB R2022b installed on my system but it is missing the optimtool. Then I treid to install R2017a, it is not working. Instrad it gives me the license error. Further when I uninstall the 2nd one, then the system gives me the message " Deactivate the license. If you deactivate the license, all releases will not work on this system". How to solve this issue?I had one relaese of MATLAB R2022b installed on my system but it is missing the optimtool. Then I treid to install R2017a, it is not working. Instrad it gives me the license error. Further when I uninstall the 2nd one, then the system gives me the message " Deactivate the license. If you deactivate the license, all releases will not work on this system". How to solve this issue? I had one relaese of MATLAB R2022b installed on my system but it is missing the optimtool. Then I treid to install R2017a, it is not working. Instrad it gives me the license error. Further when I uninstall the 2nd one, then the system gives me the message " Deactivate the license. If you deactivate the license, all releases will not work on this system". How to solve this issue? matlab r2022b, matlab r2017a, two releases of matlab MATLAB Answers — New Questions
how to find LPC feature from speech to recognize human emotions in matlab? Please, can anyone help?
Can anyone provide LPC feature extraction matlab algorithm or code for speech emotion recognition?Can anyone provide LPC feature extraction matlab algorithm or code for speech emotion recognition? Can anyone provide LPC feature extraction matlab algorithm or code for speech emotion recognition? lpc feature MATLAB Answers — New Questions
Filename truncated in MATLAB
I am using a command:
[TestDefinitionFiles,testDefinitionFolder] = uigetfile(‘*.xlsx’,’Select one or more test definitions that you to execute’,’MultiSelect’,’on’);
When I load the excel file (Disabled_to_MoveMotor), I see it in TestDefinitionFiles as
Why is the name truncated or is anything wrong from the user’s side?
Thanks.I am using a command:
[TestDefinitionFiles,testDefinitionFolder] = uigetfile(‘*.xlsx’,’Select one or more test definitions that you to execute’,’MultiSelect’,’on’);
When I load the excel file (Disabled_to_MoveMotor), I see it in TestDefinitionFiles as
Why is the name truncated or is anything wrong from the user’s side?
Thanks. I am using a command:
[TestDefinitionFiles,testDefinitionFolder] = uigetfile(‘*.xlsx’,’Select one or more test definitions that you to execute’,’MultiSelect’,’on’);
When I load the excel file (Disabled_to_MoveMotor), I see it in TestDefinitionFiles as
Why is the name truncated or is anything wrong from the user’s side?
Thanks. excel, matlab MATLAB Answers — New Questions
PowerGUI and Rapid Accelerator: A new block names […] cannot be added
I built an electrical simulation in Simulink using Simscape Specialized Technology with fixed-step simulations. The powergui block is in the main system. When I want to run the simulation in Rapid Accelerator mode, it compiles successfully with MSVC++. At the stage "Connect to Rapid Accelerator Process and Simulate" it outputs:
A new block named ‘MainSimulation/powergui/EquivalentModel19’ cannot be added
How can I get past that and/or further understand the problem?
(The ultimate goal is to deploy this as a Desktop app, so Rapid Accelerator mode is required)I built an electrical simulation in Simulink using Simscape Specialized Technology with fixed-step simulations. The powergui block is in the main system. When I want to run the simulation in Rapid Accelerator mode, it compiles successfully with MSVC++. At the stage "Connect to Rapid Accelerator Process and Simulate" it outputs:
A new block named ‘MainSimulation/powergui/EquivalentModel19’ cannot be added
How can I get past that and/or further understand the problem?
(The ultimate goal is to deploy this as a Desktop app, so Rapid Accelerator mode is required) I built an electrical simulation in Simulink using Simscape Specialized Technology with fixed-step simulations. The powergui block is in the main system. When I want to run the simulation in Rapid Accelerator mode, it compiles successfully with MSVC++. At the stage "Connect to Rapid Accelerator Process and Simulate" it outputs:
A new block named ‘MainSimulation/powergui/EquivalentModel19’ cannot be added
How can I get past that and/or further understand the problem?
(The ultimate goal is to deploy this as a Desktop app, so Rapid Accelerator mode is required) powergui, rapid accelerator MATLAB Answers — New Questions
How to show a figure in the MATLAB App designer with both X and Y axis from signal in simulink real-time model?
How can we customize the x-axis of the instrumented axes in MATLAB App (with model running on Speedgoat)? I wanted to plot Speed vs Torque (signals from Simulink model) (in the axes) instead of separately plotting them with respect to time.How can we customize the x-axis of the instrumented axes in MATLAB App (with model running on Speedgoat)? I wanted to plot Speed vs Torque (signals from Simulink model) (in the axes) instead of separately plotting them with respect to time. How can we customize the x-axis of the instrumented axes in MATLAB App (with model running on Speedgoat)? I wanted to plot Speed vs Torque (signals from Simulink model) (in the axes) instead of separately plotting them with respect to time. simulink, appdesigner MATLAB Answers — New Questions
Memory efficient alternative for meshgrid?
I am generating a meshgrid to be able to calculate my result fast:
% x, y, z are some large vectors
[a,b,c] = meshgrid(x,y,z);
% s, t are constants, M some matrix
result = (((c*s – b*t).^2)./(a.^2 + b.^2 + c.^2)).*M;
This is actually working quite nicely. Unfortunately, for very large x,y,z, the meshgrid function is running out of memory.
How do I rewrite the meshgrid function to be memory efficient?
I had thought of three loops like this:
result = zeros(length(x), length(y), length(z));
for i = 1:lenght(x)-1
for j = y = 1:lenght(y)-1
for k = z = 1:lenght(z)-1
b = ??
c = ??
result(i,j,k) = (((c*s – b*t).^2)./(x(i)^2 + y(j)^2 + z(k).^2));
end
end
end
result = result.*M;
What are the values for b and c?
How can I turn the outer for into a parfor?I am generating a meshgrid to be able to calculate my result fast:
% x, y, z are some large vectors
[a,b,c] = meshgrid(x,y,z);
% s, t are constants, M some matrix
result = (((c*s – b*t).^2)./(a.^2 + b.^2 + c.^2)).*M;
This is actually working quite nicely. Unfortunately, for very large x,y,z, the meshgrid function is running out of memory.
How do I rewrite the meshgrid function to be memory efficient?
I had thought of three loops like this:
result = zeros(length(x), length(y), length(z));
for i = 1:lenght(x)-1
for j = y = 1:lenght(y)-1
for k = z = 1:lenght(z)-1
b = ??
c = ??
result(i,j,k) = (((c*s – b*t).^2)./(x(i)^2 + y(j)^2 + z(k).^2));
end
end
end
result = result.*M;
What are the values for b and c?
How can I turn the outer for into a parfor? I am generating a meshgrid to be able to calculate my result fast:
% x, y, z are some large vectors
[a,b,c] = meshgrid(x,y,z);
% s, t are constants, M some matrix
result = (((c*s – b*t).^2)./(a.^2 + b.^2 + c.^2)).*M;
This is actually working quite nicely. Unfortunately, for very large x,y,z, the meshgrid function is running out of memory.
How do I rewrite the meshgrid function to be memory efficient?
I had thought of three loops like this:
result = zeros(length(x), length(y), length(z));
for i = 1:lenght(x)-1
for j = y = 1:lenght(y)-1
for k = z = 1:lenght(z)-1
b = ??
c = ??
result(i,j,k) = (((c*s – b*t).^2)./(x(i)^2 + y(j)^2 + z(k).^2));
end
end
end
result = result.*M;
What are the values for b and c?
How can I turn the outer for into a parfor? meshgrid, parfor MATLAB Answers — New Questions
Can I input an array of derivatives to the integrator and obtain an array as output?
I am new to Simulink/Matlab. I have a 2-element array of time-derivatives as input to a Simulink integrator block and I want to get a corresponding array as output. Is this even admissible? If so, how do I specify the dimensions of the inputs and outputs to the integrator block?
I get the following error when I try to build the model.
Error in port widths or dimensions. Invalid dimension has been specified for ‘Input Port 1’ of ‘<foo>/Integrator’. I have seen some people ask similar questions
Thanks.I am new to Simulink/Matlab. I have a 2-element array of time-derivatives as input to a Simulink integrator block and I want to get a corresponding array as output. Is this even admissible? If so, how do I specify the dimensions of the inputs and outputs to the integrator block?
I get the following error when I try to build the model.
Error in port widths or dimensions. Invalid dimension has been specified for ‘Input Port 1’ of ‘<foo>/Integrator’. I have seen some people ask similar questions
Thanks. I am new to Simulink/Matlab. I have a 2-element array of time-derivatives as input to a Simulink integrator block and I want to get a corresponding array as output. Is this even admissible? If so, how do I specify the dimensions of the inputs and outputs to the integrator block?
I get the following error when I try to build the model.
Error in port widths or dimensions. Invalid dimension has been specified for ‘Input Port 1’ of ‘<foo>/Integrator’. I have seen some people ask similar questions
Thanks. array input to integrator MATLAB Answers — New Questions
Integral and inverse integral
Hi,
I would like to calculate the probability of failure using the convolution therom as described in this paper https://www.researchgate.net/publication/314278481_Reliability_Index_for_Non-normal_Distribution_of_Limit_State_Functions
First I wanted to write the code using examples of this paper (Please look at the attached screenshots). Unfortunately, I didn’t get the same results. I found a probabilty of failure Pf=3.82 10^-08 instead of 5.55 10^-02.
In addition, I am struggling to write the inverse function to derive the reliabilty index. I always leads to errors?
Can anyone explain the mistake?
Sigma= 1;
Mu=5;
PDF_Norm=@(x) exp(-0.5.*((x-Mu)/Sigma).^2)/(Sigma*sqrt(2*pi));
a=2;
b=1;
Gamma=@(x) x.^(a-1).*exp(-x/b)/((b^a).*gamma(a));
FUN=@(x) PDF_Norm(x).*Gamma(-x);
Pf=integral(@(x) FUN(x),-Inf,0);
sym x
Beta=finverse(F,x);Hi,
I would like to calculate the probability of failure using the convolution therom as described in this paper https://www.researchgate.net/publication/314278481_Reliability_Index_for_Non-normal_Distribution_of_Limit_State_Functions
First I wanted to write the code using examples of this paper (Please look at the attached screenshots). Unfortunately, I didn’t get the same results. I found a probabilty of failure Pf=3.82 10^-08 instead of 5.55 10^-02.
In addition, I am struggling to write the inverse function to derive the reliabilty index. I always leads to errors?
Can anyone explain the mistake?
Sigma= 1;
Mu=5;
PDF_Norm=@(x) exp(-0.5.*((x-Mu)/Sigma).^2)/(Sigma*sqrt(2*pi));
a=2;
b=1;
Gamma=@(x) x.^(a-1).*exp(-x/b)/((b^a).*gamma(a));
FUN=@(x) PDF_Norm(x).*Gamma(-x);
Pf=integral(@(x) FUN(x),-Inf,0);
sym x
Beta=finverse(F,x); Hi,
I would like to calculate the probability of failure using the convolution therom as described in this paper https://www.researchgate.net/publication/314278481_Reliability_Index_for_Non-normal_Distribution_of_Limit_State_Functions
First I wanted to write the code using examples of this paper (Please look at the attached screenshots). Unfortunately, I didn’t get the same results. I found a probabilty of failure Pf=3.82 10^-08 instead of 5.55 10^-02.
In addition, I am struggling to write the inverse function to derive the reliabilty index. I always leads to errors?
Can anyone explain the mistake?
Sigma= 1;
Mu=5;
PDF_Norm=@(x) exp(-0.5.*((x-Mu)/Sigma).^2)/(Sigma*sqrt(2*pi));
a=2;
b=1;
Gamma=@(x) x.^(a-1).*exp(-x/b)/((b^a).*gamma(a));
FUN=@(x) PDF_Norm(x).*Gamma(-x);
Pf=integral(@(x) FUN(x),-Inf,0);
sym x
Beta=finverse(F,x); integral, convolution MATLAB Answers — New Questions