Category: Matlab
Category Archives: Matlab
Curve Fitting for a Rational Polynomial Model.
Dear all,
I want to find the best rational Polynomial model that can fit the data shown.
any help would be appreciated.
Data are in dB.Dear all,
I want to find the best rational Polynomial model that can fit the data shown.
any help would be appreciated.
Data are in dB. Dear all,
I want to find the best rational Polynomial model that can fit the data shown.
any help would be appreciated.
Data are in dB. curve fitting MATLAB Answers — New Questions
Defining an improper function in Simulink
I want to implement this transfer function model related to viscous friction in simulink : Ms^2 + ws which means it does not have a denominator thus cannot be defined in simulink since it has a greater value of numerator than the denominator meaning it is an improper function, are there any workarounds that i can implements so that i can define this transfer function? Thank you very much.I want to implement this transfer function model related to viscous friction in simulink : Ms^2 + ws which means it does not have a denominator thus cannot be defined in simulink since it has a greater value of numerator than the denominator meaning it is an improper function, are there any workarounds that i can implements so that i can define this transfer function? Thank you very much. I want to implement this transfer function model related to viscous friction in simulink : Ms^2 + ws which means it does not have a denominator thus cannot be defined in simulink since it has a greater value of numerator than the denominator meaning it is an improper function, are there any workarounds that i can implements so that i can define this transfer function? Thank you very much. simulink, transfer function MATLAB Answers — New Questions
C code generation: memory allocation for reference model in multi-instance mode
I am generating c code for model reference hierarchy using Embedded Coder.
There are reference models which are called multiple times from a parent model.
In the generated code, the block signals and block states data for each instance of reference model is accumulated in block states data of parent model creating a large structure(which causes compilation error).
I would like to have a single memory allocation(global) for this reference model data and reuse it for all instances.
I tried changing many settings related to code generation/optimization, but could not fix this.
Is there any method to achieve this?
/* Block states (default storage) for model ‘ParentModel’ */
typedef struct {
MdlrefDW_ChildModel_T Instance1;
MdlrefDW_ChildModel_T Instance2;
MdlrefDW_ChildModel_T Instance3;
…
}DW_ParentModel_xxxx_T
ChildModel is having an image processing logic and MdlrefDW_ChildModel_T is having a size of 200MB.
So when the number of instances increases, size of final _DW structure increases significantly.I am generating c code for model reference hierarchy using Embedded Coder.
There are reference models which are called multiple times from a parent model.
In the generated code, the block signals and block states data for each instance of reference model is accumulated in block states data of parent model creating a large structure(which causes compilation error).
I would like to have a single memory allocation(global) for this reference model data and reuse it for all instances.
I tried changing many settings related to code generation/optimization, but could not fix this.
Is there any method to achieve this?
/* Block states (default storage) for model ‘ParentModel’ */
typedef struct {
MdlrefDW_ChildModel_T Instance1;
MdlrefDW_ChildModel_T Instance2;
MdlrefDW_ChildModel_T Instance3;
…
}DW_ParentModel_xxxx_T
ChildModel is having an image processing logic and MdlrefDW_ChildModel_T is having a size of 200MB.
So when the number of instances increases, size of final _DW structure increases significantly. I am generating c code for model reference hierarchy using Embedded Coder.
There are reference models which are called multiple times from a parent model.
In the generated code, the block signals and block states data for each instance of reference model is accumulated in block states data of parent model creating a large structure(which causes compilation error).
I would like to have a single memory allocation(global) for this reference model data and reuse it for all instances.
I tried changing many settings related to code generation/optimization, but could not fix this.
Is there any method to achieve this?
/* Block states (default storage) for model ‘ParentModel’ */
typedef struct {
MdlrefDW_ChildModel_T Instance1;
MdlrefDW_ChildModel_T Instance2;
MdlrefDW_ChildModel_T Instance3;
…
}DW_ParentModel_xxxx_T
ChildModel is having an image processing logic and MdlrefDW_ChildModel_T is having a size of 200MB.
So when the number of instances increases, size of final _DW structure increases significantly. simulink, code generation, reference models, multiinstance, global memory, heap, internal data buffer MATLAB Answers — New Questions
App Slow With UIAxes
Hi. I’m creating apps on app designer which use components such as sliders to control a plot. When plotting on a UIAxes, there is significant delay. However, when having the app plot on a separate figure, there is no delay. Does anyone know the reason for this and if there’s a way to plot on the UIAxes without the delay? Thanks.
I’m going to use an app modelling a cylinder removing a lot of the additional unnecessary stuff, so the type of problem is as clear as possible. The plot consists of surf, patch, and plot3. For all apps, the goal is not plotting data per say, but rather creating shapes, often in 3 dimensions. Therefore, the data is generally arrays of type double which don’t generally get over 100 elements.
I’m using MATLAB R2020a.
These are the two methods:
I drag and drop a UIAxes on to the app and plot on that axis. This takes about 3 seconds to update the plot each time I move the slider. This is a screenshot of the setup:
I create a separate regular figure (not uifigure) and plot it on that. This has almost no delay:
This is the code used to create the separate figure and have them aligned neatly (I don’t think it’s that important but it clarifies what I’m doing):
global ax %needed so it can be accessed through component callbacks
divide=.2;%the fraction of the screen filled by the app
set(0,’units’,’pixels’)
pixels=get(0,’screensize’);
app.UIFigure.Position=[0,0,divide*pixels(3),pixels(4)];
fig=figure; %new figure
fig.Position=[divide*pixels(3),0,(1-divide)*pixels(3),pixels(4)];
ax=axes(fig); %axis it will be plotted on
Here is the code which I used (I removed much of the code used in the original app to simplify things) (the code is based off of Clay M. Thompson’s cylinder function, and I kept the copyright text in the code):
function torsion(ax,ax2,M,G,L,r,display_in)
% Clay M. Thompson 4-24-91, CBM 8-21-92.
% Copyright 1984-2002 The MathWorks, Inc.
cla(ax)
% engineering equations:
J=1/4*r^4;
phi=M*L/(J*G);
% set up cylinder:
n = 50;
r = [r r]’;
r = r(:); % Make sure r is a vector.
m = length(r); if m==1, r = [r;r]; m = 2; end
theta = (0:n)/n*2*pi;
sintheta = sin(theta); sintheta(n+1) = 0;
x = r * cos(theta);
y = r * sintheta;
z = (0:m-1)’/(m-1) *L* ones(1,n+1);
hold(ax,’on’)
% plot cylinder
surf(ax,x,y,z,’EdgeColor’,’none’,’FaceAlpha’,1)
patch(ax,x(1,:),y(1,:),z(1,:),[.25 0 .7])
patch(ax,x(1,:),y(1,:),z(2,:),[.25 0 .7])
%plot helices
z_vals=linspace(0,L,n*L/(2*pi*r(1)));
for i=0:n-1
angle0=i*(2*pi)/n;
anglef=angle0+phi;
theta_part=linspace(angle0,anglef,length(z_vals));
x_part=(r*1.01)*cos(theta_part);
y_part=(r*1.01)*sin(theta_part);
z_vals=linspace(0,L,length(x_part));
plot3(ax,x_part,y_part,z_vals,’k’,’LineWidth’,.5)
end
% plot circles
for i=z_vals
plot3(ax,x,y,i*ones(1,n+1),’k’,’LineWidth’,.5)
end
endHi. I’m creating apps on app designer which use components such as sliders to control a plot. When plotting on a UIAxes, there is significant delay. However, when having the app plot on a separate figure, there is no delay. Does anyone know the reason for this and if there’s a way to plot on the UIAxes without the delay? Thanks.
I’m going to use an app modelling a cylinder removing a lot of the additional unnecessary stuff, so the type of problem is as clear as possible. The plot consists of surf, patch, and plot3. For all apps, the goal is not plotting data per say, but rather creating shapes, often in 3 dimensions. Therefore, the data is generally arrays of type double which don’t generally get over 100 elements.
I’m using MATLAB R2020a.
These are the two methods:
I drag and drop a UIAxes on to the app and plot on that axis. This takes about 3 seconds to update the plot each time I move the slider. This is a screenshot of the setup:
I create a separate regular figure (not uifigure) and plot it on that. This has almost no delay:
This is the code used to create the separate figure and have them aligned neatly (I don’t think it’s that important but it clarifies what I’m doing):
global ax %needed so it can be accessed through component callbacks
divide=.2;%the fraction of the screen filled by the app
set(0,’units’,’pixels’)
pixels=get(0,’screensize’);
app.UIFigure.Position=[0,0,divide*pixels(3),pixels(4)];
fig=figure; %new figure
fig.Position=[divide*pixels(3),0,(1-divide)*pixels(3),pixels(4)];
ax=axes(fig); %axis it will be plotted on
Here is the code which I used (I removed much of the code used in the original app to simplify things) (the code is based off of Clay M. Thompson’s cylinder function, and I kept the copyright text in the code):
function torsion(ax,ax2,M,G,L,r,display_in)
% Clay M. Thompson 4-24-91, CBM 8-21-92.
% Copyright 1984-2002 The MathWorks, Inc.
cla(ax)
% engineering equations:
J=1/4*r^4;
phi=M*L/(J*G);
% set up cylinder:
n = 50;
r = [r r]’;
r = r(:); % Make sure r is a vector.
m = length(r); if m==1, r = [r;r]; m = 2; end
theta = (0:n)/n*2*pi;
sintheta = sin(theta); sintheta(n+1) = 0;
x = r * cos(theta);
y = r * sintheta;
z = (0:m-1)’/(m-1) *L* ones(1,n+1);
hold(ax,’on’)
% plot cylinder
surf(ax,x,y,z,’EdgeColor’,’none’,’FaceAlpha’,1)
patch(ax,x(1,:),y(1,:),z(1,:),[.25 0 .7])
patch(ax,x(1,:),y(1,:),z(2,:),[.25 0 .7])
%plot helices
z_vals=linspace(0,L,n*L/(2*pi*r(1)));
for i=0:n-1
angle0=i*(2*pi)/n;
anglef=angle0+phi;
theta_part=linspace(angle0,anglef,length(z_vals));
x_part=(r*1.01)*cos(theta_part);
y_part=(r*1.01)*sin(theta_part);
z_vals=linspace(0,L,length(x_part));
plot3(ax,x_part,y_part,z_vals,’k’,’LineWidth’,.5)
end
% plot circles
for i=z_vals
plot3(ax,x,y,i*ones(1,n+1),’k’,’LineWidth’,.5)
end
end Hi. I’m creating apps on app designer which use components such as sliders to control a plot. When plotting on a UIAxes, there is significant delay. However, when having the app plot on a separate figure, there is no delay. Does anyone know the reason for this and if there’s a way to plot on the UIAxes without the delay? Thanks.
I’m going to use an app modelling a cylinder removing a lot of the additional unnecessary stuff, so the type of problem is as clear as possible. The plot consists of surf, patch, and plot3. For all apps, the goal is not plotting data per say, but rather creating shapes, often in 3 dimensions. Therefore, the data is generally arrays of type double which don’t generally get over 100 elements.
I’m using MATLAB R2020a.
These are the two methods:
I drag and drop a UIAxes on to the app and plot on that axis. This takes about 3 seconds to update the plot each time I move the slider. This is a screenshot of the setup:
I create a separate regular figure (not uifigure) and plot it on that. This has almost no delay:
This is the code used to create the separate figure and have them aligned neatly (I don’t think it’s that important but it clarifies what I’m doing):
global ax %needed so it can be accessed through component callbacks
divide=.2;%the fraction of the screen filled by the app
set(0,’units’,’pixels’)
pixels=get(0,’screensize’);
app.UIFigure.Position=[0,0,divide*pixels(3),pixels(4)];
fig=figure; %new figure
fig.Position=[divide*pixels(3),0,(1-divide)*pixels(3),pixels(4)];
ax=axes(fig); %axis it will be plotted on
Here is the code which I used (I removed much of the code used in the original app to simplify things) (the code is based off of Clay M. Thompson’s cylinder function, and I kept the copyright text in the code):
function torsion(ax,ax2,M,G,L,r,display_in)
% Clay M. Thompson 4-24-91, CBM 8-21-92.
% Copyright 1984-2002 The MathWorks, Inc.
cla(ax)
% engineering equations:
J=1/4*r^4;
phi=M*L/(J*G);
% set up cylinder:
n = 50;
r = [r r]’;
r = r(:); % Make sure r is a vector.
m = length(r); if m==1, r = [r;r]; m = 2; end
theta = (0:n)/n*2*pi;
sintheta = sin(theta); sintheta(n+1) = 0;
x = r * cos(theta);
y = r * sintheta;
z = (0:m-1)’/(m-1) *L* ones(1,n+1);
hold(ax,’on’)
% plot cylinder
surf(ax,x,y,z,’EdgeColor’,’none’,’FaceAlpha’,1)
patch(ax,x(1,:),y(1,:),z(1,:),[.25 0 .7])
patch(ax,x(1,:),y(1,:),z(2,:),[.25 0 .7])
%plot helices
z_vals=linspace(0,L,n*L/(2*pi*r(1)));
for i=0:n-1
angle0=i*(2*pi)/n;
anglef=angle0+phi;
theta_part=linspace(angle0,anglef,length(z_vals));
x_part=(r*1.01)*cos(theta_part);
y_part=(r*1.01)*sin(theta_part);
z_vals=linspace(0,L,length(x_part));
plot3(ax,x_part,y_part,z_vals,’k’,’LineWidth’,.5)
end
% plot circles
for i=z_vals
plot3(ax,x,y,i*ones(1,n+1),’k’,’LineWidth’,.5)
end
end app designer, plot, axes, delay MATLAB Answers — New Questions
DIVIDING A SIGNAL INTO SHORTER SEGMENTS AND SAVING THEM
Hello, I have a signal of 30 minutes duration. It is a csv file. I want to divide it into non overlapping segments of 10 sec duration and save them as different recordings. The sampling frequency of the signal is 360 Hz. How can I achieve this in matlab?Hello, I have a signal of 30 minutes duration. It is a csv file. I want to divide it into non overlapping segments of 10 sec duration and save them as different recordings. The sampling frequency of the signal is 360 Hz. How can I achieve this in matlab? Hello, I have a signal of 30 minutes duration. It is a csv file. I want to divide it into non overlapping segments of 10 sec duration and save them as different recordings. The sampling frequency of the signal is 360 Hz. How can I achieve this in matlab? signal manipulation, signal processing, segmentation MATLAB Answers — New Questions
Issues connecting MATLAB to Turtlebot4
I am trying to connect MATLAB R2023b on Ubuntu 22.04 to my Turtlebot4 using:
rosinit("http://192.168.1.3:11311");
I have checked my ROS_MASTER_URI on both my PC and the RPi.
On my PC:
$ echo $ROS_MASTER_URI
http://localhost:11311
On my RPi:
$ echo $ROS_MASTER_URI
http://192.168.1.3:11311
When I tried to do rosinit, MATLAB outputs the error:
Cannot connect to ROS master at http://192.168.1.3:11311. Check the specified address or hostname.
Am I missing something here? Any help would be greatly appreciated!I am trying to connect MATLAB R2023b on Ubuntu 22.04 to my Turtlebot4 using:
rosinit("http://192.168.1.3:11311");
I have checked my ROS_MASTER_URI on both my PC and the RPi.
On my PC:
$ echo $ROS_MASTER_URI
http://localhost:11311
On my RPi:
$ echo $ROS_MASTER_URI
http://192.168.1.3:11311
When I tried to do rosinit, MATLAB outputs the error:
Cannot connect to ROS master at http://192.168.1.3:11311. Check the specified address or hostname.
Am I missing something here? Any help would be greatly appreciated! I am trying to connect MATLAB R2023b on Ubuntu 22.04 to my Turtlebot4 using:
rosinit("http://192.168.1.3:11311");
I have checked my ROS_MASTER_URI on both my PC and the RPi.
On my PC:
$ echo $ROS_MASTER_URI
http://localhost:11311
On my RPi:
$ echo $ROS_MASTER_URI
http://192.168.1.3:11311
When I tried to do rosinit, MATLAB outputs the error:
Cannot connect to ROS master at http://192.168.1.3:11311. Check the specified address or hostname.
Am I missing something here? Any help would be greatly appreciated! matlab, ros2, turtlebot4 MATLAB Answers — New Questions
How getting Atlas image from fMRI images.
Hello everyone,
I am currently working on medical images resting state fMRI from Dhcp( Developing Human Connectome Project) datasets and i need to get their Atlas images using fMRI. But whenever I am trying i could not implement or find a code MATLAB to do it, this is really a new thing for me i never work on it. Please Can anyone suugest me what can i do or from where can i start ? I really need help. Thanks in advance!Hello everyone,
I am currently working on medical images resting state fMRI from Dhcp( Developing Human Connectome Project) datasets and i need to get their Atlas images using fMRI. But whenever I am trying i could not implement or find a code MATLAB to do it, this is really a new thing for me i never work on it. Please Can anyone suugest me what can i do or from where can i start ? I really need help. Thanks in advance! Hello everyone,
I am currently working on medical images resting state fMRI from Dhcp( Developing Human Connectome Project) datasets and i need to get their Atlas images using fMRI. But whenever I am trying i could not implement or find a code MATLAB to do it, this is really a new thing for me i never work on it. Please Can anyone suugest me what can i do or from where can i start ? I really need help. Thanks in advance! atlas images, fmri MATLAB Answers — New Questions
how to display a grayscale image in a monochrome color (other than white)
I have a grayscale image consisting of a matrix of 512×512 int16 numbers. If I run
figure;imshow(imagedata,[])
I can see my contrast adjusted image. Now all I want to do is to display this image by replacing white with green. I do not want to change the datatype to double or do something that would mess with the original data.
My first thought was to just look at the colormap and ideally that should look like
[0 0 0]
[1 1 1]
….
[255 255 255]
I thought I could just change that to be
[0 0 0]
[0 1 0]
…..
[0 255 0]
but when I take a look at the colormap of this grayscale image,
map = colormap;
the colormap has non-zero numbers (which are not equal to each other) in each of the r,g and b columns and so I don’t understand this. The grayscale colormap is supposed to have the same numbers in the r,g and b columns.
All I want to do is to tell matlab that the highest number maps to green instead of white. What is the easiest way of doing this?I have a grayscale image consisting of a matrix of 512×512 int16 numbers. If I run
figure;imshow(imagedata,[])
I can see my contrast adjusted image. Now all I want to do is to display this image by replacing white with green. I do not want to change the datatype to double or do something that would mess with the original data.
My first thought was to just look at the colormap and ideally that should look like
[0 0 0]
[1 1 1]
….
[255 255 255]
I thought I could just change that to be
[0 0 0]
[0 1 0]
…..
[0 255 0]
but when I take a look at the colormap of this grayscale image,
map = colormap;
the colormap has non-zero numbers (which are not equal to each other) in each of the r,g and b columns and so I don’t understand this. The grayscale colormap is supposed to have the same numbers in the r,g and b columns.
All I want to do is to tell matlab that the highest number maps to green instead of white. What is the easiest way of doing this? I have a grayscale image consisting of a matrix of 512×512 int16 numbers. If I run
figure;imshow(imagedata,[])
I can see my contrast adjusted image. Now all I want to do is to display this image by replacing white with green. I do not want to change the datatype to double or do something that would mess with the original data.
My first thought was to just look at the colormap and ideally that should look like
[0 0 0]
[1 1 1]
….
[255 255 255]
I thought I could just change that to be
[0 0 0]
[0 1 0]
…..
[0 255 0]
but when I take a look at the colormap of this grayscale image,
map = colormap;
the colormap has non-zero numbers (which are not equal to each other) in each of the r,g and b columns and so I don’t understand this. The grayscale colormap is supposed to have the same numbers in the r,g and b columns.
All I want to do is to tell matlab that the highest number maps to green instead of white. What is the easiest way of doing this? image processing, colormap MATLAB Answers — New Questions
solving system of equations
Tried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
endTried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
end Tried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
end ode MATLAB Answers — New Questions
solving system of equations
Tried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
endTried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
end Tried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
end ode MATLAB Answers — New Questions
solving system of equations
Tried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
endTried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
end Tried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
end ode MATLAB Answers — New Questions
solving system of equations
Tried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
endTried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
end Tried to get this to work but have had no luck.
Main Code:
syms x K M c1 c2 c3 c4
x0 = [0,0,0,0];
y0 = [1,200,-80,900];
coeff = [1,-0.02,12.5,-0.058,27.77];
rx = -0.05*exp(0.005*x)*cos(11.7*x) + 0.07*exp(0.005*x)*sin(11.7*x);
y_new = Examprac(x0,y0,coeff,rx);
Function:
function y = Examprac(x0,y0,coeff,rx)
syms x c1 c2 c3 c4 K M
yp = 2*K*cos((117*x)/10)*exp(x/200) + 2*M*sin((117*x)/10)*exp(x/200);
yp_der1 = diff(yp);
yp_der2 = diff(yp_der1);
yp_der3 = diff(yp_der2);
yp_der4 = diff(yp_der3);
yp_der1= simplify(yp_der1);
yp_der2= simplify(yp_der2);
yp_der3= simplify(yp_der3);
yp_der4= simplify(yp_der4);
g = simplify(coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx)
g = coeff(1)*yp_der4 + coeff(2)*yp_der3 + coeff(3)*yp_der2 + coeff(4)*yp_der1 + coeff(5)*yp == rx
C = solve(g, [M, K])
end ode MATLAB Answers — New Questions
how to display a grayscale image in a monochrome color (other than white)
I have a grayscale image consisting of a matrix of 512×512 int16 numbers. If I run
figure;imshow(imagedata,[])
I can see my contrast adjusted image. Now all I want to do is to display this image by replacing white with green. I do not want to change the datatype to double or do something that would mess with the original data.
My first thought was to just look at the colormap and ideally that should look like
[0 0 0]
[1 1 1]
….
[255 255 255]
I thought I could just change that to be
[0 0 0]
[0 1 0]
…..
[0 255 0]
but when I take a look at the colormap of this grayscale image,
map = colormap;
the colormap has non-zero numbers (which are not equal to each other) in each of the r,g and b columns and so I don’t understand this. The grayscale colormap is supposed to have the same numbers in the r,g and b columns.
All I want to do is to tell matlab that the highest number maps to green instead of white. What is the easiest way of doing this?I have a grayscale image consisting of a matrix of 512×512 int16 numbers. If I run
figure;imshow(imagedata,[])
I can see my contrast adjusted image. Now all I want to do is to display this image by replacing white with green. I do not want to change the datatype to double or do something that would mess with the original data.
My first thought was to just look at the colormap and ideally that should look like
[0 0 0]
[1 1 1]
….
[255 255 255]
I thought I could just change that to be
[0 0 0]
[0 1 0]
…..
[0 255 0]
but when I take a look at the colormap of this grayscale image,
map = colormap;
the colormap has non-zero numbers (which are not equal to each other) in each of the r,g and b columns and so I don’t understand this. The grayscale colormap is supposed to have the same numbers in the r,g and b columns.
All I want to do is to tell matlab that the highest number maps to green instead of white. What is the easiest way of doing this? I have a grayscale image consisting of a matrix of 512×512 int16 numbers. If I run
figure;imshow(imagedata,[])
I can see my contrast adjusted image. Now all I want to do is to display this image by replacing white with green. I do not want to change the datatype to double or do something that would mess with the original data.
My first thought was to just look at the colormap and ideally that should look like
[0 0 0]
[1 1 1]
….
[255 255 255]
I thought I could just change that to be
[0 0 0]
[0 1 0]
…..
[0 255 0]
but when I take a look at the colormap of this grayscale image,
map = colormap;
the colormap has non-zero numbers (which are not equal to each other) in each of the r,g and b columns and so I don’t understand this. The grayscale colormap is supposed to have the same numbers in the r,g and b columns.
All I want to do is to tell matlab that the highest number maps to green instead of white. What is the easiest way of doing this? image processing, colormap MATLAB Answers — New Questions
How to visualize histogram
num_simulations = 10000;
%Common parameters
Discount_Rate_min = 0.06; % assume 6-8%
Discount_Rate_max = 0.08;
Discount_Rate_values = unifrnd(Discount_Rate_min, Discount_Rate_max, [num_simulations, 1]);
Lifetime = 20; % years
Electricity_Cost_values = 0.185; %EUR/kWh
FLH = [4000,6000,8000];
LHV = 33.33; %kWh/kgH2
%SOEC 2020 parameters
CAPEX_System_SOEC_mean_2020 = 4200; %$/kW
CAPEX_System_SOEC_std_2020 = 50;
CAPEX_System_SOEC_values_2020 = normrnd(CAPEX_System_SOEC_mean_2020, CAPEX_System_SOEC_std_2020, [num_simulations,1]);
CAPEX_System_SOEC_values_2020(CAPEX_System_SOEC_values_2020 < 2800) = 2800;
CAPEX_System_SOEC_values_2020(CAPEX_System_SOEC_values_2020 > 5600) = 5600;
CAPEX_Stack_SOEC_values_2020 = 0.5*CAPEX_System_SOEC_values_2020; % 50% of CAPEX system
CAPEX_SOEC_values_2020 = (CAPEX_System_SOEC_values_2020 + CAPEX_Stack_SOEC_values_2020);
OPEX_SOEC_values_2020 = 3; % 3% of CAPEX/a
System_Efficiency_SOEC_mean_2020 = 0.775;
System_Efficiency_SOEC_std_2020 = 0.01;
System_Efficiency_SOEC_values_2020 = normrnd(System_Efficiency_SOEC_mean_2020, System_Efficiency_SOEC_std_2020, [num_simulations,1]);
System_Efficiency_SOEC_values_2020(System_Efficiency_SOEC_values_2020 < 0.74) = 0.74;
System_Efficiency_SOEC_values_2020(System_Efficiency_SOEC_values_2020 > 0.81) = 0.81;
%SOEC 2030 parameters
CAPEX_System_SOEC_mean_2030 = 1800; %$/kW
CAPEX_System_SOEC_std_2030 = 50;
CAPEX_System_SOEC_values_2030 = normrnd(CAPEX_System_SOEC_mean_2030, CAPEX_System_SOEC_std_2030, [num_simulations,1]);
CAPEX_System_SOEC_values_2030(CAPEX_System_SOEC_values_2030 < 2800) = 800;
CAPEX_System_SOEC_values_2030(CAPEX_System_SOEC_values_2030 > 5600) = 2800;
CAPEX_Stack_SOEC_values_2030 = 0.5*CAPEX_System_SOEC_values_2030; % 50% of CAPEX system
CAPEX_SOEC_values_2030 = (CAPEX_System_SOEC_values_2030 + CAPEX_Stack_SOEC_values_2030);
OPEX_SOEC_values_2030 = 3; % 3% of CAPEX/a
System_Efficiency_SOEC_mean_2030 = 0.805;
System_Efficiency_SOEC_std_2030 = 0.01;
System_Efficiency_SOEC_values_2030 = normrnd(System_Efficiency_SOEC_mean_2030, System_Efficiency_SOEC_std_2030, [num_simulations,1]);
System_Efficiency_SOEC_values_2030(System_Efficiency_SOEC_values_2030 < 0.77) = 0.77;
System_Efficiency_SOEC_values_2030(System_Efficiency_SOEC_values_2030 > 0.84) = 0.84;
%PEM 2020 parameters
CAPEX_System_PEM_mean_2020 = 1450; %$/kW
CAPEX_System_PEM_std_2020 = 50;
CAPEX_System_PEM_values_2020 = normrnd(CAPEX_System_PEM_mean_2020, CAPEX_System_PEM_std_2020, [num_simulations,1]);
CAPEX_System_PEM_values_2020(CAPEX_System_PEM_values_2020 < 1100) = 1100;
CAPEX_System_PEM_values_2020(CAPEX_System_PEM_values_2020 > 1800) = 1800;
CAPEX_Stack_PEM_values_2020 = 0.35*CAPEX_System_PEM_values_2020; % 35% of CAPEX system
CAPEX_PEM_values_2020 = (CAPEX_System_PEM_values_2020 + CAPEX_Stack_PEM_values_2020);
OPEX_PEM_values_2020 = 3;
System_Efficiency_PEM_mean_2020 = 0.58;
System_Efficiency_PEM_std_2020 = 0.01;
System_Efficiency_PEM_values_2020 = normrnd(System_Efficiency_PEM_mean_2020, System_Efficiency_PEM_std_2020, [num_simulations,1]);
System_Efficiency_PEM_values_2020(System_Efficiency_PEM_values_2020 < 0.56) = 0.56;
System_Efficiency_PEM_values_2020(System_Efficiency_PEM_values_2020 > 0.6) = 0.6;
%PEM 2030 parameters
CAPEX_System_PEM_mean_2030 = 1075; %$/kW
CAPEX_System_PEM_std_2030 = 50;
CAPEX_System_PEM_values_2030 = normrnd(CAPEX_System_PEM_mean_2030, CAPEX_System_PEM_std_2030, [num_simulations,1]);
CAPEX_System_PEM_values_2030(CAPEX_System_PEM_values_2030 < 650) = 650;
CAPEX_System_PEM_values_2030(CAPEX_System_PEM_values_2030 > 1500) = 1500;
CAPEX_Stack_PEM_values_2030 = 0.35*CAPEX_System_PEM_values_2030; % 35% of CAPEX system
CAPEX_PEM_values_2030 = (CAPEX_System_PEM_values_2030 + CAPEX_Stack_PEM_values_2030);
OPEX_PEM_values_2030 = 3;
System_Efficiency_PEM_mean_2030 = 0.655;
System_Efficiency_PEM_std_2030 = 0.01;
System_Efficiency_PEM_values_2030 = normrnd(System_Efficiency_PEM_mean_2030, System_Efficiency_PEM_std_2030, [num_simulations,1]);
System_Efficiency_PEM_values_2030(System_Efficiency_PEM_values_2030 < 0.63) = 0.63;
System_Efficiency_PEM_values_2030(System_Efficiency_PEM_values_2030 > 0.68) = 0.68;
%AEC 2020 parameters
CAPEX_System_AEC_mean_2020 = 950; % $/kW
CAPEX_System_AEC_std_2020 = 50;
CAPEX_System_AEC_values_2020 = normrnd(CAPEX_System_AEC_mean_2020, CAPEX_System_AEC_std_2020, [num_simulations,1]);
CAPEX_System_AEC_values_2020(CAPEX_System_AEC_values_2020 < 500) = 500;
CAPEX_System_AEC_values_2020(CAPEX_System_AEC_values_2020 > 1400) = 1400;
CAPEX_Stack_AEC_values_2020 = 0.35*CAPEX_System_AEC_values_2020; % 35% of CAPEX system
CAPEX_AEC_values_2020 = (CAPEX_System_AEC_values_2020 + CAPEX_Stack_AEC_values_2020);
OPEX_AEC_values_2020 = 3;
System_Efficiency_AEC_mean_2020 = 0.665;
System_Efficiency_AEC_std_2020 = 0.01;
System_Efficiency_AEC_values_2020 = normrnd(System_Efficiency_AEC_mean_2020, System_Efficiency_AEC_std_2020, [num_simulations,1]);
System_Efficiency_AEC_values_2020(System_Efficiency_AEC_values_2020 < 0.63) = 0.63;
System_Efficiency_AEC_values_2020(System_Efficiency_AEC_values_2020 > 0.7) = 0.7;
%AEC 2030 parameters
CAPEX_System_AEC_mean_2030 = 625; % $/kW
CAPEX_System_AEC_std_2030 = 50;
CAPEX_System_AEC_values_2030 = normrnd(CAPEX_System_AEC_mean_2030, CAPEX_System_AEC_std_2030, [num_simulations,1]);
CAPEX_System_AEC_values_2030(CAPEX_System_AEC_values_2030 < 400) = 400;
CAPEX_System_AEC_values_2030(CAPEX_System_AEC_values_2030 > 850) = 850;
CAPEX_Stack_AEC_values_2030 = 0.35*CAPEX_System_AEC_values_2030; % 35% of CAPEX system
CAPEX_AEC_values_2030 = (CAPEX_System_AEC_values_2030 + CAPEX_Stack_AEC_values_2030);
OPEX_AEC_values_2030 = 3;
System_Efficiency_AEC_mean_2030 = 0.68;
System_Efficiency_AEC_std_2030 = 0.01;
System_Efficiency_AEC_values_2030 = normrnd(System_Efficiency_AEC_mean_2030, System_Efficiency_AEC_std_2030, [num_simulations,1]);
System_Efficiency_AEC_values_2030(System_Efficiency_AEC_values_2030 < 0.65) = 0.65;
System_Efficiency_AEC_values_2030(System_Efficiency_AEC_values_2030 > 0.71) = 0.71;
% Calculate 2020 SOEC LCOH values
term1_S_2020 = LHV ./ (System_Efficiency_SOEC_values_2020);
term2_S_2020 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_S_2020 = (OPEX_SOEC_values_2020 / 100);
term4_S_2020 = CAPEX_SOEC_values_2020 ./ FLH;
LCOH_SOEC_2020 = term1_S_2020 .* ((term2_S_2020 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_S_2020) .* term4_S_2020 + Electricity_Cost_values);
% Calculate 2020 PEM LCOH values
term1_P_2020 = LHV ./ (System_Efficiency_PEM_values_2020);
term2_P_2020 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_P_2020 = (OPEX_PEM_values_2020 / 100);
term4_P_2020 = CAPEX_PEM_values_2020 ./ FLH;
LCOH_PEM_2020 = term1_P_2020 .* ((term2_P_2020 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_P_2020) .* term4_P_2020 + Electricity_Cost_values);
% Calculate 2020 AEC LCOH values
term1_A_2020 = LHV ./ (System_Efficiency_AEC_values_2020);
term2_A_2020 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_A_2020 = (OPEX_AEC_values_2020 / 100);
term4_A_2020 = CAPEX_AEC_values_2020 ./ FLH;
LCOH_AEC_2020 = term1_A_2020 .* ((term2_A_2020 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_A_2020) .* term4_A_2020 + Electricity_Cost_values);
% Calculate 2030 SOEC LCOH values
term1_S_2030 = LHV ./ (System_Efficiency_SOEC_values_2030);
term2_S_2030 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_S_2030 = (OPEX_SOEC_values_2030 / 100);
term4_S_2030 = CAPEX_SOEC_values_2030 ./ FLH;
LCOH_SOEC_2030 = term1_S_2030 .* ((term2_S_2030 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_S_2030) .* term4_S_2030 + Electricity_Cost_values);
% Calculate 2030 PEM LCOH values
term1_P_2030 = LHV ./ (System_Efficiency_PEM_values_2030);
term2_P_2030 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_P_2030 = (OPEX_PEM_values_2030 / 100);
term4_P_2030 = CAPEX_PEM_values_2030 ./ FLH;
LCOH_PEM_2030 = term1_P_2030 .* ((term2_P_2030 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_P_2030) .* term4_P_2030 + Electricity_Cost_values);
% Calculate 2030 AEC LCOH values
term1_A_2030 = LHV ./ (System_Efficiency_AEC_values_2030);
term2_A_2030 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_A_2030 = (OPEX_AEC_values_2030 / 100);
term4_A_2030 = CAPEX_AEC_values_2030 ./ FLH;
LCOH_AEC_2030 = term1_A_2030 .* ((term2_A_2030 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_A_2030) .* term4_A_2030 + Electricity_Cost_values);
Using the code data, I would like to compare LCOH of six items with histogram.
Image is like the picture.
What is command for it?num_simulations = 10000;
%Common parameters
Discount_Rate_min = 0.06; % assume 6-8%
Discount_Rate_max = 0.08;
Discount_Rate_values = unifrnd(Discount_Rate_min, Discount_Rate_max, [num_simulations, 1]);
Lifetime = 20; % years
Electricity_Cost_values = 0.185; %EUR/kWh
FLH = [4000,6000,8000];
LHV = 33.33; %kWh/kgH2
%SOEC 2020 parameters
CAPEX_System_SOEC_mean_2020 = 4200; %$/kW
CAPEX_System_SOEC_std_2020 = 50;
CAPEX_System_SOEC_values_2020 = normrnd(CAPEX_System_SOEC_mean_2020, CAPEX_System_SOEC_std_2020, [num_simulations,1]);
CAPEX_System_SOEC_values_2020(CAPEX_System_SOEC_values_2020 < 2800) = 2800;
CAPEX_System_SOEC_values_2020(CAPEX_System_SOEC_values_2020 > 5600) = 5600;
CAPEX_Stack_SOEC_values_2020 = 0.5*CAPEX_System_SOEC_values_2020; % 50% of CAPEX system
CAPEX_SOEC_values_2020 = (CAPEX_System_SOEC_values_2020 + CAPEX_Stack_SOEC_values_2020);
OPEX_SOEC_values_2020 = 3; % 3% of CAPEX/a
System_Efficiency_SOEC_mean_2020 = 0.775;
System_Efficiency_SOEC_std_2020 = 0.01;
System_Efficiency_SOEC_values_2020 = normrnd(System_Efficiency_SOEC_mean_2020, System_Efficiency_SOEC_std_2020, [num_simulations,1]);
System_Efficiency_SOEC_values_2020(System_Efficiency_SOEC_values_2020 < 0.74) = 0.74;
System_Efficiency_SOEC_values_2020(System_Efficiency_SOEC_values_2020 > 0.81) = 0.81;
%SOEC 2030 parameters
CAPEX_System_SOEC_mean_2030 = 1800; %$/kW
CAPEX_System_SOEC_std_2030 = 50;
CAPEX_System_SOEC_values_2030 = normrnd(CAPEX_System_SOEC_mean_2030, CAPEX_System_SOEC_std_2030, [num_simulations,1]);
CAPEX_System_SOEC_values_2030(CAPEX_System_SOEC_values_2030 < 2800) = 800;
CAPEX_System_SOEC_values_2030(CAPEX_System_SOEC_values_2030 > 5600) = 2800;
CAPEX_Stack_SOEC_values_2030 = 0.5*CAPEX_System_SOEC_values_2030; % 50% of CAPEX system
CAPEX_SOEC_values_2030 = (CAPEX_System_SOEC_values_2030 + CAPEX_Stack_SOEC_values_2030);
OPEX_SOEC_values_2030 = 3; % 3% of CAPEX/a
System_Efficiency_SOEC_mean_2030 = 0.805;
System_Efficiency_SOEC_std_2030 = 0.01;
System_Efficiency_SOEC_values_2030 = normrnd(System_Efficiency_SOEC_mean_2030, System_Efficiency_SOEC_std_2030, [num_simulations,1]);
System_Efficiency_SOEC_values_2030(System_Efficiency_SOEC_values_2030 < 0.77) = 0.77;
System_Efficiency_SOEC_values_2030(System_Efficiency_SOEC_values_2030 > 0.84) = 0.84;
%PEM 2020 parameters
CAPEX_System_PEM_mean_2020 = 1450; %$/kW
CAPEX_System_PEM_std_2020 = 50;
CAPEX_System_PEM_values_2020 = normrnd(CAPEX_System_PEM_mean_2020, CAPEX_System_PEM_std_2020, [num_simulations,1]);
CAPEX_System_PEM_values_2020(CAPEX_System_PEM_values_2020 < 1100) = 1100;
CAPEX_System_PEM_values_2020(CAPEX_System_PEM_values_2020 > 1800) = 1800;
CAPEX_Stack_PEM_values_2020 = 0.35*CAPEX_System_PEM_values_2020; % 35% of CAPEX system
CAPEX_PEM_values_2020 = (CAPEX_System_PEM_values_2020 + CAPEX_Stack_PEM_values_2020);
OPEX_PEM_values_2020 = 3;
System_Efficiency_PEM_mean_2020 = 0.58;
System_Efficiency_PEM_std_2020 = 0.01;
System_Efficiency_PEM_values_2020 = normrnd(System_Efficiency_PEM_mean_2020, System_Efficiency_PEM_std_2020, [num_simulations,1]);
System_Efficiency_PEM_values_2020(System_Efficiency_PEM_values_2020 < 0.56) = 0.56;
System_Efficiency_PEM_values_2020(System_Efficiency_PEM_values_2020 > 0.6) = 0.6;
%PEM 2030 parameters
CAPEX_System_PEM_mean_2030 = 1075; %$/kW
CAPEX_System_PEM_std_2030 = 50;
CAPEX_System_PEM_values_2030 = normrnd(CAPEX_System_PEM_mean_2030, CAPEX_System_PEM_std_2030, [num_simulations,1]);
CAPEX_System_PEM_values_2030(CAPEX_System_PEM_values_2030 < 650) = 650;
CAPEX_System_PEM_values_2030(CAPEX_System_PEM_values_2030 > 1500) = 1500;
CAPEX_Stack_PEM_values_2030 = 0.35*CAPEX_System_PEM_values_2030; % 35% of CAPEX system
CAPEX_PEM_values_2030 = (CAPEX_System_PEM_values_2030 + CAPEX_Stack_PEM_values_2030);
OPEX_PEM_values_2030 = 3;
System_Efficiency_PEM_mean_2030 = 0.655;
System_Efficiency_PEM_std_2030 = 0.01;
System_Efficiency_PEM_values_2030 = normrnd(System_Efficiency_PEM_mean_2030, System_Efficiency_PEM_std_2030, [num_simulations,1]);
System_Efficiency_PEM_values_2030(System_Efficiency_PEM_values_2030 < 0.63) = 0.63;
System_Efficiency_PEM_values_2030(System_Efficiency_PEM_values_2030 > 0.68) = 0.68;
%AEC 2020 parameters
CAPEX_System_AEC_mean_2020 = 950; % $/kW
CAPEX_System_AEC_std_2020 = 50;
CAPEX_System_AEC_values_2020 = normrnd(CAPEX_System_AEC_mean_2020, CAPEX_System_AEC_std_2020, [num_simulations,1]);
CAPEX_System_AEC_values_2020(CAPEX_System_AEC_values_2020 < 500) = 500;
CAPEX_System_AEC_values_2020(CAPEX_System_AEC_values_2020 > 1400) = 1400;
CAPEX_Stack_AEC_values_2020 = 0.35*CAPEX_System_AEC_values_2020; % 35% of CAPEX system
CAPEX_AEC_values_2020 = (CAPEX_System_AEC_values_2020 + CAPEX_Stack_AEC_values_2020);
OPEX_AEC_values_2020 = 3;
System_Efficiency_AEC_mean_2020 = 0.665;
System_Efficiency_AEC_std_2020 = 0.01;
System_Efficiency_AEC_values_2020 = normrnd(System_Efficiency_AEC_mean_2020, System_Efficiency_AEC_std_2020, [num_simulations,1]);
System_Efficiency_AEC_values_2020(System_Efficiency_AEC_values_2020 < 0.63) = 0.63;
System_Efficiency_AEC_values_2020(System_Efficiency_AEC_values_2020 > 0.7) = 0.7;
%AEC 2030 parameters
CAPEX_System_AEC_mean_2030 = 625; % $/kW
CAPEX_System_AEC_std_2030 = 50;
CAPEX_System_AEC_values_2030 = normrnd(CAPEX_System_AEC_mean_2030, CAPEX_System_AEC_std_2030, [num_simulations,1]);
CAPEX_System_AEC_values_2030(CAPEX_System_AEC_values_2030 < 400) = 400;
CAPEX_System_AEC_values_2030(CAPEX_System_AEC_values_2030 > 850) = 850;
CAPEX_Stack_AEC_values_2030 = 0.35*CAPEX_System_AEC_values_2030; % 35% of CAPEX system
CAPEX_AEC_values_2030 = (CAPEX_System_AEC_values_2030 + CAPEX_Stack_AEC_values_2030);
OPEX_AEC_values_2030 = 3;
System_Efficiency_AEC_mean_2030 = 0.68;
System_Efficiency_AEC_std_2030 = 0.01;
System_Efficiency_AEC_values_2030 = normrnd(System_Efficiency_AEC_mean_2030, System_Efficiency_AEC_std_2030, [num_simulations,1]);
System_Efficiency_AEC_values_2030(System_Efficiency_AEC_values_2030 < 0.65) = 0.65;
System_Efficiency_AEC_values_2030(System_Efficiency_AEC_values_2030 > 0.71) = 0.71;
% Calculate 2020 SOEC LCOH values
term1_S_2020 = LHV ./ (System_Efficiency_SOEC_values_2020);
term2_S_2020 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_S_2020 = (OPEX_SOEC_values_2020 / 100);
term4_S_2020 = CAPEX_SOEC_values_2020 ./ FLH;
LCOH_SOEC_2020 = term1_S_2020 .* ((term2_S_2020 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_S_2020) .* term4_S_2020 + Electricity_Cost_values);
% Calculate 2020 PEM LCOH values
term1_P_2020 = LHV ./ (System_Efficiency_PEM_values_2020);
term2_P_2020 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_P_2020 = (OPEX_PEM_values_2020 / 100);
term4_P_2020 = CAPEX_PEM_values_2020 ./ FLH;
LCOH_PEM_2020 = term1_P_2020 .* ((term2_P_2020 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_P_2020) .* term4_P_2020 + Electricity_Cost_values);
% Calculate 2020 AEC LCOH values
term1_A_2020 = LHV ./ (System_Efficiency_AEC_values_2020);
term2_A_2020 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_A_2020 = (OPEX_AEC_values_2020 / 100);
term4_A_2020 = CAPEX_AEC_values_2020 ./ FLH;
LCOH_AEC_2020 = term1_A_2020 .* ((term2_A_2020 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_A_2020) .* term4_A_2020 + Electricity_Cost_values);
% Calculate 2030 SOEC LCOH values
term1_S_2030 = LHV ./ (System_Efficiency_SOEC_values_2030);
term2_S_2030 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_S_2030 = (OPEX_SOEC_values_2030 / 100);
term4_S_2030 = CAPEX_SOEC_values_2030 ./ FLH;
LCOH_SOEC_2030 = term1_S_2030 .* ((term2_S_2030 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_S_2030) .* term4_S_2030 + Electricity_Cost_values);
% Calculate 2030 PEM LCOH values
term1_P_2030 = LHV ./ (System_Efficiency_PEM_values_2030);
term2_P_2030 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_P_2030 = (OPEX_PEM_values_2030 / 100);
term4_P_2030 = CAPEX_PEM_values_2030 ./ FLH;
LCOH_PEM_2030 = term1_P_2030 .* ((term2_P_2030 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_P_2030) .* term4_P_2030 + Electricity_Cost_values);
% Calculate 2030 AEC LCOH values
term1_A_2030 = LHV ./ (System_Efficiency_AEC_values_2030);
term2_A_2030 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_A_2030 = (OPEX_AEC_values_2030 / 100);
term4_A_2030 = CAPEX_AEC_values_2030 ./ FLH;
LCOH_AEC_2030 = term1_A_2030 .* ((term2_A_2030 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_A_2030) .* term4_A_2030 + Electricity_Cost_values);
Using the code data, I would like to compare LCOH of six items with histogram.
Image is like the picture.
What is command for it? num_simulations = 10000;
%Common parameters
Discount_Rate_min = 0.06; % assume 6-8%
Discount_Rate_max = 0.08;
Discount_Rate_values = unifrnd(Discount_Rate_min, Discount_Rate_max, [num_simulations, 1]);
Lifetime = 20; % years
Electricity_Cost_values = 0.185; %EUR/kWh
FLH = [4000,6000,8000];
LHV = 33.33; %kWh/kgH2
%SOEC 2020 parameters
CAPEX_System_SOEC_mean_2020 = 4200; %$/kW
CAPEX_System_SOEC_std_2020 = 50;
CAPEX_System_SOEC_values_2020 = normrnd(CAPEX_System_SOEC_mean_2020, CAPEX_System_SOEC_std_2020, [num_simulations,1]);
CAPEX_System_SOEC_values_2020(CAPEX_System_SOEC_values_2020 < 2800) = 2800;
CAPEX_System_SOEC_values_2020(CAPEX_System_SOEC_values_2020 > 5600) = 5600;
CAPEX_Stack_SOEC_values_2020 = 0.5*CAPEX_System_SOEC_values_2020; % 50% of CAPEX system
CAPEX_SOEC_values_2020 = (CAPEX_System_SOEC_values_2020 + CAPEX_Stack_SOEC_values_2020);
OPEX_SOEC_values_2020 = 3; % 3% of CAPEX/a
System_Efficiency_SOEC_mean_2020 = 0.775;
System_Efficiency_SOEC_std_2020 = 0.01;
System_Efficiency_SOEC_values_2020 = normrnd(System_Efficiency_SOEC_mean_2020, System_Efficiency_SOEC_std_2020, [num_simulations,1]);
System_Efficiency_SOEC_values_2020(System_Efficiency_SOEC_values_2020 < 0.74) = 0.74;
System_Efficiency_SOEC_values_2020(System_Efficiency_SOEC_values_2020 > 0.81) = 0.81;
%SOEC 2030 parameters
CAPEX_System_SOEC_mean_2030 = 1800; %$/kW
CAPEX_System_SOEC_std_2030 = 50;
CAPEX_System_SOEC_values_2030 = normrnd(CAPEX_System_SOEC_mean_2030, CAPEX_System_SOEC_std_2030, [num_simulations,1]);
CAPEX_System_SOEC_values_2030(CAPEX_System_SOEC_values_2030 < 2800) = 800;
CAPEX_System_SOEC_values_2030(CAPEX_System_SOEC_values_2030 > 5600) = 2800;
CAPEX_Stack_SOEC_values_2030 = 0.5*CAPEX_System_SOEC_values_2030; % 50% of CAPEX system
CAPEX_SOEC_values_2030 = (CAPEX_System_SOEC_values_2030 + CAPEX_Stack_SOEC_values_2030);
OPEX_SOEC_values_2030 = 3; % 3% of CAPEX/a
System_Efficiency_SOEC_mean_2030 = 0.805;
System_Efficiency_SOEC_std_2030 = 0.01;
System_Efficiency_SOEC_values_2030 = normrnd(System_Efficiency_SOEC_mean_2030, System_Efficiency_SOEC_std_2030, [num_simulations,1]);
System_Efficiency_SOEC_values_2030(System_Efficiency_SOEC_values_2030 < 0.77) = 0.77;
System_Efficiency_SOEC_values_2030(System_Efficiency_SOEC_values_2030 > 0.84) = 0.84;
%PEM 2020 parameters
CAPEX_System_PEM_mean_2020 = 1450; %$/kW
CAPEX_System_PEM_std_2020 = 50;
CAPEX_System_PEM_values_2020 = normrnd(CAPEX_System_PEM_mean_2020, CAPEX_System_PEM_std_2020, [num_simulations,1]);
CAPEX_System_PEM_values_2020(CAPEX_System_PEM_values_2020 < 1100) = 1100;
CAPEX_System_PEM_values_2020(CAPEX_System_PEM_values_2020 > 1800) = 1800;
CAPEX_Stack_PEM_values_2020 = 0.35*CAPEX_System_PEM_values_2020; % 35% of CAPEX system
CAPEX_PEM_values_2020 = (CAPEX_System_PEM_values_2020 + CAPEX_Stack_PEM_values_2020);
OPEX_PEM_values_2020 = 3;
System_Efficiency_PEM_mean_2020 = 0.58;
System_Efficiency_PEM_std_2020 = 0.01;
System_Efficiency_PEM_values_2020 = normrnd(System_Efficiency_PEM_mean_2020, System_Efficiency_PEM_std_2020, [num_simulations,1]);
System_Efficiency_PEM_values_2020(System_Efficiency_PEM_values_2020 < 0.56) = 0.56;
System_Efficiency_PEM_values_2020(System_Efficiency_PEM_values_2020 > 0.6) = 0.6;
%PEM 2030 parameters
CAPEX_System_PEM_mean_2030 = 1075; %$/kW
CAPEX_System_PEM_std_2030 = 50;
CAPEX_System_PEM_values_2030 = normrnd(CAPEX_System_PEM_mean_2030, CAPEX_System_PEM_std_2030, [num_simulations,1]);
CAPEX_System_PEM_values_2030(CAPEX_System_PEM_values_2030 < 650) = 650;
CAPEX_System_PEM_values_2030(CAPEX_System_PEM_values_2030 > 1500) = 1500;
CAPEX_Stack_PEM_values_2030 = 0.35*CAPEX_System_PEM_values_2030; % 35% of CAPEX system
CAPEX_PEM_values_2030 = (CAPEX_System_PEM_values_2030 + CAPEX_Stack_PEM_values_2030);
OPEX_PEM_values_2030 = 3;
System_Efficiency_PEM_mean_2030 = 0.655;
System_Efficiency_PEM_std_2030 = 0.01;
System_Efficiency_PEM_values_2030 = normrnd(System_Efficiency_PEM_mean_2030, System_Efficiency_PEM_std_2030, [num_simulations,1]);
System_Efficiency_PEM_values_2030(System_Efficiency_PEM_values_2030 < 0.63) = 0.63;
System_Efficiency_PEM_values_2030(System_Efficiency_PEM_values_2030 > 0.68) = 0.68;
%AEC 2020 parameters
CAPEX_System_AEC_mean_2020 = 950; % $/kW
CAPEX_System_AEC_std_2020 = 50;
CAPEX_System_AEC_values_2020 = normrnd(CAPEX_System_AEC_mean_2020, CAPEX_System_AEC_std_2020, [num_simulations,1]);
CAPEX_System_AEC_values_2020(CAPEX_System_AEC_values_2020 < 500) = 500;
CAPEX_System_AEC_values_2020(CAPEX_System_AEC_values_2020 > 1400) = 1400;
CAPEX_Stack_AEC_values_2020 = 0.35*CAPEX_System_AEC_values_2020; % 35% of CAPEX system
CAPEX_AEC_values_2020 = (CAPEX_System_AEC_values_2020 + CAPEX_Stack_AEC_values_2020);
OPEX_AEC_values_2020 = 3;
System_Efficiency_AEC_mean_2020 = 0.665;
System_Efficiency_AEC_std_2020 = 0.01;
System_Efficiency_AEC_values_2020 = normrnd(System_Efficiency_AEC_mean_2020, System_Efficiency_AEC_std_2020, [num_simulations,1]);
System_Efficiency_AEC_values_2020(System_Efficiency_AEC_values_2020 < 0.63) = 0.63;
System_Efficiency_AEC_values_2020(System_Efficiency_AEC_values_2020 > 0.7) = 0.7;
%AEC 2030 parameters
CAPEX_System_AEC_mean_2030 = 625; % $/kW
CAPEX_System_AEC_std_2030 = 50;
CAPEX_System_AEC_values_2030 = normrnd(CAPEX_System_AEC_mean_2030, CAPEX_System_AEC_std_2030, [num_simulations,1]);
CAPEX_System_AEC_values_2030(CAPEX_System_AEC_values_2030 < 400) = 400;
CAPEX_System_AEC_values_2030(CAPEX_System_AEC_values_2030 > 850) = 850;
CAPEX_Stack_AEC_values_2030 = 0.35*CAPEX_System_AEC_values_2030; % 35% of CAPEX system
CAPEX_AEC_values_2030 = (CAPEX_System_AEC_values_2030 + CAPEX_Stack_AEC_values_2030);
OPEX_AEC_values_2030 = 3;
System_Efficiency_AEC_mean_2030 = 0.68;
System_Efficiency_AEC_std_2030 = 0.01;
System_Efficiency_AEC_values_2030 = normrnd(System_Efficiency_AEC_mean_2030, System_Efficiency_AEC_std_2030, [num_simulations,1]);
System_Efficiency_AEC_values_2030(System_Efficiency_AEC_values_2030 < 0.65) = 0.65;
System_Efficiency_AEC_values_2030(System_Efficiency_AEC_values_2030 > 0.71) = 0.71;
% Calculate 2020 SOEC LCOH values
term1_S_2020 = LHV ./ (System_Efficiency_SOEC_values_2020);
term2_S_2020 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_S_2020 = (OPEX_SOEC_values_2020 / 100);
term4_S_2020 = CAPEX_SOEC_values_2020 ./ FLH;
LCOH_SOEC_2020 = term1_S_2020 .* ((term2_S_2020 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_S_2020) .* term4_S_2020 + Electricity_Cost_values);
% Calculate 2020 PEM LCOH values
term1_P_2020 = LHV ./ (System_Efficiency_PEM_values_2020);
term2_P_2020 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_P_2020 = (OPEX_PEM_values_2020 / 100);
term4_P_2020 = CAPEX_PEM_values_2020 ./ FLH;
LCOH_PEM_2020 = term1_P_2020 .* ((term2_P_2020 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_P_2020) .* term4_P_2020 + Electricity_Cost_values);
% Calculate 2020 AEC LCOH values
term1_A_2020 = LHV ./ (System_Efficiency_AEC_values_2020);
term2_A_2020 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_A_2020 = (OPEX_AEC_values_2020 / 100);
term4_A_2020 = CAPEX_AEC_values_2020 ./ FLH;
LCOH_AEC_2020 = term1_A_2020 .* ((term2_A_2020 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_A_2020) .* term4_A_2020 + Electricity_Cost_values);
% Calculate 2030 SOEC LCOH values
term1_S_2030 = LHV ./ (System_Efficiency_SOEC_values_2030);
term2_S_2030 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_S_2030 = (OPEX_SOEC_values_2030 / 100);
term4_S_2030 = CAPEX_SOEC_values_2030 ./ FLH;
LCOH_SOEC_2030 = term1_S_2030 .* ((term2_S_2030 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_S_2030) .* term4_S_2030 + Electricity_Cost_values);
% Calculate 2030 PEM LCOH values
term1_P_2030 = LHV ./ (System_Efficiency_PEM_values_2030);
term2_P_2030 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_P_2030 = (OPEX_PEM_values_2030 / 100);
term4_P_2030 = CAPEX_PEM_values_2030 ./ FLH;
LCOH_PEM_2030 = term1_P_2030 .* ((term2_P_2030 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_P_2030) .* term4_P_2030 + Electricity_Cost_values);
% Calculate 2030 AEC LCOH values
term1_A_2030 = LHV ./ (System_Efficiency_AEC_values_2030);
term2_A_2030 = Discount_Rate_values .* (1 + Discount_Rate_values).^Lifetime;
term3_A_2030 = (OPEX_AEC_values_2030 / 100);
term4_A_2030 = CAPEX_AEC_values_2030 ./ FLH;
LCOH_AEC_2030 = term1_A_2030 .* ((term2_A_2030 ./ ((1 + Discount_Rate_values).^Lifetime – 1) + term3_A_2030) .* term4_A_2030 + Electricity_Cost_values);
Using the code data, I would like to compare LCOH of six items with histogram.
Image is like the picture.
What is command for it? 30 MATLAB Answers — New Questions
It seems that data is not recorded
Hello, since this morning (around 8h00 am, Paris time), data sent by my iots is not recorded. I have not changed any settings on my iots and my internet connection is OK. On the page with my channels, it seems that the channels are updated because I see that the "updated" times are evolving. Is there a problem today with Thingspeak?Hello, since this morning (around 8h00 am, Paris time), data sent by my iots is not recorded. I have not changed any settings on my iots and my internet connection is OK. On the page with my channels, it seems that the channels are updated because I see that the "updated" times are evolving. Is there a problem today with Thingspeak? Hello, since this morning (around 8h00 am, Paris time), data sent by my iots is not recorded. I have not changed any settings on my iots and my internet connection is OK. On the page with my channels, it seems that the channels are updated because I see that the "updated" times are evolving. Is there a problem today with Thingspeak? thingspeak, service down MATLAB Answers — New Questions
Im trying to replicate a simulink design, i dont know what the blocks y and u are in the library browser.
im a trying to replicate a simulink model of a state estimator, but i currently dont know what the blocks Y and U are in the model shown below.im a trying to replicate a simulink model of a state estimator, but i currently dont know what the blocks Y and U are in the model shown below. im a trying to replicate a simulink model of a state estimator, but i currently dont know what the blocks Y and U are in the model shown below. state feeback control, simulink MATLAB Answers — New Questions
Fitting Curve To Polarplot Data
Hi all
I want to create fitting curve to my data i ploted in a polar plot. I tried to create fitting curve in matlab-cftool but it did not worked. someone can help how can i create fitting curve in apolar plot data?
Thank youHi all
I want to create fitting curve to my data i ploted in a polar plot. I tried to create fitting curve in matlab-cftool but it did not worked. someone can help how can i create fitting curve in apolar plot data?
Thank you Hi all
I want to create fitting curve to my data i ploted in a polar plot. I tried to create fitting curve in matlab-cftool but it did not worked. someone can help how can i create fitting curve in apolar plot data?
Thank you polar plot fitting curve MATLAB Answers — New Questions
Matlab Crash on Sonoma(macOS 14.0)
Matlab2023b works fine on my computer with macOS 13.6. I find that the matlab 2023b is supported on Sonoma, so I update the system to it. However, after the update matlab crashs each time I launch it. And I find similar report on stack overflow.
The crash report:
——————————————————————————–
Segmentation violation detected at 2023-10-02 08:03:40 +0800
——————————————————————————–
Configuration:
Crash Decoding : Disabled – No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Graphics Driver : Uninitialized hardware
Java Version : Java 1.8.0_382-b05 with Amazon.com Inc. OpenJDK 64-Bit Server VM mixed mode
MATLAB Architecture : maca64
MATLAB Entitlement ID : [FILTERED]
MATLAB Root : /Applications/MATLAB_R2023b.app
MATLAB Version : 23.2.0.2365128 (R2023b)
OpenGL : hardware
Operating System : Mac OS 版本14.0(版号23A344)
Process ID : 5522
Processor ID : ABI64 ARM ARM64E FIRESTORM_ICESTORM HG
Session Key : [FILTERED]
Window System : Quartz
Fault Count: 1
Abnormal termination:
Segmentation violation
Current Thread: ” id 0x294e2b000
Register State (from fault):
X0 = 0000000000000012 X1 = 0000000000000000
X2 = 0000000000000001 X3 = 0000000000000000
X4 = 00000001d9ae8630 X5 = 0000000000000000
X6 = 0000000000000000 X7 = 0000000000000403
X8 = 1194967f20a30012 X9 = 0000000000000000
X10 = 0000000000000001 X11 = 0000000000000000
X12 = 0000000010800000 X13 = 0000000000000001
X14 = 0000000000000000 X15 = 0000000084004000
X16 = 0000000182884e00 X17 = 0000000237fd36d0
X18 = 0000000000000000 X19 = 0000000236d00a60
X20 = 0000000000000000 X21 = 0000000000000000
X22 = 0000000294e2a670 X23 = 000000000000001a
X24 = 0000000000000000 X25 = 0000000000000000
X26 = 0000000294e290e0 X27 = 0000000000000000
X28 = 0000600065e36520
FP = 0000000294e27ae0 LR = 5154800182884e38
SP = 0000000294e27ae0 PC = 00000001829cd6f0
CPSR = 60001000
Stack Trace (from fault):
[ 0] 0x0000000104904d90 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00019856 _ZN10foundation4core4diag15stacktrace_base7captureERKNS1_14thread_contextEm+00000064
[ 1] 0x0000000104907c58 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00031832 _ZN10foundation4core4test17terminate_handledERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE+00002144
[ 2] 0x0000000104907118 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00028952 _ZN10foundation4core4diag13terminate_logEPKcPK17__darwin_ucontext+00000140
[ 3] 0x000000010b0653b0 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00529328 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00011892
[ 4] 0x000000010b063250 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00520784 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00003348
[ 5] 0x000000010b060cf0 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00511216 mnFatalSignalHandler+00000140
[ 6] 0x000000018284da24 /usr/lib/system/libsystem_platform.dylib+00014884 _sigtramp+00000056
[ 7] 0x0000000182884e38 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation+00028216 CFDictionaryGetValue+00000056
[ 8] 0x0000000182884e38 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation+00028216 CFDictionaryGetValue+00000056
[ 9] 0x0000000204c93578 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211+00017784 Apple80211Scan+00000584
[ 10] 0x00000001361d5994 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01923476 FqTtUQGnylG+00000356
[ 11] 0x00000001361d5da4 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01924516 AjEdeqBE+00000564
[ 12] 0x00000001361e4e00 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01986048 GxnmPknfylG+00000176
[ 13] 0x00000001361e42cc /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01983180 OexMpdMAylG+00000332
[ 14] 0x00000001361e4628 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01984040 tQpdOundylG+00000052
[ 15] 0x000000018281f034 /usr/lib/system/libsystem_pthread.dylib+00028724 _pthread_start+00000136
[ 16] 0x0000000182819e3c /usr/lib/system/libsystem_pthread.dylib+00007740 thread_start+00000008
PS: when I run matlab on terminal, there are two warnings as:
CodeCache is full. Compiler has been disabled.
Try increasing the code cache size using -XX:ReservedCodeCacheSize=
objc[16042]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x2325b2888) and /Applications/MATLAB_R2023b.app/bin/maca64/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib (0x10bc41e70).
One of the two will be used. Which one is undefined.Matlab2023b works fine on my computer with macOS 13.6. I find that the matlab 2023b is supported on Sonoma, so I update the system to it. However, after the update matlab crashs each time I launch it. And I find similar report on stack overflow.
The crash report:
——————————————————————————–
Segmentation violation detected at 2023-10-02 08:03:40 +0800
——————————————————————————–
Configuration:
Crash Decoding : Disabled – No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Graphics Driver : Uninitialized hardware
Java Version : Java 1.8.0_382-b05 with Amazon.com Inc. OpenJDK 64-Bit Server VM mixed mode
MATLAB Architecture : maca64
MATLAB Entitlement ID : [FILTERED]
MATLAB Root : /Applications/MATLAB_R2023b.app
MATLAB Version : 23.2.0.2365128 (R2023b)
OpenGL : hardware
Operating System : Mac OS 版本14.0(版号23A344)
Process ID : 5522
Processor ID : ABI64 ARM ARM64E FIRESTORM_ICESTORM HG
Session Key : [FILTERED]
Window System : Quartz
Fault Count: 1
Abnormal termination:
Segmentation violation
Current Thread: ” id 0x294e2b000
Register State (from fault):
X0 = 0000000000000012 X1 = 0000000000000000
X2 = 0000000000000001 X3 = 0000000000000000
X4 = 00000001d9ae8630 X5 = 0000000000000000
X6 = 0000000000000000 X7 = 0000000000000403
X8 = 1194967f20a30012 X9 = 0000000000000000
X10 = 0000000000000001 X11 = 0000000000000000
X12 = 0000000010800000 X13 = 0000000000000001
X14 = 0000000000000000 X15 = 0000000084004000
X16 = 0000000182884e00 X17 = 0000000237fd36d0
X18 = 0000000000000000 X19 = 0000000236d00a60
X20 = 0000000000000000 X21 = 0000000000000000
X22 = 0000000294e2a670 X23 = 000000000000001a
X24 = 0000000000000000 X25 = 0000000000000000
X26 = 0000000294e290e0 X27 = 0000000000000000
X28 = 0000600065e36520
FP = 0000000294e27ae0 LR = 5154800182884e38
SP = 0000000294e27ae0 PC = 00000001829cd6f0
CPSR = 60001000
Stack Trace (from fault):
[ 0] 0x0000000104904d90 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00019856 _ZN10foundation4core4diag15stacktrace_base7captureERKNS1_14thread_contextEm+00000064
[ 1] 0x0000000104907c58 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00031832 _ZN10foundation4core4test17terminate_handledERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE+00002144
[ 2] 0x0000000104907118 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00028952 _ZN10foundation4core4diag13terminate_logEPKcPK17__darwin_ucontext+00000140
[ 3] 0x000000010b0653b0 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00529328 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00011892
[ 4] 0x000000010b063250 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00520784 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00003348
[ 5] 0x000000010b060cf0 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00511216 mnFatalSignalHandler+00000140
[ 6] 0x000000018284da24 /usr/lib/system/libsystem_platform.dylib+00014884 _sigtramp+00000056
[ 7] 0x0000000182884e38 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation+00028216 CFDictionaryGetValue+00000056
[ 8] 0x0000000182884e38 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation+00028216 CFDictionaryGetValue+00000056
[ 9] 0x0000000204c93578 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211+00017784 Apple80211Scan+00000584
[ 10] 0x00000001361d5994 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01923476 FqTtUQGnylG+00000356
[ 11] 0x00000001361d5da4 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01924516 AjEdeqBE+00000564
[ 12] 0x00000001361e4e00 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01986048 GxnmPknfylG+00000176
[ 13] 0x00000001361e42cc /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01983180 OexMpdMAylG+00000332
[ 14] 0x00000001361e4628 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01984040 tQpdOundylG+00000052
[ 15] 0x000000018281f034 /usr/lib/system/libsystem_pthread.dylib+00028724 _pthread_start+00000136
[ 16] 0x0000000182819e3c /usr/lib/system/libsystem_pthread.dylib+00007740 thread_start+00000008
PS: when I run matlab on terminal, there are two warnings as:
CodeCache is full. Compiler has been disabled.
Try increasing the code cache size using -XX:ReservedCodeCacheSize=
objc[16042]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x2325b2888) and /Applications/MATLAB_R2023b.app/bin/maca64/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib (0x10bc41e70).
One of the two will be used. Which one is undefined. Matlab2023b works fine on my computer with macOS 13.6. I find that the matlab 2023b is supported on Sonoma, so I update the system to it. However, after the update matlab crashs each time I launch it. And I find similar report on stack overflow.
The crash report:
——————————————————————————–
Segmentation violation detected at 2023-10-02 08:03:40 +0800
——————————————————————————–
Configuration:
Crash Decoding : Disabled – No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Graphics Driver : Uninitialized hardware
Java Version : Java 1.8.0_382-b05 with Amazon.com Inc. OpenJDK 64-Bit Server VM mixed mode
MATLAB Architecture : maca64
MATLAB Entitlement ID : [FILTERED]
MATLAB Root : /Applications/MATLAB_R2023b.app
MATLAB Version : 23.2.0.2365128 (R2023b)
OpenGL : hardware
Operating System : Mac OS 版本14.0(版号23A344)
Process ID : 5522
Processor ID : ABI64 ARM ARM64E FIRESTORM_ICESTORM HG
Session Key : [FILTERED]
Window System : Quartz
Fault Count: 1
Abnormal termination:
Segmentation violation
Current Thread: ” id 0x294e2b000
Register State (from fault):
X0 = 0000000000000012 X1 = 0000000000000000
X2 = 0000000000000001 X3 = 0000000000000000
X4 = 00000001d9ae8630 X5 = 0000000000000000
X6 = 0000000000000000 X7 = 0000000000000403
X8 = 1194967f20a30012 X9 = 0000000000000000
X10 = 0000000000000001 X11 = 0000000000000000
X12 = 0000000010800000 X13 = 0000000000000001
X14 = 0000000000000000 X15 = 0000000084004000
X16 = 0000000182884e00 X17 = 0000000237fd36d0
X18 = 0000000000000000 X19 = 0000000236d00a60
X20 = 0000000000000000 X21 = 0000000000000000
X22 = 0000000294e2a670 X23 = 000000000000001a
X24 = 0000000000000000 X25 = 0000000000000000
X26 = 0000000294e290e0 X27 = 0000000000000000
X28 = 0000600065e36520
FP = 0000000294e27ae0 LR = 5154800182884e38
SP = 0000000294e27ae0 PC = 00000001829cd6f0
CPSR = 60001000
Stack Trace (from fault):
[ 0] 0x0000000104904d90 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00019856 _ZN10foundation4core4diag15stacktrace_base7captureERKNS1_14thread_contextEm+00000064
[ 1] 0x0000000104907c58 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00031832 _ZN10foundation4core4test17terminate_handledERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE+00002144
[ 2] 0x0000000104907118 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00028952 _ZN10foundation4core4diag13terminate_logEPKcPK17__darwin_ucontext+00000140
[ 3] 0x000000010b0653b0 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00529328 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00011892
[ 4] 0x000000010b063250 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00520784 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00003348
[ 5] 0x000000010b060cf0 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00511216 mnFatalSignalHandler+00000140
[ 6] 0x000000018284da24 /usr/lib/system/libsystem_platform.dylib+00014884 _sigtramp+00000056
[ 7] 0x0000000182884e38 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation+00028216 CFDictionaryGetValue+00000056
[ 8] 0x0000000182884e38 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation+00028216 CFDictionaryGetValue+00000056
[ 9] 0x0000000204c93578 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211+00017784 Apple80211Scan+00000584
[ 10] 0x00000001361d5994 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01923476 FqTtUQGnylG+00000356
[ 11] 0x00000001361d5da4 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01924516 AjEdeqBE+00000564
[ 12] 0x00000001361e4e00 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01986048 GxnmPknfylG+00000176
[ 13] 0x00000001361e42cc /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01983180 OexMpdMAylG+00000332
[ 14] 0x00000001361e4628 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01984040 tQpdOundylG+00000052
[ 15] 0x000000018281f034 /usr/lib/system/libsystem_pthread.dylib+00028724 _pthread_start+00000136
[ 16] 0x0000000182819e3c /usr/lib/system/libsystem_pthread.dylib+00007740 thread_start+00000008
PS: when I run matlab on terminal, there are two warnings as:
CodeCache is full. Compiler has been disabled.
Try increasing the code cache size using -XX:ReservedCodeCacheSize=
objc[16042]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x2325b2888) and /Applications/MATLAB_R2023b.app/bin/maca64/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib (0x10bc41e70).
One of the two will be used. Which one is undefined. java, sonoma, macos 14, segv MATLAB Answers — New Questions
Is it possible to subsample an image by deleting data then interpolating to create a blurred image, while keeping the resulting image the same size as the original image?
Is it possible to subsample an image by deleting data then interpolating to create a blurred image, while keeping the resulting image the same size as the original image?
The code I am using below does the subsampling and interpolation but changes the image size. It looks smaller. See a part of my code below.
originalImage = imread(imagePath);
zeroPaddedImage = zeros(size(originalImage), ‘like’, originalImage);
zeroPaddedImage(:, 1:subsamplingFactor:end) = originalImage(:, 1:subsamplingFactor:end);
blurredImage = imresize(zeroPaddedImage, 1/subsamplingFactor, ‘bicubic’);Is it possible to subsample an image by deleting data then interpolating to create a blurred image, while keeping the resulting image the same size as the original image?
The code I am using below does the subsampling and interpolation but changes the image size. It looks smaller. See a part of my code below.
originalImage = imread(imagePath);
zeroPaddedImage = zeros(size(originalImage), ‘like’, originalImage);
zeroPaddedImage(:, 1:subsamplingFactor:end) = originalImage(:, 1:subsamplingFactor:end);
blurredImage = imresize(zeroPaddedImage, 1/subsamplingFactor, ‘bicubic’); Is it possible to subsample an image by deleting data then interpolating to create a blurred image, while keeping the resulting image the same size as the original image?
The code I am using below does the subsampling and interpolation but changes the image size. It looks smaller. See a part of my code below.
originalImage = imread(imagePath);
zeroPaddedImage = zeros(size(originalImage), ‘like’, originalImage);
zeroPaddedImage(:, 1:subsamplingFactor:end) = originalImage(:, 1:subsamplingFactor:end);
blurredImage = imresize(zeroPaddedImage, 1/subsamplingFactor, ‘bicubic’); subampling and interpolation MATLAB Answers — New Questions
Finding coefficients and bias term for equation y = (x-B)*A
This is my equation;
Y= (X-B)*A ———-(1) ,
moving RHS side to LHS it will become
Y-(X-B)*A = 0 ———-(2)
Y is 1*3 matrix, A is 3*3 matrix, X is 1*3 matrix, B is 1*3 matrix. expressed as
Y = [Yx Yy Yz];
X = [Xx Xy Xz];
I have Y and X values i want to calulate A,B that is
A = [A11 A12 A13; A21 A22 A23; A31 A32 A33];
B = [b1 b2 b3];
Suppose I have 1000 different values in a 1*3 matrix of X and Y. And for these values, I want to calculate a single value of A and B so that equation (2) is satisfied. you may take some coefficiant values zero…….
how should i calculate this please help……..
Thank you in advance…………….This is my equation;
Y= (X-B)*A ———-(1) ,
moving RHS side to LHS it will become
Y-(X-B)*A = 0 ———-(2)
Y is 1*3 matrix, A is 3*3 matrix, X is 1*3 matrix, B is 1*3 matrix. expressed as
Y = [Yx Yy Yz];
X = [Xx Xy Xz];
I have Y and X values i want to calulate A,B that is
A = [A11 A12 A13; A21 A22 A23; A31 A32 A33];
B = [b1 b2 b3];
Suppose I have 1000 different values in a 1*3 matrix of X and Y. And for these values, I want to calculate a single value of A and B so that equation (2) is satisfied. you may take some coefficiant values zero…….
how should i calculate this please help……..
Thank you in advance……………. This is my equation;
Y= (X-B)*A ———-(1) ,
moving RHS side to LHS it will become
Y-(X-B)*A = 0 ———-(2)
Y is 1*3 matrix, A is 3*3 matrix, X is 1*3 matrix, B is 1*3 matrix. expressed as
Y = [Yx Yy Yz];
X = [Xx Xy Xz];
I have Y and X values i want to calulate A,B that is
A = [A11 A12 A13; A21 A22 A23; A31 A32 A33];
B = [b1 b2 b3];
Suppose I have 1000 different values in a 1*3 matrix of X and Y. And for these values, I want to calculate a single value of A and B so that equation (2) is satisfied. you may take some coefficiant values zero…….
how should i calculate this please help……..
Thank you in advance……………. optimization MATLAB Answers — New Questions