Month: January 2025
Integral command doesn’t work inside the for loop
Hello. I have this simple code trying to compare analytical solution of few functions with two numerical methods. I used for loop wih the integral command in it but i get many errors.
clear, clc, close all, format long
a = 0;
b = 2;
h1 = b – a;
h2 = (b – a)/2;
n = 1:5;
fprintf(‘tAnalyticaltTrapezoidtSimpsonnn’)
for i = 1:length(n)
f = @(x) x.^n;
I = integral(f,a,b);
Trap = 0.5*h1*(f(a) + f(b));
Simp = (h2/3)*(f(a) + 4*f(h2) + f(b));
fprintf(‘t%gtttt%gttt%gn’,I(i),Trap(i),Simp(i))
end
f = @(x) exp(x);
Trap = 0.5*h1*(f(a) + f(b));
Simp = (h2/3)*(f(a) + 4*f(h2) + f(b));
fprintf(‘t%gttt%gtt%gn’,I,Trap,Simp)Hello. I have this simple code trying to compare analytical solution of few functions with two numerical methods. I used for loop wih the integral command in it but i get many errors.
clear, clc, close all, format long
a = 0;
b = 2;
h1 = b – a;
h2 = (b – a)/2;
n = 1:5;
fprintf(‘tAnalyticaltTrapezoidtSimpsonnn’)
for i = 1:length(n)
f = @(x) x.^n;
I = integral(f,a,b);
Trap = 0.5*h1*(f(a) + f(b));
Simp = (h2/3)*(f(a) + 4*f(h2) + f(b));
fprintf(‘t%gtttt%gttt%gn’,I(i),Trap(i),Simp(i))
end
f = @(x) exp(x);
Trap = 0.5*h1*(f(a) + f(b));
Simp = (h2/3)*(f(a) + 4*f(h2) + f(b));
fprintf(‘t%gttt%gtt%gn’,I,Trap,Simp) Hello. I have this simple code trying to compare analytical solution of few functions with two numerical methods. I used for loop wih the integral command in it but i get many errors.
clear, clc, close all, format long
a = 0;
b = 2;
h1 = b – a;
h2 = (b – a)/2;
n = 1:5;
fprintf(‘tAnalyticaltTrapezoidtSimpsonnn’)
for i = 1:length(n)
f = @(x) x.^n;
I = integral(f,a,b);
Trap = 0.5*h1*(f(a) + f(b));
Simp = (h2/3)*(f(a) + 4*f(h2) + f(b));
fprintf(‘t%gtttt%gttt%gn’,I(i),Trap(i),Simp(i))
end
f = @(x) exp(x);
Trap = 0.5*h1*(f(a) + f(b));
Simp = (h2/3)*(f(a) + 4*f(h2) + f(b));
fprintf(‘t%gttt%gtt%gn’,I,Trap,Simp) numerical integration, trapezoid rule, simpson rule, integral command MATLAB Answers — New Questions
how to plot different range of files on one graph using hold on
i have 63 .mat files that contain cells of data. i am dividing the .mat files into three parts so that each file is plotted correspondingly on the same graph from another set. that is, file 1 in the first, second third set are plotted on the same graph using hold on and the same for file 2 and so on. Although, i have not included the plot command, i am still trying to see how the code looks like by dividing the files into two sets.
startIndex = 1;
endIndex = 3;
startIndex1 = 4;
endIndex1 = 6;
count1 = 0;
count2 = 0;
filelist = dir(‘C:UsersshedrDownloadstec data2017DOBUMttrttr1tt4*.mat’);
% first set of files
for fileidx = startIndex:endIndex
count1 = count1+1;
spectrum = load(filelist(fileidx).name);
C = spectrum.B
% second set of files
for fileidx1 = startIndex1:endIndex1
count2 = count2+1;
if count2 == count1
spectrum1 = load(filelist(fileidx1).name);
C1 = spectrum.B
end
end
% but the output is not favourable.i have 63 .mat files that contain cells of data. i am dividing the .mat files into three parts so that each file is plotted correspondingly on the same graph from another set. that is, file 1 in the first, second third set are plotted on the same graph using hold on and the same for file 2 and so on. Although, i have not included the plot command, i am still trying to see how the code looks like by dividing the files into two sets.
startIndex = 1;
endIndex = 3;
startIndex1 = 4;
endIndex1 = 6;
count1 = 0;
count2 = 0;
filelist = dir(‘C:UsersshedrDownloadstec data2017DOBUMttrttr1tt4*.mat’);
% first set of files
for fileidx = startIndex:endIndex
count1 = count1+1;
spectrum = load(filelist(fileidx).name);
C = spectrum.B
% second set of files
for fileidx1 = startIndex1:endIndex1
count2 = count2+1;
if count2 == count1
spectrum1 = load(filelist(fileidx1).name);
C1 = spectrum.B
end
end
% but the output is not favourable. i have 63 .mat files that contain cells of data. i am dividing the .mat files into three parts so that each file is plotted correspondingly on the same graph from another set. that is, file 1 in the first, second third set are plotted on the same graph using hold on and the same for file 2 and so on. Although, i have not included the plot command, i am still trying to see how the code looks like by dividing the files into two sets.
startIndex = 1;
endIndex = 3;
startIndex1 = 4;
endIndex1 = 6;
count1 = 0;
count2 = 0;
filelist = dir(‘C:UsersshedrDownloadstec data2017DOBUMttrttr1tt4*.mat’);
% first set of files
for fileidx = startIndex:endIndex
count1 = count1+1;
spectrum = load(filelist(fileidx).name);
C = spectrum.B
% second set of files
for fileidx1 = startIndex1:endIndex1
count2 = count2+1;
if count2 == count1
spectrum1 = load(filelist(fileidx1).name);
C1 = spectrum.B
end
end
% but the output is not favourable. file indexing, for loop hold on MATLAB Answers — New Questions
Is There A Way to Rename the “app” Component In appdesigner?
When you start appdesigner, the canvas window contains a single UIFigure. You can access the UIFigure via syntax like "app.UIFigure…" So the main component I think is the "app" component (or main ‘object’, I’m not sure I have the correct phrasing). I want to rename the "app" component to "A" such that I would then access the UIFigure via syntax like "A.UIFigure…".
Is it possible to rename "app" to "A" and how is it done.
Thanks in advance.When you start appdesigner, the canvas window contains a single UIFigure. You can access the UIFigure via syntax like "app.UIFigure…" So the main component I think is the "app" component (or main ‘object’, I’m not sure I have the correct phrasing). I want to rename the "app" component to "A" such that I would then access the UIFigure via syntax like "A.UIFigure…".
Is it possible to rename "app" to "A" and how is it done.
Thanks in advance. When you start appdesigner, the canvas window contains a single UIFigure. You can access the UIFigure via syntax like "app.UIFigure…" So the main component I think is the "app" component (or main ‘object’, I’m not sure I have the correct phrasing). I want to rename the "app" component to "A" such that I would then access the UIFigure via syntax like "A.UIFigure…".
Is it possible to rename "app" to "A" and how is it done.
Thanks in advance. appdesigner, app designer, components MATLAB Answers — New Questions
How to add TCL script to HDL Coder IP Core generation
I use HDL Coder IP Core flow and I need to add a TCL script that I have to open Vivado, add the new IP core to the existing project and implement with it.
I tried "add additional sources" option in HDL Coder to point to my TCL script there. The TCL script was never executed.
Of course I can run the script manually after IP core is generated, but I want to have a pushbutton solution, such that I only start IP Core generation and everything else would work automatically.
One possible way would be to do everything (including IP core generation) in a TCL script, but I don’t know how to make HDL coder to generate IP core in a TCL script.
Any suggestions?
Thank you, alexI use HDL Coder IP Core flow and I need to add a TCL script that I have to open Vivado, add the new IP core to the existing project and implement with it.
I tried "add additional sources" option in HDL Coder to point to my TCL script there. The TCL script was never executed.
Of course I can run the script manually after IP core is generated, but I want to have a pushbutton solution, such that I only start IP Core generation and everything else would work automatically.
One possible way would be to do everything (including IP core generation) in a TCL script, but I don’t know how to make HDL coder to generate IP core in a TCL script.
Any suggestions?
Thank you, alex I use HDL Coder IP Core flow and I need to add a TCL script that I have to open Vivado, add the new IP core to the existing project and implement with it.
I tried "add additional sources" option in HDL Coder to point to my TCL script there. The TCL script was never executed.
Of course I can run the script manually after IP core is generated, but I want to have a pushbutton solution, such that I only start IP Core generation and everything else would work automatically.
One possible way would be to do everything (including IP core generation) in a TCL script, but I don’t know how to make HDL coder to generate IP core in a TCL script.
Any suggestions?
Thank you, alex hdl coder, ip core, tcl script, tcl command MATLAB Answers — New Questions
filtfilt initial condition calculation … can someone explain it?
Can someone explain how to get from the article "Determining the initial states in forward-backward filtering, IEEE Transactions on Signal Processing" to the initial condition calculation used in the filtfilt function?
As far as I understand the article, the calculation works by finding inital values that minimize the difference between forward-backward and backward-forward application of the filter.
But how does this translate into the formula used in filtfilt and the extrapolation by reflection?
Could the extrapolation by reflection be replaced by chosing different initial conditions? The initial conditions of the filter reflect all the memory it has of previous samples.Can someone explain how to get from the article "Determining the initial states in forward-backward filtering, IEEE Transactions on Signal Processing" to the initial condition calculation used in the filtfilt function?
As far as I understand the article, the calculation works by finding inital values that minimize the difference between forward-backward and backward-forward application of the filter.
But how does this translate into the formula used in filtfilt and the extrapolation by reflection?
Could the extrapolation by reflection be replaced by chosing different initial conditions? The initial conditions of the filter reflect all the memory it has of previous samples. Can someone explain how to get from the article "Determining the initial states in forward-backward filtering, IEEE Transactions on Signal Processing" to the initial condition calculation used in the filtfilt function?
As far as I understand the article, the calculation works by finding inital values that minimize the difference between forward-backward and backward-forward application of the filter.
But how does this translate into the formula used in filtfilt and the extrapolation by reflection?
Could the extrapolation by reflection be replaced by chosing different initial conditions? The initial conditions of the filter reflect all the memory it has of previous samples. filtfilt MATLAB Answers — New Questions
can you please explain the logic of this code
function alphaKrow = mkpca(data,sigma,numev)
% ———————————————————————– %
global K
[n, d] = size(data);
% n : number of data points
% d : dimension of data points
sigma = 2.5;
% kernel matrix:
K = zeros(n,n);
% kernel parameter:
param = 0.5/(sigma*sigma);
% fprintf(‘computing kernel matrix Kn’);
for i=1:n
for j=i:n
K(i,j) = kernel(data(i,:),data(j,:),param);
K(j,i) = K(i,j);
end
end
% correct K for non-zero center of data in feature space:
Krow = sum(K,1)/n;
Ksum = sum(Krow)/n;
for i=1:n
for j=1:n
K(i,j) = K(i,j) – Krow(i) – Krow(j) + Ksum;
end
end
opts.disp = 0;
[alpha,lambda] = eigs(K);
% normalize alpha:
alpha = alpha * inv(sqrt(lambda));
% compute some helper vectors:
alphaKrow = Krow * alpha;
K = imresize(K,[256,256]);
% ———————————————————————– %
function k = kernel(x,y,param)
% ———————————————————————– %
diff = x-y;
k = exp(-(diff * diff’)*param);function alphaKrow = mkpca(data,sigma,numev)
% ———————————————————————– %
global K
[n, d] = size(data);
% n : number of data points
% d : dimension of data points
sigma = 2.5;
% kernel matrix:
K = zeros(n,n);
% kernel parameter:
param = 0.5/(sigma*sigma);
% fprintf(‘computing kernel matrix Kn’);
for i=1:n
for j=i:n
K(i,j) = kernel(data(i,:),data(j,:),param);
K(j,i) = K(i,j);
end
end
% correct K for non-zero center of data in feature space:
Krow = sum(K,1)/n;
Ksum = sum(Krow)/n;
for i=1:n
for j=1:n
K(i,j) = K(i,j) – Krow(i) – Krow(j) + Ksum;
end
end
opts.disp = 0;
[alpha,lambda] = eigs(K);
% normalize alpha:
alpha = alpha * inv(sqrt(lambda));
% compute some helper vectors:
alphaKrow = Krow * alpha;
K = imresize(K,[256,256]);
% ———————————————————————– %
function k = kernel(x,y,param)
% ———————————————————————– %
diff = x-y;
k = exp(-(diff * diff’)*param); function alphaKrow = mkpca(data,sigma,numev)
% ———————————————————————– %
global K
[n, d] = size(data);
% n : number of data points
% d : dimension of data points
sigma = 2.5;
% kernel matrix:
K = zeros(n,n);
% kernel parameter:
param = 0.5/(sigma*sigma);
% fprintf(‘computing kernel matrix Kn’);
for i=1:n
for j=i:n
K(i,j) = kernel(data(i,:),data(j,:),param);
K(j,i) = K(i,j);
end
end
% correct K for non-zero center of data in feature space:
Krow = sum(K,1)/n;
Ksum = sum(Krow)/n;
for i=1:n
for j=1:n
K(i,j) = K(i,j) – Krow(i) – Krow(j) + Ksum;
end
end
opts.disp = 0;
[alpha,lambda] = eigs(K);
% normalize alpha:
alpha = alpha * inv(sqrt(lambda));
% compute some helper vectors:
alphaKrow = Krow * alpha;
K = imresize(K,[256,256]);
% ———————————————————————– %
function k = kernel(x,y,param)
% ———————————————————————– %
diff = x-y;
k = exp(-(diff * diff’)*param); pca MATLAB Answers — New Questions
can anyone explain me dis gaussian low pass filter coding
[M N]=size(A);
R=10;
X=0:N-1;
Y=0:M-1;
[X Y]=meshgrid(X,Y);
Cx=0.5*N;
Cy=0.5*M;
Lo=exp(-((X-Cx).^2+(Y-Cy).^2)./(2*R).^2);
Hi=1-Lo;
J=A1.*Lo;
J1=ifftshift(J);
B1=ifft2(J1);
K=A1.*Hi;
K1=ifftshift(K);
B2=ifft2(K1);[M N]=size(A);
R=10;
X=0:N-1;
Y=0:M-1;
[X Y]=meshgrid(X,Y);
Cx=0.5*N;
Cy=0.5*M;
Lo=exp(-((X-Cx).^2+(Y-Cy).^2)./(2*R).^2);
Hi=1-Lo;
J=A1.*Lo;
J1=ifftshift(J);
B1=ifft2(J1);
K=A1.*Hi;
K1=ifftshift(K);
B2=ifft2(K1); [M N]=size(A);
R=10;
X=0:N-1;
Y=0:M-1;
[X Y]=meshgrid(X,Y);
Cx=0.5*N;
Cy=0.5*M;
Lo=exp(-((X-Cx).^2+(Y-Cy).^2)./(2*R).^2);
Hi=1-Lo;
J=A1.*Lo;
J1=ifftshift(J);
B1=ifft2(J1);
K=A1.*Hi;
K1=ifftshift(K);
B2=ifft2(K1); gaussian low pass filter, gaussian, low pass filter MATLAB Answers — New Questions
Simple circuit does not work
I am a novice in Simulink and electric circuits
The attached simple model does not initialize.
I cannot figure out why.
Any hint is welcome.
Best regardsI am a novice in Simulink and electric circuits
The attached simple model does not initialize.
I cannot figure out why.
Any hint is welcome.
Best regards I am a novice in Simulink and electric circuits
The attached simple model does not initialize.
I cannot figure out why.
Any hint is welcome.
Best regards electric circuits MATLAB Answers — New Questions
Please explain ‘statsfminbx’ function ?
The maximum likelihood estimation of factor loading. The problem in estimation of maximum likelihood is Undefined function ‘statsfminbx’ for input arguments of type ‘cell’. What is statsfminbx indicate here?The maximum likelihood estimation of factor loading. The problem in estimation of maximum likelihood is Undefined function ‘statsfminbx’ for input arguments of type ‘cell’. What is statsfminbx indicate here? The maximum likelihood estimation of factor loading. The problem in estimation of maximum likelihood is Undefined function ‘statsfminbx’ for input arguments of type ‘cell’. What is statsfminbx indicate here? factoran, statsfminbx, loglike., statistics, image processing MATLAB Answers — New Questions
Explain the below Kmeans code.
Extract from http://www.mathworks.in/matlabcentral/fileexchange/24616-kmeans-clustering/content/litekmeans/litekmeans.m, below
E = sparse(1:n,label,1,n,k,n); % transform label into indicator matrix
m = X*(E*spdiags(1./sum(E,1)’,0,k,k)); % compute m of each cluster
[~,label] = max(bsxfun(@minus,m’*X,dot(m,m,1)’/2),[],1); % assign samples to the
Can you please explain the above code?Extract from http://www.mathworks.in/matlabcentral/fileexchange/24616-kmeans-clustering/content/litekmeans/litekmeans.m, below
E = sparse(1:n,label,1,n,k,n); % transform label into indicator matrix
m = X*(E*spdiags(1./sum(E,1)’,0,k,k)); % compute m of each cluster
[~,label] = max(bsxfun(@minus,m’*X,dot(m,m,1)’/2),[],1); % assign samples to the
Can you please explain the above code? Extract from http://www.mathworks.in/matlabcentral/fileexchange/24616-kmeans-clustering/content/litekmeans/litekmeans.m, below
E = sparse(1:n,label,1,n,k,n); % transform label into indicator matrix
m = X*(E*spdiags(1./sum(E,1)’,0,k,k)); % compute m of each cluster
[~,label] = max(bsxfun(@minus,m’*X,dot(m,m,1)’/2),[],1); % assign samples to the
Can you please explain the above code? kmeans MATLAB Answers — New Questions
rdmseed name each legend with Yticklabel
In rdmseed function how can I put in each suplot’s legend the name of each Yticklabel?In rdmseed function how can I put in each suplot’s legend the name of each Yticklabel? In rdmseed function how can I put in each suplot’s legend the name of each Yticklabel? rdmseed, yticklabel MATLAB Answers — New Questions
Call to download server failed (HTTP error code: 403)
I am trying to download an application from github that utilises MATLAB runtime. the application is called SeabORD v1.2 which was created using MATLAB R2017a and that I must install the appropriate version of MATLAB Runtime, which is 9.2.
SeabORD/ at main · MarineScotlandScience/SeabORD · GitHub
The application will download MATLAB Runtime from the web, and when SeabORD is installed for the first time, MATLAB Runtime will be installed if required.
I am therefore getting the above error with the additional text:
"Call to download server failed (HTTP error code: 403). Try to rerun the installer. If that fails, please check your internet connection, firewall, proxy server or virus scanner settings".
It is not however my internet connection or firewall or proxy server or virus scanner settings thats causing the issue. I googled this issue and got directed to the matlab website Q and A hence why i am gathering tis a matlab issue and that my program is having issues downloading due to pulling MATLAB runtime from the web to try and install. Without MATLAB runtime i cannot download seaBORD which i need for my work.
Has an update or something caused a problem to arise with MATLAB? This is urgent and hence i need help fixing this.I am trying to download an application from github that utilises MATLAB runtime. the application is called SeabORD v1.2 which was created using MATLAB R2017a and that I must install the appropriate version of MATLAB Runtime, which is 9.2.
SeabORD/ at main · MarineScotlandScience/SeabORD · GitHub
The application will download MATLAB Runtime from the web, and when SeabORD is installed for the first time, MATLAB Runtime will be installed if required.
I am therefore getting the above error with the additional text:
"Call to download server failed (HTTP error code: 403). Try to rerun the installer. If that fails, please check your internet connection, firewall, proxy server or virus scanner settings".
It is not however my internet connection or firewall or proxy server or virus scanner settings thats causing the issue. I googled this issue and got directed to the matlab website Q and A hence why i am gathering tis a matlab issue and that my program is having issues downloading due to pulling MATLAB runtime from the web to try and install. Without MATLAB runtime i cannot download seaBORD which i need for my work.
Has an update or something caused a problem to arise with MATLAB? This is urgent and hence i need help fixing this. I am trying to download an application from github that utilises MATLAB runtime. the application is called SeabORD v1.2 which was created using MATLAB R2017a and that I must install the appropriate version of MATLAB Runtime, which is 9.2.
SeabORD/ at main · MarineScotlandScience/SeabORD · GitHub
The application will download MATLAB Runtime from the web, and when SeabORD is installed for the first time, MATLAB Runtime will be installed if required.
I am therefore getting the above error with the additional text:
"Call to download server failed (HTTP error code: 403). Try to rerun the installer. If that fails, please check your internet connection, firewall, proxy server or virus scanner settings".
It is not however my internet connection or firewall or proxy server or virus scanner settings thats causing the issue. I googled this issue and got directed to the matlab website Q and A hence why i am gathering tis a matlab issue and that my program is having issues downloading due to pulling MATLAB runtime from the web to try and install. Without MATLAB runtime i cannot download seaBORD which i need for my work.
Has an update or something caused a problem to arise with MATLAB? This is urgent and hence i need help fixing this. code 403, download server, seabord, http MATLAB Answers — New Questions
How do I download and install a support package on an offline machine?
How do I download Hardware Support Packages and Optional Features for installation on a computer that is offline or that is behind a Proxy/Firewall?How do I download Hardware Support Packages and Optional Features for installation on a computer that is offline or that is behind a Proxy/Firewall? How do I download Hardware Support Packages and Optional Features for installation on a computer that is offline or that is behind a Proxy/Firewall? MATLAB Answers — New Questions
How to get digital/analog input to speedgoat processor using IO334-325k
Hello,
I’m currently running a controller model on speedgoat IO334-325k FPGA, using hdl coder to define analog and digital interfaces with the outside world.
There are some other functions i would like to run on the speedgoat processor, not the FPGA, and the functions need to interface with my FPGA model. These functions also require inputs from the outside world, so i was wondering how i’d go about defining the interfaces? because hdl coder is only for defining FPGA interfaces?
Thank you in advance,
YeungHello,
I’m currently running a controller model on speedgoat IO334-325k FPGA, using hdl coder to define analog and digital interfaces with the outside world.
There are some other functions i would like to run on the speedgoat processor, not the FPGA, and the functions need to interface with my FPGA model. These functions also require inputs from the outside world, so i was wondering how i’d go about defining the interfaces? because hdl coder is only for defining FPGA interfaces?
Thank you in advance,
Yeung Hello,
I’m currently running a controller model on speedgoat IO334-325k FPGA, using hdl coder to define analog and digital interfaces with the outside world.
There are some other functions i would like to run on the speedgoat processor, not the FPGA, and the functions need to interface with my FPGA model. These functions also require inputs from the outside world, so i was wondering how i’d go about defining the interfaces? because hdl coder is only for defining FPGA interfaces?
Thank you in advance,
Yeung simulink coder, analog interface, digital interface, speedgoat, hdl coder MATLAB Answers — New Questions
Calculating the aortic flow downstream valve using Womersley and 3-element Windkessel model calculations from my FSI results – Why unusual sine waves at the end of flow curve?
So I have some aortic valve FSI results and I want to examine these results by modelling Womersley flow and using a 3-element Windkessel model in series to it (both downstream of the valve).
I am using the pressure (at the STJ) just downstream of my valve for the calculations (P_STJ, provided in the attached csv file).
I calculate the Womersley Impedance as according to literature (https://leifh.folk.ntnu.no/teaching/tkt4150/._main023.html) and it is connected to a 3 element windkessel model in series (as you can see in the code, with the values provided).
I perform Fourier transform on the pressure data and then divide it by total impedance to get the flow. However, as you can see when running the code (and attached image), that there is a discrepancy in values between the FSI values, that is approximately equal to the amplitude of that unusual sine wave at the end of the flow curve.
Am I doing something wrong? Should I attempt another method than fourier transform and series? Any recommendations?
Thank you in advance.So I have some aortic valve FSI results and I want to examine these results by modelling Womersley flow and using a 3-element Windkessel model in series to it (both downstream of the valve).
I am using the pressure (at the STJ) just downstream of my valve for the calculations (P_STJ, provided in the attached csv file).
I calculate the Womersley Impedance as according to literature (https://leifh.folk.ntnu.no/teaching/tkt4150/._main023.html) and it is connected to a 3 element windkessel model in series (as you can see in the code, with the values provided).
I perform Fourier transform on the pressure data and then divide it by total impedance to get the flow. However, as you can see when running the code (and attached image), that there is a discrepancy in values between the FSI values, that is approximately equal to the amplitude of that unusual sine wave at the end of the flow curve.
Am I doing something wrong? Should I attempt another method than fourier transform and series? Any recommendations?
Thank you in advance. So I have some aortic valve FSI results and I want to examine these results by modelling Womersley flow and using a 3-element Windkessel model in series to it (both downstream of the valve).
I am using the pressure (at the STJ) just downstream of my valve for the calculations (P_STJ, provided in the attached csv file).
I calculate the Womersley Impedance as according to literature (https://leifh.folk.ntnu.no/teaching/tkt4150/._main023.html) and it is connected to a 3 element windkessel model in series (as you can see in the code, with the values provided).
I perform Fourier transform on the pressure data and then divide it by total impedance to get the flow. However, as you can see when running the code (and attached image), that there is a discrepancy in values between the FSI values, that is approximately equal to the amplitude of that unusual sine wave at the end of the flow curve.
Am I doing something wrong? Should I attempt another method than fourier transform and series? Any recommendations?
Thank you in advance. aortic flow, womersley flow, windkessel model, mathematical modelling, lumped parameter modelling, frequency domain, fourier transform, fourier series, fluid mechanics MATLAB Answers — New Questions
CTRL + ALT not providing }
I am using CTRL + ALT to write } , however in 2024b this does not work anymore.
I am forced to use ALT GR.
I found no way to change that in the options. In other programs it works perfectly fine.
Is there a way for me to return this function as it was?I am using CTRL + ALT to write } , however in 2024b this does not work anymore.
I am forced to use ALT GR.
I found no way to change that in the options. In other programs it works perfectly fine.
Is there a way for me to return this function as it was? I am using CTRL + ALT to write } , however in 2024b this does not work anymore.
I am forced to use ALT GR.
I found no way to change that in the options. In other programs it works perfectly fine.
Is there a way for me to return this function as it was? keyboard, language, alt gr MATLAB Answers — New Questions
plz explain this code
%Normalizing Signals
x1=x1./sqrt(P1);
x2=x2./sqrt(P2);
x3=x3./sqrt(P3);
x4=x4./sqrt(P4);
SNR=input(‘Enter The desired value of SNR in dBs:’);
N0=10^(-SNR/10);
%generating noise signal of desired SNR
noise=sqrt(N0/l).*randn(1,l);
%Received Signal
r1=x1+noise;
r2=x2+noise;
r3=x3+noise;
r4=x4+noise;
%Matched Filter
M1=filter(fliplr(x1),1,r1);
M2=filter(fliplr(x2),1,r2);
M3=filter(fliplr(x3),1,r3);
M4=filter(fliplr(x4),1,r4);
figure;subplot(411);
plot(M1);
subplot(412);
plot(M2);
subplot(413);
plot(M3);
subplot(414);
plot(M4)
%correlation
X1=xcorr(r1,x1);
X2=xcorr(r2,x2);
X3=xcorr(r3,x3);
X4=xcorr(r4,x4);
figure;subplot(411);
plot(X1);
subplot(412);
plot(X2);
subplot(413);
plot(X3);
subplot(414);
plot(X4)%Normalizing Signals
x1=x1./sqrt(P1);
x2=x2./sqrt(P2);
x3=x3./sqrt(P3);
x4=x4./sqrt(P4);
SNR=input(‘Enter The desired value of SNR in dBs:’);
N0=10^(-SNR/10);
%generating noise signal of desired SNR
noise=sqrt(N0/l).*randn(1,l);
%Received Signal
r1=x1+noise;
r2=x2+noise;
r3=x3+noise;
r4=x4+noise;
%Matched Filter
M1=filter(fliplr(x1),1,r1);
M2=filter(fliplr(x2),1,r2);
M3=filter(fliplr(x3),1,r3);
M4=filter(fliplr(x4),1,r4);
figure;subplot(411);
plot(M1);
subplot(412);
plot(M2);
subplot(413);
plot(M3);
subplot(414);
plot(M4)
%correlation
X1=xcorr(r1,x1);
X2=xcorr(r2,x2);
X3=xcorr(r3,x3);
X4=xcorr(r4,x4);
figure;subplot(411);
plot(X1);
subplot(412);
plot(X2);
subplot(413);
plot(X3);
subplot(414);
plot(X4) %Normalizing Signals
x1=x1./sqrt(P1);
x2=x2./sqrt(P2);
x3=x3./sqrt(P3);
x4=x4./sqrt(P4);
SNR=input(‘Enter The desired value of SNR in dBs:’);
N0=10^(-SNR/10);
%generating noise signal of desired SNR
noise=sqrt(N0/l).*randn(1,l);
%Received Signal
r1=x1+noise;
r2=x2+noise;
r3=x3+noise;
r4=x4+noise;
%Matched Filter
M1=filter(fliplr(x1),1,r1);
M2=filter(fliplr(x2),1,r2);
M3=filter(fliplr(x3),1,r3);
M4=filter(fliplr(x4),1,r4);
figure;subplot(411);
plot(M1);
subplot(412);
plot(M2);
subplot(413);
plot(M3);
subplot(414);
plot(M4)
%correlation
X1=xcorr(r1,x1);
X2=xcorr(r2,x2);
X3=xcorr(r3,x3);
X4=xcorr(r4,x4);
figure;subplot(411);
plot(X1);
subplot(412);
plot(X2);
subplot(413);
plot(X3);
subplot(414);
plot(X4) matched fiter code MATLAB Answers — New Questions
Requirements in a Requirements Table
If I load a requirements table via the slreq.load function, how can the requirement information assocaited with that ReqSet be accessed via commands and NOT through the requirements manager or requirements editor simulink GUIs? I have seen information regarding adding requirements, but there is nothing detailing how to view existing requirements.If I load a requirements table via the slreq.load function, how can the requirement information assocaited with that ReqSet be accessed via commands and NOT through the requirements manager or requirements editor simulink GUIs? I have seen information regarding adding requirements, but there is nothing detailing how to view existing requirements. If I load a requirements table via the slreq.load function, how can the requirement information assocaited with that ReqSet be accessed via commands and NOT through the requirements manager or requirements editor simulink GUIs? I have seen information regarding adding requirements, but there is nothing detailing how to view existing requirements. #requirements MATLAB Answers — New Questions
SharePoint Online Intelligent Versioning and the 500 Version Limit
Trimming to the 500 Version Limit Works Well to a Point
A reader asked about intelligent versioning, the new SharePoint Online method of controlling the amount of storage consumed by file versions created for Office documents. Intelligent versioning uses algorithms to decide what versions must be kept for file recoverability and discards (trims) unnecessary versions. The issue raised was how SharePoint Online deals with versions created past the limit of 500 versions set for sites when intelligent versioning is used.
I’ve already covered the question of how SharePoint Online removes the versions deemed to be unnecessary to recover content. If Purview data lifecycle management (retention policies or labels) are not in force, SharePoint Online can trim versions back to the set needed to recover content. However, if retention applied to a site (policy) or individual file (label), the need to retain all versions trumps trimming and SharePoint Online cannot remove versions.
Retention Requirement Trumps Version Trimming
The same applies to file versions created past the 500 limit. SharePoint Online cannot remove any versions to stay within the limit when retention is in force. For instance, if a file reaches version 501, SharePoint Online will normally remove version 1 to trim the set back to 500. But if retention is in force, version 1 and all other versions must be kept so that eDiscovery processes work.
Figure 1 shows the version history for the source document for the Automating Microsoft 365 with PowerShell eBook (part of the Office 365 for IT Pros bundle). The document is updated very frequently to add new code examples and explanations or to refine existing text and has accumulated 519 versions since the creation of the original file on 10 April 2024. At the date of writing, that’s roughly two versions created each day since.

