Month: October 2024
Need assistance on SQL server query
Hi All,
I have a account table which has parent acct number, Customer name, Account number.
the issue is 1 parent account number should have only one customer name even though account number is different like below
1 parent acc num // 2 customer name // 2 Accounts
1123456789 – NIKE – AAAAA1
1123456789 – NIKES -AAAAA2
but i need to update output like below for all parent account numbers which has different names,
=>> write the query to update that the data for customer name remains the same
1 parent acc num // 1 customer name // 2 Accounts
1123456789 – NIKE – AAAAA1
1123456789 – NIKE -AAAAA2
Could you please assist me to write an update quey to update 1 parent account number has 1 customer name.
Thanks in advance for your support.
Regards,
Bhaskar
Hi All, I have a account table which has parent acct number, Customer name, Account number. the issue is 1 parent account number should have only one customer name even though account number is different like below 1 parent acc num // 2 customer name // 2 Accounts1123456789 – NIKE – AAAAA11123456789 – NIKES -AAAAA2 but i need to update output like below for all parent account numbers which has different names,=>> write the query to update that the data for customer name remains the same1 parent acc num // 1 customer name // 2 Accounts1123456789 – NIKE – AAAAA11123456789 – NIKE -AAAAA2 Could you please assist me to write an update quey to update 1 parent account number has 1 customer name.Thanks in advance for your support. Regards,Bhaskar Read More
How on earth do I get my mails from all my email addresses without being connected to the cloud.
I do not approve of the waste of energy and resourses consumed by the cloud.
If Windows insists I shall ditch Windows which I have used since its very beginning and change over to Linux.
How on earth do I get my mails from all my email addresses without being connected to the cloud. I do not approve of the waste of energy and resourses consumed by the cloud.If Windows insists I shall ditch Windows which I have used since its very beginning and change over to Linux. Read More
Conditional Formatting
Hello
I have a spreadsheet that has no conditional formatting set up, that i can see anyway. However, when something is typed in a cell it auto highlights the cell. How can this be changed?
Thanks
HelloI have a spreadsheet that has no conditional formatting set up, that i can see anyway. However, when something is typed in a cell it auto highlights the cell. How can this be changed?Thanks Read More
MCT Enrollment Tool
Hello TSP Team,
one of our MCTs has missed to renew his MCT state and has tried to renew it with the enrollment tool.
He tried again yesterday (Oct, 1). Its still not working.
Can you please tell me how to renew/reactivate his state (expired on Feb, 26. 2024), A post to the MCT support forum didnt help.
His MCP-Id is: 9237256
Regards,
Mario
Hello TSP Team, one of our MCTs has missed to renew his MCT state and has tried to renew it with the enrollment tool.He tried again yesterday (Oct, 1). Its still not working. Can you please tell me how to renew/reactivate his state (expired on Feb, 26. 2024), A post to the MCT support forum didnt help. His MCP-Id is: 9237256 Regards,Mario Read More
Xlookup or other formula help for copying data over but excluding specific data
I have sheet A that has 3000 rows of data, and I have sheet B that has 1000 rows of data. I want to copy all data from sheet A to a new sheet, sheet C, but exclude all rows that are in Sheet B. Sheet B consists of data that is in sheet A that I do not want in there so I’m not sure the best way to exclude/filter that sheet B data out. Any help is appreciated, thank you!
i.e. if sheet C includes any data from sheet B, remove/do not include that row.
I have sheet A that has 3000 rows of data, and I have sheet B that has 1000 rows of data. I want to copy all data from sheet A to a new sheet, sheet C, but exclude all rows that are in Sheet B. Sheet B consists of data that is in sheet A that I do not want in there so I’m not sure the best way to exclude/filter that sheet B data out. Any help is appreciated, thank you! i.e. if sheet C includes any data from sheet B, remove/do not include that row. Read More
Pick out rows from an array where the 1st column is closest to a multiple of a number
Hello, Im trying to downsample a 100k lines of excel and want to pick out only those rows where the column 1 values are closest to multiples of a number, say 50. So in the pic below, just the green highlighted rows.
I’ve thought about using mod but this doesn’t work:
%For example if I choose these numbers (and consider just a column vector)
n=[1;5;7;9;12;15;29;33;39]
and want to pick out those numbers closest to multiples of 10
mod(n,10)
ans =
1
5
7
9
2
5
9
3
9
If I sort these and pick out the lowest ones, the value of 29 & 39 wouldn’t be picked out.
I also considered some kind of interp, but I need to pick out the actual discrete value from the table below not an interpolated value. Normally I show my arttempt, but Im actually stuck here in where to actually start with this.Hello, Im trying to downsample a 100k lines of excel and want to pick out only those rows where the column 1 values are closest to multiples of a number, say 50. So in the pic below, just the green highlighted rows.
I’ve thought about using mod but this doesn’t work:
%For example if I choose these numbers (and consider just a column vector)
n=[1;5;7;9;12;15;29;33;39]
and want to pick out those numbers closest to multiples of 10
mod(n,10)
ans =
1
5
7
9
2
5
9
3
9
If I sort these and pick out the lowest ones, the value of 29 & 39 wouldn’t be picked out.
I also considered some kind of interp, but I need to pick out the actual discrete value from the table below not an interpolated value. Normally I show my arttempt, but Im actually stuck here in where to actually start with this. Hello, Im trying to downsample a 100k lines of excel and want to pick out only those rows where the column 1 values are closest to multiples of a number, say 50. So in the pic below, just the green highlighted rows.
I’ve thought about using mod but this doesn’t work:
%For example if I choose these numbers (and consider just a column vector)
n=[1;5;7;9;12;15;29;33;39]
and want to pick out those numbers closest to multiples of 10
mod(n,10)
ans =
1
5
7
9
2
5
9
3
9
If I sort these and pick out the lowest ones, the value of 29 & 39 wouldn’t be picked out.
I also considered some kind of interp, but I need to pick out the actual discrete value from the table below not an interpolated value. Normally I show my arttempt, but Im actually stuck here in where to actually start with this. array, mod MATLAB Answers — New Questions
Copilot in Onedrive not available
Hello community we have one single user that does not see Copilot in Onedrive. The user is correctly licensed with M365 Copilot and he’s a proficient user with all the applications. We assigned the license in march already, so he can use it in every application.
The only problem is that Copilot did no appeared in this user’s onedrive. On the same tenant we have 100+ Copilot licenses, and we have no report of other user’s with the same problem.
Any suggestion about which can be the problem please ?
Hello community we have one single user that does not see Copilot in Onedrive. The user is correctly licensed with M365 Copilot and he’s a proficient user with all the applications. We assigned the license in march already, so he can use it in every application. The only problem is that Copilot did no appeared in this user’s onedrive. On the same tenant we have 100+ Copilot licenses, and we have no report of other user’s with the same problem.Any suggestion about which can be the problem please ? Read More
List Forms designed with PowerApps – Interface Change after Microsoft Update
An update was rolled out to M365 Tenants I believe which included new Microsoft Lists User Experience Update.
Existing lists configured with PowerApps forms were updated after this rollout and forms using full width (Large landscape orientation) now appear with horizontal scrollbar.
Forms also appear as a dialog box rather than from bottom right. Under list settings, open forms as dialog box are selected as a No.
Is it possible to fix this through Admin Center configuration for PowerApps or SharePoint? Have community members observed this as well?
An update was rolled out to M365 Tenants I believe which included new Microsoft Lists User Experience Update.Existing lists configured with PowerApps forms were updated after this rollout and forms using full width (Large landscape orientation) now appear with horizontal scrollbar.Forms also appear as a dialog box rather than from bottom right. Under list settings, open forms as dialog box are selected as a No.Is it possible to fix this through Admin Center configuration for PowerApps or SharePoint? Have community members observed this as well? Read More
MS List opening with a different view…….
I have numerous MS Lists. This morning several, but not all of them, started opening in Lists as below,
As opposed to:
The tabs have also vanished form across the screen and are now in a vertical drop down men (which to be honest i quite like!).
More importantly its now painfully slow……….
Edit: Also the logo in the tabs have changed in those affected, from the usual shaded yellow to purple icon to that of a sharepoint logo….
Is this a temporary thing? Or do I have to raise a ticket and wait for a miracle?
I have numerous MS Lists. This morning several, but not all of them, started opening in Lists as below, As opposed to:The tabs have also vanished form across the screen and are now in a vertical drop down men (which to be honest i quite like!). More importantly its now painfully slow……….Edit: Also the logo in the tabs have changed in those affected, from the usual shaded yellow to purple icon to that of a sharepoint logo….Is this a temporary thing? Or do I have to raise a ticket and wait for a miracle? Read More
Making Sure that Outlook Puts Deleted Items in the Right Place
The Outlook (classic) client has a registry setting to control moving deleted items from a shared mailbox. The new Outlook for Windows client doesn’t have an equivalent setting, so items removed from a shared mailbox end up in the Deleted Items folder of the user’s mailbox rather than the Deleted Items folder in the shared mailbox. It’s an example of one of the things to fix before the new Outlook can take over.
https://office365itpros.com/2024/10/02/moving-deleted-items/
The Outlook (classic) client has a registry setting to control moving deleted items from a shared mailbox. The new Outlook for Windows client doesn’t have an equivalent setting, so items removed from a shared mailbox end up in the Deleted Items folder of the user’s mailbox rather than the Deleted Items folder in the shared mailbox. It’s an example of one of the things to fix before the new Outlook can take over.
https://office365itpros.com/2024/10/02/moving-deleted-items/ Read More
mise a jour insider impossible
Windows 11 Insider Preview 10.0.26120.1912 (ge_release_svc_betaflt_upr) (version de réparation)cette version ne veut pas s’instaler sur mon ordinateur alors quil a tout les prerequis pour cela
de plus quand je veut quitter le programme insider cela mais impossible cela me repond que mon compte outlook ne correspond pas
Windows 11 Insider Preview 10.0.26120.1912 (ge_release_svc_betaflt_upr) (version de réparation)cette version ne veut pas s’instaler sur mon ordinateur alors quil a tout les prerequis pour celade plus quand je veut quitter le programme insider cela mais impossible cela me repond que mon compte outlook ne correspond pas Read More
MS Teams add in was not showing in Outlook, Online support said to uninstall, now I can’t
I am trying to get my outlook and teams to sync, so I can create a teams meeting from outlook. The add in was not available. Online boards said this could be due to the TEAMS not installing correctly, and told me to unistall. After doing this, I cannot seem to find in MS store to re-install.
I am trying to get my outlook and teams to sync, so I can create a teams meeting from outlook. The add in was not available. Online boards said this could be due to the TEAMS not installing correctly, and told me to unistall. After doing this, I cannot seem to find in MS store to re-install. Read More
Does not update Windows Insider
I have a serious problem after various fix attempts with SFC and manuals, Windows Update with the Insider Beta version Microsoft Windows [Version 10.0.22635.4145] does not update to the new build with the following reason: Some files are missing update or there are problems. We will automatically attempt to download the update again later. Error Code: (0x8007000d)
I have a serious problem after various fix attempts with SFC and manuals, Windows Update with the Insider Beta version Microsoft Windows [Version 10.0.22635.4145] does not update to the new build with the following reason: Some files are missing update or there are problems. We will automatically attempt to download the update again later. Error Code: (0x8007000d) Read More
How to Prevent or Block Company users from Adding another Microsoft Work account in IOS Intune
Hello Experts,
We have iOS iPhone Devices managed via Microsoft Intune.
We want to prevent users from Adding any other Microsoft work account into Company Mobile iPhone which is Enrolled via Intune. So User can use only his Company Work account and not any other Company’s WorkSchool account.
Please suggest if there is way to achieve this.
Hello Experts, We have iOS iPhone Devices managed via Microsoft Intune. We want to prevent users from Adding any other Microsoft work account into Company Mobile iPhone which is Enrolled via Intune. So User can use only his Company Work account and not any other Company’s WorkSchool account. Please suggest if there is way to achieve this. Read More
I am trying to convert the date data from the CSV file to datetime, but it shows error, how do I fix this
dates=string(raw.textdata(2:end,1));%import the string dates from the data
dates=datetime(dates,’InputFormat’,’dd/MM/yy’); %convert date strings to date time format
%monthly vectors
m=unique(month(dates));%Get unique months form the data set
m_sum_Production=zeros(length(m),1);%initial monthly sum of Production
m_sum_T_Consumption=zeros(length(m),1);%initial monthly sum of Total Consumption
m_sum_O_Consumption=zeros(length(m),1);%initial monthly sum of Own Consumption
for i =1:length(m)
current_months=month(dates)==m(i); %checks each date to see if its month matches the current month
m_sum_Production(i) = sum(Production(current_months));%monthly sum of Production
m_sum_T_Consumption(i) = sum(T_Consumption(current_months));%monthly sum of Total Consumption
m_sum_O_Consumption(i) = sum(O_Consumption(current_months));%monthly sum of Own Consumption
end
code above
dates =
1505×1 string array
"06-Apr-20"
"07-Apr-20"
"08-Apr-20"
"09-Apr-20"
"10-Apr-20"
"11-Apr-20"
"12-Apr-20"
"13-Apr-20"
"14-Apr-20"
"15-Apr-20"
"16-Apr-20"
"17-Apr-20"
"18-Apr-20"
"19-Apr-20"
"20-Apr-20"
"21-Apr-20"
"22-Apr-20"
"23-Apr-20"
"24-Apr-20"
"25-Apr-20"
"26-Apr-20"
"27-Apr-20"
"28-Apr-20"
"29-Apr-20"
"30-Apr-20"
"01-May-20"
"02-May-20"
"03-May-20"
"04-May-20"
"05-May-20"
"06-May-20"
error encounter below
Error using datetime (line 667)
Unable to convert the text to datetime using the format ‘dd/MM/yy’.
Error in Q3 (line 13)
dates=datetime(dates,’InputFormat’,’dd/MM/yy’); %convert date strings to date time formatdates=string(raw.textdata(2:end,1));%import the string dates from the data
dates=datetime(dates,’InputFormat’,’dd/MM/yy’); %convert date strings to date time format
%monthly vectors
m=unique(month(dates));%Get unique months form the data set
m_sum_Production=zeros(length(m),1);%initial monthly sum of Production
m_sum_T_Consumption=zeros(length(m),1);%initial monthly sum of Total Consumption
m_sum_O_Consumption=zeros(length(m),1);%initial monthly sum of Own Consumption
for i =1:length(m)
current_months=month(dates)==m(i); %checks each date to see if its month matches the current month
m_sum_Production(i) = sum(Production(current_months));%monthly sum of Production
m_sum_T_Consumption(i) = sum(T_Consumption(current_months));%monthly sum of Total Consumption
m_sum_O_Consumption(i) = sum(O_Consumption(current_months));%monthly sum of Own Consumption
end
code above
dates =
1505×1 string array
"06-Apr-20"
"07-Apr-20"
"08-Apr-20"
"09-Apr-20"
"10-Apr-20"
"11-Apr-20"
"12-Apr-20"
"13-Apr-20"
"14-Apr-20"
"15-Apr-20"
"16-Apr-20"
"17-Apr-20"
"18-Apr-20"
"19-Apr-20"
"20-Apr-20"
"21-Apr-20"
"22-Apr-20"
"23-Apr-20"
"24-Apr-20"
"25-Apr-20"
"26-Apr-20"
"27-Apr-20"
"28-Apr-20"
"29-Apr-20"
"30-Apr-20"
"01-May-20"
"02-May-20"
"03-May-20"
"04-May-20"
"05-May-20"
"06-May-20"
error encounter below
Error using datetime (line 667)
Unable to convert the text to datetime using the format ‘dd/MM/yy’.
Error in Q3 (line 13)
dates=datetime(dates,’InputFormat’,’dd/MM/yy’); %convert date strings to date time format dates=string(raw.textdata(2:end,1));%import the string dates from the data
dates=datetime(dates,’InputFormat’,’dd/MM/yy’); %convert date strings to date time format
%monthly vectors
m=unique(month(dates));%Get unique months form the data set
m_sum_Production=zeros(length(m),1);%initial monthly sum of Production
m_sum_T_Consumption=zeros(length(m),1);%initial monthly sum of Total Consumption
m_sum_O_Consumption=zeros(length(m),1);%initial monthly sum of Own Consumption
for i =1:length(m)
current_months=month(dates)==m(i); %checks each date to see if its month matches the current month
m_sum_Production(i) = sum(Production(current_months));%monthly sum of Production
m_sum_T_Consumption(i) = sum(T_Consumption(current_months));%monthly sum of Total Consumption
m_sum_O_Consumption(i) = sum(O_Consumption(current_months));%monthly sum of Own Consumption
end
code above
dates =
1505×1 string array
"06-Apr-20"
"07-Apr-20"
"08-Apr-20"
"09-Apr-20"
"10-Apr-20"
"11-Apr-20"
"12-Apr-20"
"13-Apr-20"
"14-Apr-20"
"15-Apr-20"
"16-Apr-20"
"17-Apr-20"
"18-Apr-20"
"19-Apr-20"
"20-Apr-20"
"21-Apr-20"
"22-Apr-20"
"23-Apr-20"
"24-Apr-20"
"25-Apr-20"
"26-Apr-20"
"27-Apr-20"
"28-Apr-20"
"29-Apr-20"
"30-Apr-20"
"01-May-20"
"02-May-20"
"03-May-20"
"04-May-20"
"05-May-20"
"06-May-20"
error encounter below
Error using datetime (line 667)
Unable to convert the text to datetime using the format ‘dd/MM/yy’.
Error in Q3 (line 13)
dates=datetime(dates,’InputFormat’,’dd/MM/yy’); %convert date strings to date time format datetime MATLAB Answers — New Questions
Can I use a struct in an anonymous function?
I am solving a PDE via finite volume methods. As a result, I am left with a set of ODEs which I solve with ode15s. I have a bunch of constants which I use in the function defining the derivative, and I insert these by the inclusion of a struct to the function. When I run the ode15s I obtain an error which pertains to the inclusion of the struct as an input to the function. I don’t really want to include the constants within the function as that seems "messy", so I would prefer to do it via a struct.
%This is a code to solve the isothermal sintering equations.
%%—Physical parameters—
S=struct;
S.g = 9.81; %Acceleration due to gravity.
S.K = 1; %This is the Laplace constant from the sintering potential.
S.eta_0 = 1; %The shear stress of the skeleton
S.T = 3600; %This is the time of sintering.
S.M = 0.1; %This is the total mass of the rod being sintered .
S.rho_m = 1; %This is the density of the individual metallic particles.
S.N = 251; %This is the number of cells-1
L = 1; %This is the initial length of the rod
%%—Initial conditions
%Length
X=linspace(0,L,S.N); %This is the partition of the initial length
%Density
rho_0=0.5+0.1*sin(6*pi*X);
%Amount of mass
S.h=cumtrapz(X,rho_0);
%Initial velocity
u0=zeros(S.N-1,1);
% Define the system of equations as a function
y0 = [1./rho_0′; u0];
% Finite Volume Method solution loop
tspan = [0 3]; % You can adjust this based on the time range you’re interested in
[t, y] = ode15s(@ode_system, tspan, y0);
function dydt = ode_system(t, y, S)
S.M
U=S.M/(S.rho_m*S.T);
a_1=S.T/(U*S.M);
a_2=S.T*S.rho_m/S.M^2;
a_3=S.g*S.T/U;
dh=diff(S.h);
y=NaN(1,2*S.N-2);
nu = y(1:S.N-1); % u(t)
u = y(S.N:2*S.N-2); % v(t)
%Compute the left and right specific volumes:
nu_left=15*nu(1)/8-5*nu(2)/4+3*nu(3)/8;
nu_right=15*nu(S.N-3)/8-5*nu(S.N-2)/5+3*nu(S.N-1)/8;
%Compute the fluxes on the interfaces
nu_half=NaN(1:S.N);
nu_half(2:N-1)=0.5*(nu(2:S.N-1)+nu(1:S.N-2));
nu_half(1)=nu_left;
nu_half(N)=nu_right;
%Fluxes for nu equation
nu_flux=zeros(S.N,1);
nu_flux(2:S.N-1)=0.5*(u(1:S.N-2)+u(2:S.N-1));
du_dh_left=-P_L(S,nu_left)*nu_left/zeta(nu_left);
du_dh_right=-P_L(S,nu_right)*nu_right/zeta(nu_right);
nu_flux(1)=-3*du_dh_left*dh(1)/8+9*u(1)/8-u(2)/8;
nu_flux(N)=3*du_dh_right*dh(N-1)/8-9*u(N-1)/8+u(N-2)/8;
%Fluxes for u equation
u_grad=2*(u(2:S.N-2)-u(1:S.N-2))./(dh(2:S.N-1)+dh(1:S.N-2));
u_flux=NaN(S.N,1);
u_flux(2:S.N-1)=a_1*P_L(S,nu_half(2:S.N-1))+(a_2*zeta(nu_half(2:S.N-1))./nu_half(2:S.N-1)).*u_grad;
% The system of equationsY
dnu_dt = nu_flux(2:S.N)-nu_flux(1:S.N-1);
du_dt =u_flux(2:S.N)-u_flux(1:S.N-1);
% Return the derivatives
dydt = [dnu_dt; du_dt];
end
function y=P_L(S,nu)
y=S.K./nu;
end
function y=zeta(nu)
y=(2/3)*(nu).^(-2)./(nu-1);
endI am solving a PDE via finite volume methods. As a result, I am left with a set of ODEs which I solve with ode15s. I have a bunch of constants which I use in the function defining the derivative, and I insert these by the inclusion of a struct to the function. When I run the ode15s I obtain an error which pertains to the inclusion of the struct as an input to the function. I don’t really want to include the constants within the function as that seems "messy", so I would prefer to do it via a struct.
%This is a code to solve the isothermal sintering equations.
%%—Physical parameters—
S=struct;
S.g = 9.81; %Acceleration due to gravity.
S.K = 1; %This is the Laplace constant from the sintering potential.
S.eta_0 = 1; %The shear stress of the skeleton
S.T = 3600; %This is the time of sintering.
S.M = 0.1; %This is the total mass of the rod being sintered .
S.rho_m = 1; %This is the density of the individual metallic particles.
S.N = 251; %This is the number of cells-1
L = 1; %This is the initial length of the rod
%%—Initial conditions
%Length
X=linspace(0,L,S.N); %This is the partition of the initial length
%Density
rho_0=0.5+0.1*sin(6*pi*X);
%Amount of mass
S.h=cumtrapz(X,rho_0);
%Initial velocity
u0=zeros(S.N-1,1);
% Define the system of equations as a function
y0 = [1./rho_0′; u0];
% Finite Volume Method solution loop
tspan = [0 3]; % You can adjust this based on the time range you’re interested in
[t, y] = ode15s(@ode_system, tspan, y0);
function dydt = ode_system(t, y, S)
S.M
U=S.M/(S.rho_m*S.T);
a_1=S.T/(U*S.M);
a_2=S.T*S.rho_m/S.M^2;
a_3=S.g*S.T/U;
dh=diff(S.h);
y=NaN(1,2*S.N-2);
nu = y(1:S.N-1); % u(t)
u = y(S.N:2*S.N-2); % v(t)
%Compute the left and right specific volumes:
nu_left=15*nu(1)/8-5*nu(2)/4+3*nu(3)/8;
nu_right=15*nu(S.N-3)/8-5*nu(S.N-2)/5+3*nu(S.N-1)/8;
%Compute the fluxes on the interfaces
nu_half=NaN(1:S.N);
nu_half(2:N-1)=0.5*(nu(2:S.N-1)+nu(1:S.N-2));
nu_half(1)=nu_left;
nu_half(N)=nu_right;
%Fluxes for nu equation
nu_flux=zeros(S.N,1);
nu_flux(2:S.N-1)=0.5*(u(1:S.N-2)+u(2:S.N-1));
du_dh_left=-P_L(S,nu_left)*nu_left/zeta(nu_left);
du_dh_right=-P_L(S,nu_right)*nu_right/zeta(nu_right);
nu_flux(1)=-3*du_dh_left*dh(1)/8+9*u(1)/8-u(2)/8;
nu_flux(N)=3*du_dh_right*dh(N-1)/8-9*u(N-1)/8+u(N-2)/8;
%Fluxes for u equation
u_grad=2*(u(2:S.N-2)-u(1:S.N-2))./(dh(2:S.N-1)+dh(1:S.N-2));
u_flux=NaN(S.N,1);
u_flux(2:S.N-1)=a_1*P_L(S,nu_half(2:S.N-1))+(a_2*zeta(nu_half(2:S.N-1))./nu_half(2:S.N-1)).*u_grad;
% The system of equationsY
dnu_dt = nu_flux(2:S.N)-nu_flux(1:S.N-1);
du_dt =u_flux(2:S.N)-u_flux(1:S.N-1);
% Return the derivatives
dydt = [dnu_dt; du_dt];
end
function y=P_L(S,nu)
y=S.K./nu;
end
function y=zeta(nu)
y=(2/3)*(nu).^(-2)./(nu-1);
end I am solving a PDE via finite volume methods. As a result, I am left with a set of ODEs which I solve with ode15s. I have a bunch of constants which I use in the function defining the derivative, and I insert these by the inclusion of a struct to the function. When I run the ode15s I obtain an error which pertains to the inclusion of the struct as an input to the function. I don’t really want to include the constants within the function as that seems "messy", so I would prefer to do it via a struct.
%This is a code to solve the isothermal sintering equations.
%%—Physical parameters—
S=struct;
S.g = 9.81; %Acceleration due to gravity.
S.K = 1; %This is the Laplace constant from the sintering potential.
S.eta_0 = 1; %The shear stress of the skeleton
S.T = 3600; %This is the time of sintering.
S.M = 0.1; %This is the total mass of the rod being sintered .
S.rho_m = 1; %This is the density of the individual metallic particles.
S.N = 251; %This is the number of cells-1
L = 1; %This is the initial length of the rod
%%—Initial conditions
%Length
X=linspace(0,L,S.N); %This is the partition of the initial length
%Density
rho_0=0.5+0.1*sin(6*pi*X);
%Amount of mass
S.h=cumtrapz(X,rho_0);
%Initial velocity
u0=zeros(S.N-1,1);
% Define the system of equations as a function
y0 = [1./rho_0′; u0];
% Finite Volume Method solution loop
tspan = [0 3]; % You can adjust this based on the time range you’re interested in
[t, y] = ode15s(@ode_system, tspan, y0);
function dydt = ode_system(t, y, S)
S.M
U=S.M/(S.rho_m*S.T);
a_1=S.T/(U*S.M);
a_2=S.T*S.rho_m/S.M^2;
a_3=S.g*S.T/U;
dh=diff(S.h);
y=NaN(1,2*S.N-2);
nu = y(1:S.N-1); % u(t)
u = y(S.N:2*S.N-2); % v(t)
%Compute the left and right specific volumes:
nu_left=15*nu(1)/8-5*nu(2)/4+3*nu(3)/8;
nu_right=15*nu(S.N-3)/8-5*nu(S.N-2)/5+3*nu(S.N-1)/8;
%Compute the fluxes on the interfaces
nu_half=NaN(1:S.N);
nu_half(2:N-1)=0.5*(nu(2:S.N-1)+nu(1:S.N-2));
nu_half(1)=nu_left;
nu_half(N)=nu_right;
%Fluxes for nu equation
nu_flux=zeros(S.N,1);
nu_flux(2:S.N-1)=0.5*(u(1:S.N-2)+u(2:S.N-1));
du_dh_left=-P_L(S,nu_left)*nu_left/zeta(nu_left);
du_dh_right=-P_L(S,nu_right)*nu_right/zeta(nu_right);
nu_flux(1)=-3*du_dh_left*dh(1)/8+9*u(1)/8-u(2)/8;
nu_flux(N)=3*du_dh_right*dh(N-1)/8-9*u(N-1)/8+u(N-2)/8;
%Fluxes for u equation
u_grad=2*(u(2:S.N-2)-u(1:S.N-2))./(dh(2:S.N-1)+dh(1:S.N-2));
u_flux=NaN(S.N,1);
u_flux(2:S.N-1)=a_1*P_L(S,nu_half(2:S.N-1))+(a_2*zeta(nu_half(2:S.N-1))./nu_half(2:S.N-1)).*u_grad;
% The system of equationsY
dnu_dt = nu_flux(2:S.N)-nu_flux(1:S.N-1);
du_dt =u_flux(2:S.N)-u_flux(1:S.N-1);
% Return the derivatives
dydt = [dnu_dt; du_dt];
end
function y=P_L(S,nu)
y=S.K./nu;
end
function y=zeta(nu)
y=(2/3)*(nu).^(-2)./(nu-1);
end anonymous, function MATLAB Answers — New Questions
Writing an exponential equation in the title
I would like to write my exponential equation in the title of my figure. Right now I have:
title([‘y = ‘,num2str(a),’ x^’, (num2str(n))]);
The problem is my equation comes out as: y = 8.56 x^(0).68, which is not what I want.
I want would the title to be y = 8.56 x^(0.68). How do I do this?I would like to write my exponential equation in the title of my figure. Right now I have:
title([‘y = ‘,num2str(a),’ x^’, (num2str(n))]);
The problem is my equation comes out as: y = 8.56 x^(0).68, which is not what I want.
I want would the title to be y = 8.56 x^(0.68). How do I do this? I would like to write my exponential equation in the title of my figure. Right now I have:
title([‘y = ‘,num2str(a),’ x^’, (num2str(n))]);
The problem is my equation comes out as: y = 8.56 x^(0).68, which is not what I want.
I want would the title to be y = 8.56 x^(0.68). How do I do this? num2str MATLAB Answers — New Questions
Bandpass filter Transient Response. How to get rid of it?
I created this bandpass filter and plotted it’s impulse response:
% Bandpass filter parameters
f_nyquist = sampling_frequency / 2;
low_cutoff_frequency = 6; % Low cutoff frequency in Hz
high_cutoff_frequency = 400; % High cutoff frequency in Hz
% Design the bandpass filter
[b, a_filter] = butter(2, [low_cutoff_frequency, high_cutoff_frequency] / (f_nyquist), ‘bandpass’);
% Create an impulse signal (Dirac delta function)
impulse_signal = zeros(1, 1000); % Change 1000 to the desired length
impulse_signal(1) = 1; % Set the first sample to 1
% Apply bandpass filter to the impulse signal
impulse_response = filtfilt(b, a_filter, impulse_signal);
% Time vector for plotting
time = (0:length(impulse_response)-1) / sampling_frequency;
% Plot the impulse response
figure(‘Name’, ‘Impulse Response of the Bandpass Filter’);
plot(time, impulse_response);
title(‘Impulse Response of the Bandpass Filter’);
xlabel(‘Time (s)’);
ylabel(‘Amplitude’);
grid on;
[h, f] = freqz(b, a_filter, 1024, ‘whole’); % Frequency response
figure;
plot(f/pi * (sampling_frequency/2), abs(h)); % Plot magnitude response
xlabel(‘Frequency (Hz)’);
ylabel(‘Magnitude’);
title(‘Frequency Response of the Bandpass Filter’);
grid on;
Why is there a spike from zero to -0.1?
That’s the bandpass filtered sEMG signal. How can I remove the information that may be the transient response around 0 and the info around 4 seconds where I attenuate my signal in order to not include the switch (stop of an experiment)?
That’s the impulse response of the bandpass filter.I created this bandpass filter and plotted it’s impulse response:
% Bandpass filter parameters
f_nyquist = sampling_frequency / 2;
low_cutoff_frequency = 6; % Low cutoff frequency in Hz
high_cutoff_frequency = 400; % High cutoff frequency in Hz
% Design the bandpass filter
[b, a_filter] = butter(2, [low_cutoff_frequency, high_cutoff_frequency] / (f_nyquist), ‘bandpass’);
% Create an impulse signal (Dirac delta function)
impulse_signal = zeros(1, 1000); % Change 1000 to the desired length
impulse_signal(1) = 1; % Set the first sample to 1
% Apply bandpass filter to the impulse signal
impulse_response = filtfilt(b, a_filter, impulse_signal);
% Time vector for plotting
time = (0:length(impulse_response)-1) / sampling_frequency;
% Plot the impulse response
figure(‘Name’, ‘Impulse Response of the Bandpass Filter’);
plot(time, impulse_response);
title(‘Impulse Response of the Bandpass Filter’);
xlabel(‘Time (s)’);
ylabel(‘Amplitude’);
grid on;
[h, f] = freqz(b, a_filter, 1024, ‘whole’); % Frequency response
figure;
plot(f/pi * (sampling_frequency/2), abs(h)); % Plot magnitude response
xlabel(‘Frequency (Hz)’);
ylabel(‘Magnitude’);
title(‘Frequency Response of the Bandpass Filter’);
grid on;
Why is there a spike from zero to -0.1?
That’s the bandpass filtered sEMG signal. How can I remove the information that may be the transient response around 0 and the info around 4 seconds where I attenuate my signal in order to not include the switch (stop of an experiment)?
That’s the impulse response of the bandpass filter. I created this bandpass filter and plotted it’s impulse response:
% Bandpass filter parameters
f_nyquist = sampling_frequency / 2;
low_cutoff_frequency = 6; % Low cutoff frequency in Hz
high_cutoff_frequency = 400; % High cutoff frequency in Hz
% Design the bandpass filter
[b, a_filter] = butter(2, [low_cutoff_frequency, high_cutoff_frequency] / (f_nyquist), ‘bandpass’);
% Create an impulse signal (Dirac delta function)
impulse_signal = zeros(1, 1000); % Change 1000 to the desired length
impulse_signal(1) = 1; % Set the first sample to 1
% Apply bandpass filter to the impulse signal
impulse_response = filtfilt(b, a_filter, impulse_signal);
% Time vector for plotting
time = (0:length(impulse_response)-1) / sampling_frequency;
% Plot the impulse response
figure(‘Name’, ‘Impulse Response of the Bandpass Filter’);
plot(time, impulse_response);
title(‘Impulse Response of the Bandpass Filter’);
xlabel(‘Time (s)’);
ylabel(‘Amplitude’);
grid on;
[h, f] = freqz(b, a_filter, 1024, ‘whole’); % Frequency response
figure;
plot(f/pi * (sampling_frequency/2), abs(h)); % Plot magnitude response
xlabel(‘Frequency (Hz)’);
ylabel(‘Magnitude’);
title(‘Frequency Response of the Bandpass Filter’);
grid on;
Why is there a spike from zero to -0.1?
That’s the bandpass filtered sEMG signal. How can I remove the information that may be the transient response around 0 and the info around 4 seconds where I attenuate my signal in order to not include the switch (stop of an experiment)?
That’s the impulse response of the bandpass filter. bandpass filter, impulse response, emg signals, transient response MATLAB Answers — New Questions
control simulink panel dashboard programmatically
I want to create an application using simulink dashboards wich are put in panel.
is there any documentation on parameters that i can set using set_param on this panel?
ThanksI want to create an application using simulink dashboards wich are put in panel.
is there any documentation on parameters that i can set using set_param on this panel?
Thanks I want to create an application using simulink dashboards wich are put in panel.
is there any documentation on parameters that i can set using set_param on this panel?
Thanks dashboard simulink panel MATLAB Answers — New Questions
Actionable Message in Outlook Action.Http not working Workaround
Hello everyone,
we had used Actionable Messages (some call them Adaptive Cards) since two years ago.
In August this year (2024) our “Action.Http” stopped working.
If this sounds familiar, keep reading on.
I tried the Microsoft Support, but they could not figure what was the Problem.
After a lot of digging we found hints of the problem and a workaround.
We were sending actionable messages from our mail-server to an office365 mailbox and had a action.Http request back to our server.
What happened was, that no response was send back after august.
Our workaround uses Microsoft Power Automate to relay our request, because something on Microsoft’s Cloud Service stopped processing the requests in the actionable messages.
What you need is a Power Automate Premium License (around 14$ per Month) to use the Http Requests inside of Power Automate.
Here is, how it Worked for us.
1.) (Optional) create a service account that holds the Power Automate flows.
This step is optional, but it would be good to use an account that is not used by a employee.
Because if he quits and the Account is removed, you also lose the Power Automate flow.
2.) Create the Http relay flow
Go to https://make.powerautomate.com and login with the account that you want to use for the flow.
This account needs the Power Automate Premium License.
There are two ways to assign the license. When you try to save a flow that requires a license you get a error stating and an option to assign a license or you can assign a license before to the user, so that he can use the Power Automate flow.
Keep in mind, that you need at minimum a Power Automate free license to even see Power Automate in your “Apps” in the Browser if you log in to your account.
Here is an overview of the Power Automate flow.
The first step is a trigger “When an HTTP request is received”.
You can ether create it as an “Instant cloud flow” of an “automated cloud flow”. If you chose a “automated cloud flow” you have to use the “skip” button, because the http request trigger is not listed initially. You can add id afterwards, see the picture below.
Inside the trigger we will need to specify a JSON schema.
It is important to set “Who can Trigger The Flow” to “Anyone”
We found that one of the reasons that the “action.Http” is not working in outlook is that the api point or whatever it is, that normally relays the POST request inside an actionable message appears to be closed.
And Power Automate is the same if you do not set the Flow to “Anyone”. This was the “default” value before there update where they introduced the restriction options “Any user in my tenant” and “Specific user in my tenant”.
To bedder understand how it works let’s take a example.
In your actionable message, you want to send a POST request to your server “https://my-companyserver.com:5432/requests/” and the Request has a body of parameters that you want to send as an JSON
{
“Subject”: “Repair of Car”,
“Price”: “1234.00$”,
“Ticketnumber”: 123456
}
For the relay to work we have to send the original URL (https://my-companyserver.com:5432/requests/) and payload to our relay flow. For this example the POST request Body of the request that our flow receives would look like this.
{
“url”:”https://my-companyserver.com:5432/requests/“,
“ad_body”:{
“Subject”: “Repair of Car”,
“Price”: “1234.00$”,
“Ticketnumber”: 123456
}
}
With the body from the request, we can create a new request inside the flow and and send the response from that flow back to our actionable message to update the card or do whatever you want.
2.) Ad a “Compose” object
To use the body of the request as a variable in further steps we have to pass i throw a Data Operation Compose to “extract” it. There we chose ad_body to get the “original” body of the Action.Http from the actionable message.
3.) Add HTTP
Now we add our own request, that we build out of the “url” and “ad_body” and send them to our server. We add a “HTTP” Action ad define it. See pictures below.
We define the URL from the URL that we got from our Request and the Body from our Compose Step that “extracted” the ad_body from the request body.
DO not forget to add “ContentType” and “application/json“
It is a new request and we have to define the header. If you have more definitions that you need for your application to work, you configure them here. For us, we only need this one because all we do is send a JSON.
4.) Add response
in the last step we send the response from our own “HTTP” request to the actionable message.
To do this we add a “Response” to the flow.
Here we define, that the response will update the actionable message.
We send a status Code 200 and with the header “CARD-UPDATE-IN-BODY” is “true” the actionable message will be updated.
The “body” inside the “Response” is the updated actionable message that was generated on our server and send back as the body.
If you wand a minimal example of an working actionable message, here is the version i found.
{
“type”: “AdaptiveCard”,
“version”: “1.0”,
“originator”: “ff6b6746-a5f5-48d7-a363-95eb0504ffad”,
“body”: [
{
“type”: “TextBlock”,
“text”: “Hello world!”
}
],
“actions”: [
{
“type”: “Action.Http”,
“title”: “Click me!”,
“method”: “POST”,
“url”: “https://link-to-my-power-automate-flow“,
“body”: “{“Subject”:”Repair of Car”,”Price”:”1234.00$”,”Ticketnumber”:123456}”,
“headers”: [
{ “name”: “Content-Type”, “value”: “application/json” },
{ “name”: “Authorization”, “value”: “”}
]
}
]
}
If you get the error 401 inside Outlook when you click the actionable message you need to add
“headers”: [
{ “name”: “Content-Type”, “value”: “application/json” },
{ “name”: “Authorization”, “value”: “”}
]
The Power Automate Flow expects a token that is generated automatically by outlook, but we have to set the header manually because else outlook will mess it up and the POST request will have the wrong header and you will get a 401 error in response.
5.) Get Originator ID
Go to https://outlook.office.com/connectors/oam/publish/
If you can not open the URL or it can not be loaded, first go to https://outlook.office.com and then open a new tab in your Browser an go to the Link.One of the many Bugs we found on the way was that the side now uses a token created when you log into Outlook.office.com. If the Browser does not have this token you can no longer open the site directly.
Here you can create a connector for your Adaptive Cards.
When crating one you specify the email address of the sender, and the “Target URL”.
The “Target URL” is the URL form our Power Automate Flow that we crated, because we use the URL as an entry point for relaying.
And that is how our workaround was configured.
If you have questions fell free to leave a commend.
Hello everyone,we had used Actionable Messages (some call them Adaptive Cards) since two years ago.In August this year (2024) our “Action.Http” stopped working.If this sounds familiar, keep reading on.I tried the Microsoft Support, but they could not figure what was the Problem. After a lot of digging we found hints of the problem and a workaround.We were sending actionable messages from our mail-server to an office365 mailbox and had a action.Http request back to our server.What happened was, that no response was send back after august. Our workaround uses Microsoft Power Automate to relay our request, because something on Microsoft’s Cloud Service stopped processing the requests in the actionable messages.What you need is a Power Automate Premium License (around 14$ per Month) to use the Http Requests inside of Power Automate.Here is, how it Worked for us.1.) (Optional) create a service account that holds the Power Automate flows.This step is optional, but it would be good to use an account that is not used by a employee.Because if he quits and the Account is removed, you also lose the Power Automate flow. 2.) Create the Http relay flowGo to https://make.powerautomate.com and login with the account that you want to use for the flow.This account needs the Power Automate Premium License.There are two ways to assign the license. When you try to save a flow that requires a license you get a error stating and an option to assign a license or you can assign a license before to the user, so that he can use the Power Automate flow.Keep in mind, that you need at minimum a Power Automate free license to even see Power Automate in your “Apps” in the Browser if you log in to your account.Here is an overview of the Power Automate flow.The first step is a trigger “When an HTTP request is received”.You can ether create it as an “Instant cloud flow” of an “automated cloud flow”. If you chose a “automated cloud flow” you have to use the “skip” button, because the http request trigger is not listed initially. You can add id afterwards, see the picture below.Inside the trigger we will need to specify a JSON schema.It is important to set “Who can Trigger The Flow” to “Anyone”We found that one of the reasons that the “action.Http” is not working in outlook is that the api point or whatever it is, that normally relays the POST request inside an actionable message appears to be closed.And Power Automate is the same if you do not set the Flow to “Anyone”. This was the “default” value before there update where they introduced the restriction options “Any user in my tenant” and “Specific user in my tenant”.To bedder understand how it works let’s take a example.In your actionable message, you want to send a POST request to your server “https://my-companyserver.com:5432/requests/” and the Request has a body of parameters that you want to send as an JSON{ “Subject”: “Repair of Car”, “Price”: “1234.00$”, “Ticketnumber”: 123456}For the relay to work we have to send the original URL (https://my-companyserver.com:5432/requests/) and payload to our relay flow. For this example the POST request Body of the request that our flow receives would look like this.{ “url”:”https://my-companyserver.com:5432/requests/”, “ad_body”:{ “Subject”: “Repair of Car”, “Price”: “1234.00$”, “Ticketnumber”: 123456 }}With the body from the request, we can create a new request inside the flow and and send the response from that flow back to our actionable message to update the card or do whatever you want. 2.) Ad a “Compose” objectTo use the body of the request as a variable in further steps we have to pass i throw a Data Operation Compose to “extract” it. There we chose ad_body to get the “original” body of the Action.Http from the actionable message. 3.) Add HTTPNow we add our own request, that we build out of the “url” and “ad_body” and send them to our server. We add a “HTTP” Action ad define it. See pictures below.We define the URL from the URL that we got from our Request and the Body from our Compose Step that “extracted” the ad_body from the request body.DO not forget to add “ContentType” and “application/json”It is a new request and we have to define the header. If you have more definitions that you need for your application to work, you configure them here. For us, we only need this one because all we do is send a JSON.4.) Add responsein the last step we send the response from our own “HTTP” request to the actionable message.To do this we add a “Response” to the flow.Here we define, that the response will update the actionable message.We send a status Code 200 and with the header “CARD-UPDATE-IN-BODY” is “true” the actionable message will be updated.The “body” inside the “Response” is the updated actionable message that was generated on our server and send back as the body.If you wand a minimal example of an working actionable message, here is the version i found.{ “type”: “AdaptiveCard”, “version”: “1.0”, “originator”: “ff6b6746-a5f5-48d7-a363-95eb0504ffad”, “body”: [ { “type”: “TextBlock”, “text”: “Hello world!” } ], “actions”: [ { “type”: “Action.Http”, “title”: “Click me!”, “method”: “POST”, “url”: “https://link-to-my-power-automate-flow”, “body”: “{“Subject”:”Repair of Car”,”Price”:”1234.00$”,”Ticketnumber”:123456}”, “headers”: [ { “name”: “Content-Type”, “value”: “application/json” }, { “name”: “Authorization”, “value”: “”} ] } ]}If you get the error 401 inside Outlook when you click the actionable message you need to add”headers”: [ { “name”: “Content-Type”, “value”: “application/json” }, { “name”: “Authorization”, “value”: “”}]The Power Automate Flow expects a token that is generated automatically by outlook, but we have to set the header manually because else outlook will mess it up and the POST request will have the wrong header and you will get a 401 error in response.5.) Get Originator IDGo to https://outlook.office.com/connectors/oam/publish/If you can not open the URL or it can not be loaded, first go to https://outlook.office.com and then open a new tab in your Browser an go to the Link.One of the many Bugs we found on the way was that the side now uses a token created when you log into Outlook.office.com. If the Browser does not have this token you can no longer open the site directly.Here you can create a connector for your Adaptive Cards.When crating one you specify the email address of the sender, and the “Target URL”.The “Target URL” is the URL form our Power Automate Flow that we crated, because we use the URL as an entry point for relaying.And that is how our workaround was configured.If you have questions fell free to leave a commend. Read More