Month: June 2024
“For loop” to plot graphs of functions
I’m trying to write a matlab (for loop) code to produce the graphs:
Q as a function of A,
F as a function of A,
Z as a function of A
from the known functions f1, f2 and f3
Z = f1 (A, F, Q)
F = f2 (A, Q, Z)
A = f3 (Z, Q).
I made several attempts that were unsuccessful, if anyone can help me I would thank you a lot.I’m trying to write a matlab (for loop) code to produce the graphs:
Q as a function of A,
F as a function of A,
Z as a function of A
from the known functions f1, f2 and f3
Z = f1 (A, F, Q)
F = f2 (A, Q, Z)
A = f3 (Z, Q).
I made several attempts that were unsuccessful, if anyone can help me I would thank you a lot. I’m trying to write a matlab (for loop) code to produce the graphs:
Q as a function of A,
F as a function of A,
Z as a function of A
from the known functions f1, f2 and f3
Z = f1 (A, F, Q)
F = f2 (A, Q, Z)
A = f3 (Z, Q).
I made several attempts that were unsuccessful, if anyone can help me I would thank you a lot. for loop MATLAB Answers — New Questions
Unable to create a STM32CubeMX Project using “Embedded Coder Support Package for STMicroelectronics STM32 Processors”
Hello Comunity,
I am trying to create new project for STM32F4xx based boards. But I can not create the create project biuld options in Simulink Hardware implementation. I have attached the screenshot of the error. I have followed the step shown in the msg and tried to do hardware setup. I have already installed required STM32 CubeMX(v6.4.0) and STM32CubeProgrammer(v2.6.0) as recommended by the simulink hardware support package andthe installation paths are also validated. I was able to complete the setup but still it pops up.Hello Comunity,
I am trying to create new project for STM32F4xx based boards. But I can not create the create project biuld options in Simulink Hardware implementation. I have attached the screenshot of the error. I have followed the step shown in the msg and tried to do hardware setup. I have already installed required STM32 CubeMX(v6.4.0) and STM32CubeProgrammer(v2.6.0) as recommended by the simulink hardware support package andthe installation paths are also validated. I was able to complete the setup but still it pops up. Hello Comunity,
I am trying to create new project for STM32F4xx based boards. But I can not create the create project biuld options in Simulink Hardware implementation. I have attached the screenshot of the error. I have followed the step shown in the msg and tried to do hardware setup. I have already installed required STM32 CubeMX(v6.4.0) and STM32CubeProgrammer(v2.6.0) as recommended by the simulink hardware support package andthe installation paths are also validated. I was able to complete the setup but still it pops up. embedded coder support package, stmicroelectronics, stm32f4xx based board, simulink, model configuration MATLAB Answers — New Questions
AKS Networking || Bring your own CNI plugin (BYOC)
Bring your own Container Network Interface (BYOCNI) plugin with Azure Kubernetes Service (AKS)
What is BYOCNI?
BYOCNI stands for Bring Your Own Container Network Interface. It allows advanced AKS users to deploy an AKS cluster with no CNI plugin preinstalled. Instead, you can install any third-party CNI plugin that works in Azure. This flexibility enables you to use the same CNI plugin used in on-premises Kubernetes environments or leverage advanced functionalities available in other CNI plugins.
Before diving into BYOCNI, ensure the following prerequisites are met:
– Use at least template version 2022-01-02-preview or 2022-06-01 for Azure Resource Manager (ARM) or Bicep.
– Have Azure CLI version 2.39.0 or later.
– The virtual network for the AKS cluster must allow outbound internet connectivity.
– Avoid using specific address ranges (e.g., 169.254.0.0/16, 172.30.0.0/16, 172.31.0.0/16, or 192.0.2.0/24) for Kubernetes service, pod address range, or cluster virtual network address range.
– The Identity used by the AKS cluster need to have least Network Contributor permissions on the subnet within your virtual network. Or you can use the custom role which has “Microsoft.Network/virtualNetworks/subnets/join/action and Microsoft.Network/virtualNetworks/subnets/read” permission.
– Subnet cannot be a delegated subnet used by AKS node pool.
– AKS doesn’t apply NSGs to its subnet or modify any of the NSGs associated with that subnet. If you add custom NSGs to the subnet, ensure the security rules allow traffic within the node CIDR range.
Deploy AKS cluster with no CNI plugin preinstalled:
You can deploy the AKS cluster with different Infrastructure as code (IAC) and CLI. We just need to pass network-plugin with the value as none. Refer the below snapping for the same.
1. Azure CLI:
2. Terraform:
3. ARM template:
4. Bicep:
Upon a successfully deployment you can see the AKS cluster is online, but all the nodes are not ready, you can check and verify the same on the azure poral as well as by running the kubectl commands as shown below,
Azure portal:
kubectl:
We can clearly see the reason:NetworkPluginNotReady in the blow snapping.
Now to make the nodes ready we need to install the network plugin. To do so you can leverage BYOCNI plugin third-party vendor such as Cilium, Flannel and Weave. Apart from these three there are so many other 3rd party plugins as well. You can run the below command to install the network plugin. In my Case I have used Flannel.
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
After applying the above kubectl commands the nods are now in ready state as you can see below,
Portal:
Using kubectl:
Note:
Remember that Microsoft support cannot assist with CNI-related issues in clusters deployed with BYOCNI. For CNI-related support, consider using a supported AKS network plugin or seek support from the third-party vendor of your chosen CNI plugin. Support is still provided for non-CNI-related issues.
BYOCNI empowers you to tailor your AKS networking to your specific requirements.
Microsoft Tech Community – Latest Blogs –Read More
Problem with validation of the covariance matrix P in the steady state continuous Kalman filter
Hi I am trying to verify on simulations that the covariance matrix of the estimation errror is equal to the matrix P provided by the Riccati Solution of a continuous kalman filter. However when I use lsim to simulate and get the covariance of the estimator error vectors the results are different from P. But if I do P*Ts I can see the equivalence.
Why this factor Ts is appearing?
I am using the following code:
clear
close all
clc
% System
A = [-10 -20;35 -50];
B = [1; 1;];
C = [1 0];
D = 0;
Fs = 50000; % Frequency
Ts = 1/Fs; %
t = 0:Ts:10;
L = length(t);
W = [20 0;0 10];
V = 1;
rng(10,’twister’);
w = chol(W, ‘lower’)*randn(2,L);
v = chol(V, ‘lower’)*randn(1,L);
mw = mean(w,2);
mv = mean(v);
v = v – mean(v)*ones(1,length(v));
w = w – mw.*ones(2,length(v));
cov_w = cov(w’);
cov_v = cov(v);
[Lk,P] = lqe(A,eye(2),C,W,V);
% Augmented system with plant and Kalman filter
Aak = [A zeros(2,2); Lk*C A-Lk*C];
Bak = [B eye(2) zeros(2,1); B zeros(2,2) Lk];
sys_obs_mak = ss(Aak,Bak,eye(4),0);
u(1,:) = 1*heaviside(t);
[yk,t,xk] = lsim(sys_obs_mak,[u’ w’ v’],t,[0 0 0 0]); % Simulation
erro = xk(:,1:2)-xk(:,3:4);
cov_erro_lsim = cov(erro)
PTs = P*Ts
PHi I am trying to verify on simulations that the covariance matrix of the estimation errror is equal to the matrix P provided by the Riccati Solution of a continuous kalman filter. However when I use lsim to simulate and get the covariance of the estimator error vectors the results are different from P. But if I do P*Ts I can see the equivalence.
Why this factor Ts is appearing?
I am using the following code:
clear
close all
clc
% System
A = [-10 -20;35 -50];
B = [1; 1;];
C = [1 0];
D = 0;
Fs = 50000; % Frequency
Ts = 1/Fs; %
t = 0:Ts:10;
L = length(t);
W = [20 0;0 10];
V = 1;
rng(10,’twister’);
w = chol(W, ‘lower’)*randn(2,L);
v = chol(V, ‘lower’)*randn(1,L);
mw = mean(w,2);
mv = mean(v);
v = v – mean(v)*ones(1,length(v));
w = w – mw.*ones(2,length(v));
cov_w = cov(w’);
cov_v = cov(v);
[Lk,P] = lqe(A,eye(2),C,W,V);
% Augmented system with plant and Kalman filter
Aak = [A zeros(2,2); Lk*C A-Lk*C];
Bak = [B eye(2) zeros(2,1); B zeros(2,2) Lk];
sys_obs_mak = ss(Aak,Bak,eye(4),0);
u(1,:) = 1*heaviside(t);
[yk,t,xk] = lsim(sys_obs_mak,[u’ w’ v’],t,[0 0 0 0]); % Simulation
erro = xk(:,1:2)-xk(:,3:4);
cov_erro_lsim = cov(erro)
PTs = P*Ts
P Hi I am trying to verify on simulations that the covariance matrix of the estimation errror is equal to the matrix P provided by the Riccati Solution of a continuous kalman filter. However when I use lsim to simulate and get the covariance of the estimator error vectors the results are different from P. But if I do P*Ts I can see the equivalence.
Why this factor Ts is appearing?
I am using the following code:
clear
close all
clc
% System
A = [-10 -20;35 -50];
B = [1; 1;];
C = [1 0];
D = 0;
Fs = 50000; % Frequency
Ts = 1/Fs; %
t = 0:Ts:10;
L = length(t);
W = [20 0;0 10];
V = 1;
rng(10,’twister’);
w = chol(W, ‘lower’)*randn(2,L);
v = chol(V, ‘lower’)*randn(1,L);
mw = mean(w,2);
mv = mean(v);
v = v – mean(v)*ones(1,length(v));
w = w – mw.*ones(2,length(v));
cov_w = cov(w’);
cov_v = cov(v);
[Lk,P] = lqe(A,eye(2),C,W,V);
% Augmented system with plant and Kalman filter
Aak = [A zeros(2,2); Lk*C A-Lk*C];
Bak = [B eye(2) zeros(2,1); B zeros(2,2) Lk];
sys_obs_mak = ss(Aak,Bak,eye(4),0);
u(1,:) = 1*heaviside(t);
[yk,t,xk] = lsim(sys_obs_mak,[u’ w’ v’],t,[0 0 0 0]); % Simulation
erro = xk(:,1:2)-xk(:,3:4);
cov_erro_lsim = cov(erro)
PTs = P*Ts
P kalman filter MATLAB Answers — New Questions
How do I remove outliers in data so that vectors are of the same length for plotting?
Please see the attached excel file.
X = First column data
Y = Second column data
I have to ensure that both the vectors are of the same length for plotting and curve-fitting purpose. How do I get rid of the outliers in the Y-values such that the corresponding X-values are also lost?Please see the attached excel file.
X = First column data
Y = Second column data
I have to ensure that both the vectors are of the same length for plotting and curve-fitting purpose. How do I get rid of the outliers in the Y-values such that the corresponding X-values are also lost? Please see the attached excel file.
X = First column data
Y = Second column data
I have to ensure that both the vectors are of the same length for plotting and curve-fitting purpose. How do I get rid of the outliers in the Y-values such that the corresponding X-values are also lost? data import, plotting, signal processing, curve fitting MATLAB Answers — New Questions
Verify if my app has active connectivity with my databases?
Hi my apps are working but for example must display messages with the ticket fail and it doesn’t.
I’m attaching a picture when it worked well and a photo of what it does now.
How do I do to see that my app has everything it needs for its correct functioning?, Taking into account that it was working fine until before a Windows update that my server made, my database is SQL Server.
Hi my apps are working but for example must display messages with the ticket fail and it doesn’t.I’m attaching a picture when it worked well and a photo of what it does now.How do I do to see that my app has everything it needs for its correct functioning?, Taking into account that it was working fine until before a Windows update that my server made, my database is SQL Server. Read More
Azure Container Apps Newsletter – June 2024
Welcome to this month’s Azure Container Apps newsletter! We’ll share the latest news and community highlights for Container Apps every month here on the Apps on Azure blog.
Azure Container Apps monthly community live stream
Our next live stream is June 12, 2024 at 11:00AM PDT (18:00 UTC). Join us and our special guests to learn all about running untrusted code in sandboxes with dynamic sessions on Azure Container Apps.
Subscribe to the Azure Developers YouTube channel!
Community highlights
Some great content created by our amazing community:
Blogs
What Azure Container Apps Is Not: Clearing the Confusion
Azure Container Apps – Overview
Deploy 1Password SCIM Bridge on Azure Container Apps
Simplifying .NET microservices with Dapr and Azure Container Apps
Running a Playwright scheduled job with Azure Container Apps
Videos
Build Intelligent Apps with Serverless Containers on Azure Container Apps
From Day Zero To Production with Azure Container Apps
Goodbye Azure Kubernetes Service! Hello Azure Container Apps! – Johnny Hooyberghs
Azure Container Apps Docker Containers first deployment with Azure Front Door
Azure Container Apps uncovered: Scenarios, workloads, and portability
How to configure HTTP ingress in Azure Container Apps (playlist)
Working with Workload Profiles in Azure Container Apps
Build a multi-LLM chat application with Azure Container Apps
Azure Container Apps dynamic sessions
New: Secure Sandboxes at Scale with Azure Container Apps Dynamic Sessions
Bridging the chasm between your ML and app devs (Semantic Kernel)
Secure code execution in LlamaIndex with Azure Container Apps dynamic sessions
Integrating LangChain with Azure Container Apps dynamic sessions
Using Azure Container Apps dynamic sessions from Java
Read about all our Microsoft Build 2024 announcements!
For more, check out our product roadmap.
Get notified when we publish future newsletters, subscribe to the Apps on Azure blog. Connect with the Azure Container Apps team on GitHub, Twitter, and Discord.
Microsoft Tech Community – Latest Blogs –Read More
Is there any feasible method to automated labelling images for a deep learning task, which I have a lot of images to label which is not practically feasible to do manually
I am doing a medical imaging project with MRI images. I hope to develop a deep learning model for this task. But the data I collected is not labelled and I have to label them for each category. Can someone suggest me a method to automate this labelling process where it will be greatly save my time. Thanks in advance. !I am doing a medical imaging project with MRI images. I hope to develop a deep learning model for this task. But the data I collected is not labelled and I have to label them for each category. Can someone suggest me a method to automate this labelling process where it will be greatly save my time. Thanks in advance. ! I am doing a medical imaging project with MRI images. I hope to develop a deep learning model for this task. But the data I collected is not labelled and I have to label them for each category. Can someone suggest me a method to automate this labelling process where it will be greatly save my time. Thanks in advance. ! deep learning, image analysis, image processing, image labelling MATLAB Answers — New Questions
KQL Query email attachments
let domainList = externaldata(domain: string) [@”https://raw.githubusercontent.com/tsirolnik/spam-domains-list/master/spamdomains.txt“] with (format=”txt”);
let excludedDomains = datatable(excludeddomain :string) // Add as many domains you would like to exclude
[“126.com”,”163.com”,”dell.com”,”trustwave.com”,”microsoft.com”,”qq.com”,”accenture.com”,”hp.com”,”google.com”,”amazon.com”];
let Timeframe = 2d; // Choose the best timeframe for your investigation
let SuspiciousEmails = EmailEvents
| where Timestamp > ago(Timeframe)
| where EmailDirection == “Outbound” // Assuming you are looking into mails sent by your organization
| extend EmailDomain = tostring(split(RecipientEmailAddress, ‘@’)[1])
| join kind=inner (domainList) on $left.EmailDomain == $right.domain
| where not(EmailDomain in ([‘excludedDomains’]))
| project Timestamp, NetworkMessageId, SenderMailFromAddress, SenderFromAddress, SenderDisplayName, RecipientEmailAddress, EmailDomain, domain, Subject, LatestDeliveryAction;
SuspiciousEmails
| join (EmailEvents
| summarize count() by NetworkMessageId
| where count_ == 1
| project NetworkMessageId
)on NetworkMessageId
| sort by Timestamp desc
How can i show EmailAttachmentInfo, to show the FileName or Attachment that was being sent ?
let domainList = externaldata(domain: string) [@”https://raw.githubusercontent.com/tsirolnik/spam-domains-list/master/spamdomains.txt”] with (format=”txt”);let excludedDomains = datatable(excludeddomain :string) // Add as many domains you would like to exclude[“126.com”,”163.com”,”dell.com”,”trustwave.com”,”microsoft.com”,”qq.com”,”accenture.com”,”hp.com”,”google.com”,”amazon.com”];let Timeframe = 2d; // Choose the best timeframe for your investigationlet SuspiciousEmails = EmailEvents| where Timestamp > ago(Timeframe)| where EmailDirection == “Outbound” // Assuming you are looking into mails sent by your organization| extend EmailDomain = tostring(split(RecipientEmailAddress, ‘@’)[1])| join kind=inner (domainList) on $left.EmailDomain == $right.domain| where not(EmailDomain in ([‘excludedDomains’]))| project Timestamp, NetworkMessageId, SenderMailFromAddress, SenderFromAddress, SenderDisplayName, RecipientEmailAddress, EmailDomain, domain, Subject, LatestDeliveryAction;SuspiciousEmails| join (EmailEvents| summarize count() by NetworkMessageId| where count_ == 1| project NetworkMessageId)on NetworkMessageId| sort by Timestamp desc How can i show EmailAttachmentInfo, to show the FileName or Attachment that was being sent ? Read More
SAML causes significant process issues for IT
Hi,
Firstly I apologize if I’ve posted in the wrong section, I’m very new to the Microsoft forums/hubs? found navigating it very confusing for this particular subject anyway. Full disclosure, I’m not a specialist in the networking, server, authentication related fields, nor Active Directory/Azure for that matter.
I’m trying to identify a way to alleviate some process issues caused by SAML when authenticating users for key web-apps we use, two in particular, I’m not sure I’m at liberty to state what they are so I won’t for security reasons, but I can explain the current workflow.
System 1 Onboarding Workflow
1. In order to onboard a user for System1 you must…
Add them to the applicable AD groupSend an email to the user to request they loginOnce the user has logged in and provided they told us…We can assign permissions, reporting lines etc in System1
System 2 Onboarding Workflow
2. In order to onboard a user for System2 you must…
Add them to the applicable AD groupSend an email to the user to request they login Once the user has logged in and provided they told us…They would come back with an error message that means the admins of the system can now assign permissions/accessAdmins can then respond back to the user again to state they will now be able to login successfully
From my limited perspective and understanding, SAML waits for a user to attempt a login before anything happens, from an onboarding process perspective this is very time consuming and ineffective, especially considering the reliance on replies and huge number of onboarding requests we receive on a daily basis.
Thinking out loud to remove this problem, when a user is added to the AD group for that web-app, a process runs based on a detected change in users/groups and pushes that to the web-apps so no manual user login attempts are required, is it possible to do anything like this? or can you provide different solutions to this while still using SAML?
I should note that it is an absolute requirement users have access to these systems as soon as the day they join.
Fundamentally, the question I am asking is…
User registration in web-apps seems to require an SSO attempt by the user before that user appears in the web-apps user directory, is it possible to automate the web-app user registration so the manual user SSO attempt isn’t required?
Hi, Firstly I apologize if I’ve posted in the wrong section, I’m very new to the Microsoft forums/hubs? found navigating it very confusing for this particular subject anyway. Full disclosure, I’m not a specialist in the networking, server, authentication related fields, nor Active Directory/Azure for that matter. I’m trying to identify a way to alleviate some process issues caused by SAML when authenticating users for key web-apps we use, two in particular, I’m not sure I’m at liberty to state what they are so I won’t for security reasons, but I can explain the current workflow. System 1 Onboarding Workflow1. In order to onboard a user for System1 you must…Add them to the applicable AD groupSend an email to the user to request they loginOnce the user has logged in and provided they told us…We can assign permissions, reporting lines etc in System1 System 2 Onboarding Workflow2. In order to onboard a user for System2 you must…Add them to the applicable AD groupSend an email to the user to request they login Once the user has logged in and provided they told us…They would come back with an error message that means the admins of the system can now assign permissions/accessAdmins can then respond back to the user again to state they will now be able to login successfullyFrom my limited perspective and understanding, SAML waits for a user to attempt a login before anything happens, from an onboarding process perspective this is very time consuming and ineffective, especially considering the reliance on replies and huge number of onboarding requests we receive on a daily basis. Thinking out loud to remove this problem, when a user is added to the AD group for that web-app, a process runs based on a detected change in users/groups and pushes that to the web-apps so no manual user login attempts are required, is it possible to do anything like this? or can you provide different solutions to this while still using SAML? I should note that it is an absolute requirement users have access to these systems as soon as the day they join. Fundamentally, the question I am asking is…User registration in web-apps seems to require an SSO attempt by the user before that user appears in the web-apps user directory, is it possible to automate the web-app user registration so the manual user SSO attempt isn’t required? Read More
Embed existing app in teams tabs
I have an existing web app and I’d like to deploy a teams tab to the MS app store that simply embeds my app. I’m wondering if there is a way to avoid building an entirely separate app. I’d like to just add a manifest file to my existing repo and feed that to the teams client. Would this be possible?
I have an existing web app and I’d like to deploy a teams tab to the MS app store that simply embeds my app. I’m wondering if there is a way to avoid building an entirely separate app. I’d like to just add a manifest file to my existing repo and feed that to the teams client. Would this be possible? Read More
In the PDE toolbox, can I set my Dirichlet boundary condition to a single point rather than the edge?
In the PDEtoolbox, can I set my Dirichlet boundary condition to a single point rather than the edge?
We use the following code (a really small circle) to approximate the Dirichlet boundary condition for a single point (u=220 when x=0 and y=0). I would like to know if there is a method to directly define boundary conditions on a Point instead of an Edge.
Circle = [1,0,0,0.001]’;
applyBoundaryCondition(GWModel,’dirichlet’,’Edge’,[5,6,7,8],’u’,220);
%Create FE analysis object
GWModel = createpde();
%Create 2-D geometry
%R = [3,4,200,200,-200,-200,100,-100,-100,100]’;
R = [2,4,200,200,-200,-200,100,-100,-100,100]’;
Circle = [1,0,0,0.001]’;
Circle = [Circle;zeros(length(R) – length(Circle),1)];
gd = [R,Circle];
ns = char(‘RectangularDomain’,’Well’); ns = ns’;
sf = ‘RectangularDomain-Well’;
[g,bt] = decsg(gd,sf,ns);
geometryFromEdges(GWModel,g);
figure(1);pdegplot(GWModel,’EdgeLabels’,’on’);xlim([-250,250]), ylim([-150,150]);axis equal
specifyCoefficients(GWModel, ‘m’,0,’d’,0,’c’,1,’a’,0,’f’,0);
%Assume Boundary conditions
applyBoundaryCondition(GWModel,’dirichlet’,’Edge’,[5,6,7,8],’u’,220);
applyBoundaryCondition(GWModel,’dirichlet’,’Edge’,[1,2,3,4], ‘u’,200);
%applyBoundaryCondition(GWModel,’neumann’, ‘Edge’,[1,4], ‘q’,0,’g’,0);
%Create a mesh, max size
hmax = 1.25;
generateMesh(GWModel,’Hmax’,hmax);
GWModel.Mesh
figure(2);pdemesh(GWModel);xlim([-250,250]), ylim([-150,150]);axis equal;
%Solve PDE
results = solvepde(GWModel);
u = results.NodalSolution;
%Compute the flux of the solution and plot the results.
[cgradx,cgrady] = evaluateCGradient(results);
fluxx = -cgradx;
fluxy = -cgrady;
%Plot solution
figure(3)
pdeplot(GWModel,’XYData’,u,’Contour’,’on’,’FlowData’,[fluxx,fluxy])
axis equal
title(‘Numerical Solution’);xlabel(‘x’);ylabel(‘y’)
xlim([-200,200]), ylim([-100,100])In the PDEtoolbox, can I set my Dirichlet boundary condition to a single point rather than the edge?
We use the following code (a really small circle) to approximate the Dirichlet boundary condition for a single point (u=220 when x=0 and y=0). I would like to know if there is a method to directly define boundary conditions on a Point instead of an Edge.
Circle = [1,0,0,0.001]’;
applyBoundaryCondition(GWModel,’dirichlet’,’Edge’,[5,6,7,8],’u’,220);
%Create FE analysis object
GWModel = createpde();
%Create 2-D geometry
%R = [3,4,200,200,-200,-200,100,-100,-100,100]’;
R = [2,4,200,200,-200,-200,100,-100,-100,100]’;
Circle = [1,0,0,0.001]’;
Circle = [Circle;zeros(length(R) – length(Circle),1)];
gd = [R,Circle];
ns = char(‘RectangularDomain’,’Well’); ns = ns’;
sf = ‘RectangularDomain-Well’;
[g,bt] = decsg(gd,sf,ns);
geometryFromEdges(GWModel,g);
figure(1);pdegplot(GWModel,’EdgeLabels’,’on’);xlim([-250,250]), ylim([-150,150]);axis equal
specifyCoefficients(GWModel, ‘m’,0,’d’,0,’c’,1,’a’,0,’f’,0);
%Assume Boundary conditions
applyBoundaryCondition(GWModel,’dirichlet’,’Edge’,[5,6,7,8],’u’,220);
applyBoundaryCondition(GWModel,’dirichlet’,’Edge’,[1,2,3,4], ‘u’,200);
%applyBoundaryCondition(GWModel,’neumann’, ‘Edge’,[1,4], ‘q’,0,’g’,0);
%Create a mesh, max size
hmax = 1.25;
generateMesh(GWModel,’Hmax’,hmax);
GWModel.Mesh
figure(2);pdemesh(GWModel);xlim([-250,250]), ylim([-150,150]);axis equal;
%Solve PDE
results = solvepde(GWModel);
u = results.NodalSolution;
%Compute the flux of the solution and plot the results.
[cgradx,cgrady] = evaluateCGradient(results);
fluxx = -cgradx;
fluxy = -cgrady;
%Plot solution
figure(3)
pdeplot(GWModel,’XYData’,u,’Contour’,’on’,’FlowData’,[fluxx,fluxy])
axis equal
title(‘Numerical Solution’);xlabel(‘x’);ylabel(‘y’)
xlim([-200,200]), ylim([-100,100]) In the PDEtoolbox, can I set my Dirichlet boundary condition to a single point rather than the edge?
We use the following code (a really small circle) to approximate the Dirichlet boundary condition for a single point (u=220 when x=0 and y=0). I would like to know if there is a method to directly define boundary conditions on a Point instead of an Edge.
Circle = [1,0,0,0.001]’;
applyBoundaryCondition(GWModel,’dirichlet’,’Edge’,[5,6,7,8],’u’,220);
%Create FE analysis object
GWModel = createpde();
%Create 2-D geometry
%R = [3,4,200,200,-200,-200,100,-100,-100,100]’;
R = [2,4,200,200,-200,-200,100,-100,-100,100]’;
Circle = [1,0,0,0.001]’;
Circle = [Circle;zeros(length(R) – length(Circle),1)];
gd = [R,Circle];
ns = char(‘RectangularDomain’,’Well’); ns = ns’;
sf = ‘RectangularDomain-Well’;
[g,bt] = decsg(gd,sf,ns);
geometryFromEdges(GWModel,g);
figure(1);pdegplot(GWModel,’EdgeLabels’,’on’);xlim([-250,250]), ylim([-150,150]);axis equal
specifyCoefficients(GWModel, ‘m’,0,’d’,0,’c’,1,’a’,0,’f’,0);
%Assume Boundary conditions
applyBoundaryCondition(GWModel,’dirichlet’,’Edge’,[5,6,7,8],’u’,220);
applyBoundaryCondition(GWModel,’dirichlet’,’Edge’,[1,2,3,4], ‘u’,200);
%applyBoundaryCondition(GWModel,’neumann’, ‘Edge’,[1,4], ‘q’,0,’g’,0);
%Create a mesh, max size
hmax = 1.25;
generateMesh(GWModel,’Hmax’,hmax);
GWModel.Mesh
figure(2);pdemesh(GWModel);xlim([-250,250]), ylim([-150,150]);axis equal;
%Solve PDE
results = solvepde(GWModel);
u = results.NodalSolution;
%Compute the flux of the solution and plot the results.
[cgradx,cgrady] = evaluateCGradient(results);
fluxx = -cgradx;
fluxy = -cgrady;
%Plot solution
figure(3)
pdeplot(GWModel,’XYData’,u,’Contour’,’on’,’FlowData’,[fluxx,fluxy])
axis equal
title(‘Numerical Solution’);xlabel(‘x’);ylabel(‘y’)
xlim([-200,200]), ylim([-100,100]) pde, dirichlet boundary condition, point input, hydrology MATLAB Answers — New Questions
训练多输出数据时报错“数据类型无效。响应必须为双精度或单精度向量。”
train_x_n为36×2double,train_y_n为36×9double,但model=TreeBagger(tree(i,j), train_x_n, train_y_n, ……一行报错“数据类型无效。响应必须为双精度或单精度向量。”(Invalid data type. Response must be a double or single vector.)
当把train_y_n改成36×1时便不报错,请问如何使它能训练多输出数据?
train_x_n=ones(36,2);
train_y_n=ones(36,9);
[tree,leaf] = meshgrid(80:10:200,1:1:10);
bestRMSE_RF = 1;
% 网格搜索
for i=1:size(leaf,1)
for j=1:size(tree,2)
model=TreeBagger(tree(i,j), train_x_n, train_y_n, OOBPredictorImportance=’on’,Method=’regression’, OOBPrediction=’on’,MinLeafSize=leaf(i,j));
[~,~,RMSE,~]=Test(model,train_x_n,train_y,PSo);
if RMSE<bestRMSE_RF
bestRMSE_RF=RMSE;
besttree=tree(i,j);
bestleaf=leaf(i,j);
model_RF=model;
end
end
endtrain_x_n为36×2double,train_y_n为36×9double,但model=TreeBagger(tree(i,j), train_x_n, train_y_n, ……一行报错“数据类型无效。响应必须为双精度或单精度向量。”(Invalid data type. Response must be a double or single vector.)
当把train_y_n改成36×1时便不报错,请问如何使它能训练多输出数据?
train_x_n=ones(36,2);
train_y_n=ones(36,9);
[tree,leaf] = meshgrid(80:10:200,1:1:10);
bestRMSE_RF = 1;
% 网格搜索
for i=1:size(leaf,1)
for j=1:size(tree,2)
model=TreeBagger(tree(i,j), train_x_n, train_y_n, OOBPredictorImportance=’on’,Method=’regression’, OOBPrediction=’on’,MinLeafSize=leaf(i,j));
[~,~,RMSE,~]=Test(model,train_x_n,train_y,PSo);
if RMSE<bestRMSE_RF
bestRMSE_RF=RMSE;
besttree=tree(i,j);
bestleaf=leaf(i,j);
model_RF=model;
end
end
end train_x_n为36×2double,train_y_n为36×9double,但model=TreeBagger(tree(i,j), train_x_n, train_y_n, ……一行报错“数据类型无效。响应必须为双精度或单精度向量。”(Invalid data type. Response must be a double or single vector.)
当把train_y_n改成36×1时便不报错,请问如何使它能训练多输出数据?
train_x_n=ones(36,2);
train_y_n=ones(36,9);
[tree,leaf] = meshgrid(80:10:200,1:1:10);
bestRMSE_RF = 1;
% 网格搜索
for i=1:size(leaf,1)
for j=1:size(tree,2)
model=TreeBagger(tree(i,j), train_x_n, train_y_n, OOBPredictorImportance=’on’,Method=’regression’, OOBPrediction=’on’,MinLeafSize=leaf(i,j));
[~,~,RMSE,~]=Test(model,train_x_n,train_y,PSo);
if RMSE<bestRMSE_RF
bestRMSE_RF=RMSE;
besttree=tree(i,j);
bestleaf=leaf(i,j);
model_RF=model;
end
end
end machine learning, 机器学习, 多输出, multi-output MATLAB Answers — New Questions
Overlay binary image on RGB image
I would like to overlay the white regions of a binary image onto an RGB image. Is this possible? What about overlaying the black regions?I would like to overlay the white regions of a binary image onto an RGB image. Is this possible? What about overlaying the black regions? I would like to overlay the white regions of a binary image onto an RGB image. Is this possible? What about overlaying the black regions? image processing MATLAB Answers — New Questions
Arduino Uno not working with Simulink (R2024a on macOS)
Folks,
Here’s the scenario:
Arduino Uno + Matlab Arduino Hardware Support + Simulink Arduino Board Support Package, running on macOS Sonoma 14.5, Intel silicone.
All installs well; correct device special file setup during install; hardware tests OK with the Matlab Arduino hardwware support (server uploaded …etc). Simulink: sme think, except that it will just report some unknown function call in the main Matlab window during install, but all goes weel and installs.
Now the fun (or lack thereof ?) beings
Following the basic instructions to get the first LED example working, both starting from a blank model, or using the pre-existing model, said to be for the Mega250.
In the case of starting from a blank model, I’m using the Arduino digital output + a pulse generator, as per the example and screenshot below:
When I come to configure the model, there’s no option, anywhere to select the board and port, let alone to deploy and run it, as shown below:
There’s just the option to download the board support package (which I downloaded and installed), and round, and round, and round we go.
If I use the pre-bundled example, I now get the Atmege250 in the list, but not my Uno (which, yes, I installed and configured earlier …etc):
Can someone tell me what’s going on, and help please?
Thanks in advance,
Ahmed.Folks,
Here’s the scenario:
Arduino Uno + Matlab Arduino Hardware Support + Simulink Arduino Board Support Package, running on macOS Sonoma 14.5, Intel silicone.
All installs well; correct device special file setup during install; hardware tests OK with the Matlab Arduino hardwware support (server uploaded …etc). Simulink: sme think, except that it will just report some unknown function call in the main Matlab window during install, but all goes weel and installs.
Now the fun (or lack thereof ?) beings
Following the basic instructions to get the first LED example working, both starting from a blank model, or using the pre-existing model, said to be for the Mega250.
In the case of starting from a blank model, I’m using the Arduino digital output + a pulse generator, as per the example and screenshot below:
When I come to configure the model, there’s no option, anywhere to select the board and port, let alone to deploy and run it, as shown below:
There’s just the option to download the board support package (which I downloaded and installed), and round, and round, and round we go.
If I use the pre-bundled example, I now get the Atmege250 in the list, but not my Uno (which, yes, I installed and configured earlier …etc):
Can someone tell me what’s going on, and help please?
Thanks in advance,
Ahmed. Folks,
Here’s the scenario:
Arduino Uno + Matlab Arduino Hardware Support + Simulink Arduino Board Support Package, running on macOS Sonoma 14.5, Intel silicone.
All installs well; correct device special file setup during install; hardware tests OK with the Matlab Arduino hardwware support (server uploaded …etc). Simulink: sme think, except that it will just report some unknown function call in the main Matlab window during install, but all goes weel and installs.
Now the fun (or lack thereof ?) beings
Following the basic instructions to get the first LED example working, both starting from a blank model, or using the pre-existing model, said to be for the Mega250.
In the case of starting from a blank model, I’m using the Arduino digital output + a pulse generator, as per the example and screenshot below:
When I come to configure the model, there’s no option, anywhere to select the board and port, let alone to deploy and run it, as shown below:
There’s just the option to download the board support package (which I downloaded and installed), and round, and round, and round we go.
If I use the pre-bundled example, I now get the Atmege250 in the list, but not my Uno (which, yes, I installed and configured earlier …etc):
Can someone tell me what’s going on, and help please?
Thanks in advance,
Ahmed. arduino, simulink, macos MATLAB Answers — New Questions
PDE toolbox and load on nodes
I use the PDE Toolbox to analysis a discrete geometry, and I want to put the force vector on a point. But I can’t define a point through the syntax "loadedVertex". Is there any other option to define the point? thank you!I use the PDE Toolbox to analysis a discrete geometry, and I want to put the force vector on a point. But I can’t define a point through the syntax "loadedVertex". Is there any other option to define the point? thank you! I use the PDE Toolbox to analysis a discrete geometry, and I want to put the force vector on a point. But I can’t define a point through the syntax "loadedVertex". Is there any other option to define the point? thank you! pde, load on nodes MATLAB Answers — New Questions
MAPS Excessive Price Increase
I just renewed my MAPS subscription. As a background I’m a one person organisation.
For many years the price was A$440 inc GST.
This year, the price was over A$710 inc GST. Which is a price increase of over 75%.
I was told this was because now all pricing is based on USD so I’m paying the equivalent of US$400, and that it’s not a price increase.
I’m posting this to raise my objection to the exhorbitant price increase, and find out if other people have also been similarly effected.
I just renewed my MAPS subscription. As a background I’m a one person organisation. For many years the price was A$440 inc GST. This year, the price was over A$710 inc GST. Which is a price increase of over 75%. I was told this was because now all pricing is based on USD so I’m paying the equivalent of US$400, and that it’s not a price increase. I’m posting this to raise my objection to the exhorbitant price increase, and find out if other people have also been similarly effected. Read More
Need a formula
Please help
I need a formula for the following
PM =8 and N =8 this needs to be calculated then taken off the value of 70
How do i do this?
Please helpI need a formula for the followingPM =8 and N =8 this needs to be calculated then taken off the value of 70 How do i do this? Read More
Error inserting – as an object – TXT or PDF file into Word (for MacOs)
Error when inserting – as an object – TXT or PDF file in Word (for MacOs)
When trying to insert a TXT file as an object, to be displayed as an icon (Insert-> Object -> From File (Display as icon) in Word for MacOS, the application gives the following error message:
“Server application, source file, or item not found.
Verify that the application is correctly installed and has not been deleted, moved, renamed, or blocked by policy.”
Inserting as a file (Insert->File…) works correctly.
When trying to insert a PDF file as an object, I only inserted the first page as a picture.
I contacted Microsoft 365 support who advised me to post the issue in this forum.
Thank you for any and all help.
Error when inserting – as an object – TXT or PDF file in Word (for MacOs) When trying to insert a TXT file as an object, to be displayed as an icon (Insert-> Object -> From File (Display as icon) in Word for MacOS, the application gives the following error message:”Server application, source file, or item not found.Verify that the application is correctly installed and has not been deleted, moved, renamed, or blocked by policy.” Inserting as a file (Insert->File…) works correctly.When trying to insert a PDF file as an object, I only inserted the first page as a picture.I contacted Microsoft 365 support who advised me to post the issue in this forum.Thank you for any and all help. Read More