Finding that the number of versions for a file exceeds 500 is unsurprising. Given the way that the Office applications auto save automatically, several versions can be created during an editing session. For instance, creating the Word document for this article generated ten file versions. Generally speaking, the more changes are made to a file, the more versions are created, especially when new text or other elements are added to the file.
The Influence of Retention
The net result is that the current implementation of intelligent versioning does not contribute to any reduction of storage consumption when data lifecycle management is used. This is disappointing but understandable. If a tenant chooses to deploy retention policies, they obviously have a need to retain content. Being able to retrieve the current version of a document is interesting for eDiscovery investigators, but being able to retrieve earlier versions is often even more valuable.
Searching for a Solution
Whether Microsoft can do anything to resolve the conflict between storage consumption and retention remains to be seen. On the surface, it seems like this is an intractable problem. However, if algorithms can be found to discard file versions on the basis that they are not required to recover content, the ingenuity of software engineering knows no boundaries.
Perhaps the key is to offer tenants a choice between conserving storage by removing unnecessary file versions or maximum retention by keeping every available version. After all, if a version is deemed unnecessary for recovery purposes, it’s might not be of much use for eDiscovery because the differences between the preceding and following versions probably aren’t large. Of course, no self-respecting eDiscovery specialist will countenance the thought of losing any data that might possibly be of interest during an investigation, but sometimes practicality has to come first.
So much change, all the time. It’s a challenge to stay abreast of all the updates Microsoft makes across the Microsoft 365 ecosystem. Subscribe to the Office 365 for IT Pros eBook to receive monthly insights into what happens, why it happens, and what new features and capabilities mean for your tenant.
How to Create a Teams Avatar from a Photo
Create a Teams Avatar from a Photo: Easy, Results: Not So Good
The holiday period is a good opportunity to look over developments that have occurred inside Microsoft 365 and see if we missed anything important for inclusion in the Office 365 for IT Pros eBook. The writing team regularly review the items logged in our Planner plan that’s synchronized with the Microsoft 365 admin message center, but it’s easy to overlook a feature, especially when Microsoft delays its delivery (which happens more often than you’d like) or it’s of marginal interest.
Message center notification MC937922 (19 November 2024), which describes how to create a Teams avatar from a photo, is in the latter category. I wrote about Teams avatars (aka Mesh avatars) when they first appeared in 2023 but have not used them much since. The thought of being able to use a more realistic avatar created from an image spurred on this test.
Service Plans for Mesh Avatars
At one point, Mesh Avatars were a Teams Premium option, but since June 2023 the feature is available in a bunch of product SKUs. MC678301 (last updated 4 October 2023) announced the introduction of the MESH_AVATARS_FOR_TEAMS service plan (id dcf9d2f4-772e-4434-b757-77a453cfbc02) to control access to avatars. Checking the Entra ID product names and service plan identifiers page, you’ll find that the service plan is included in plans like:
- Microsoft 365 Business Standard
- Microsoft 365 Business Premium
- Microsoft 365 E3
- Microsoft 365 E3 (No Teams)
- Microsoft 365 E3 EEA
- Teams (EEA)
- Microsoft 365 E5
- Office 365 E1
- Office 365 E3
Oddly, the avatars service plan is not listed for Office 365 E5. This might be because of the change in licensing from the decision to unbundle Teams from Microsoft 365 following action by the European Union. Given that Office 365 E3 and E1 still include the Mesh Avatars service plan, the situation is inconsistent at present. To check if a license includes the Mesh Avatars service plan, you can check the service plans available to a user account that’s assigned the license. For example:
$MeshId = 'dcf9d2f4-772e-4434-b757-77a453cfbc02' $User = Get-MgUser -UserId Jim.Jones@Office365itpros.com # User with assigned license $SkuId = "6fd2c87f-b296-42f0-b197-1e91e994b900" # SKU to check. In this casem, it's Office 365 E3 [array]$ServicePlans = Get-MgUserLicenseDetail -UserId $User.Id | Where-Object {$_.SkuId -eq $SkuId} | Select-Object -ExpandProperty ServicePlans | Sort-Object ServicePlanName If ($MeshId -in $ServicePlans.ServicePlanId) { Write-Host ('Teams Mesh Avatars service plan found in {0}'-f $SKUId) } Teams Mesh Avatars service plan found in 6fd2c87f-b296-42f0-b197-1e91e994b900
Creating an Avatar from a Photo
A user account can have up to three avatars which are maintained through the Teams Avatars app (obviously, users must be allowed to access the app to maintain their avatars). I already had three avatars, so I had to remove an existing avatar before I could create an avatar from a photo. After that, it’s a matter of selecting the option to use a photo rather than designing a new avatar from scratch. You can use the workstation camera to take a photo or upload an existing JPEG, BMP, or PNG file of up to 10 MB.
The guidelines in the app say that an uploaded image should be taken in a well-lit environment. I used a professional headshot taken at the Ignite 2016 conference (Figure 1). Sure, the photo is nine years old now, but it’s good enough for a test.

Clicking the button to proceed is the signal for Teams to use the biometric data extracted from the image to build three different versions of an avatar to choose from. I wasn’t impressed with the results (Figure 2) because I don’t think any of the avatars came anywhere close to the source image.

After choosing the avatar that seems closest to reality, you can edit its details to improve it. For instance, the hair color in all the generated avatars was way off, so I elected to use “arctic white” instead. You can also play around with skin tone, body form, clothing, and so on to create the perfect avatar, or at least as close as the technology can get you to perfection in its current state. Figure 3 shows my final result.

I also tried by taking a photo using the PC camera, but the results were no better.
Avatar Generated from Photo is Better But Not Great
The avatar generated from the uploaded photo is closer to my actual form than the avatars I was able to create from scratch (known as base avatars), but only slightly. I was disappointed at the outcome because I reckoned that the input photo was of sufficiently high quality for Teams to generate a nice result. Alas, I fear that I might need to wait for a further iteration before the software can create a truly representative avatar from an image.
Your mileage might vary etc. It could be that my face isn’t conducive to biometric modelling!
Learn how to exploit the data available to Microsoft 365 tenant administrators through the Office 365 for IT Pros eBook. We love figuring out how things work.