Month: August 2024
AI to help with Matlab scripting and Simulink Drawing
Is there an AI for matlab scripts and simulink drawings? (I am not asking how to BUILD an AI system.I am asking for help with scripting and simulink via a Mathworks ai site)Is there an AI for matlab scripts and simulink drawings? (I am not asking how to BUILD an AI system.I am asking for help with scripting and simulink via a Mathworks ai site) Is there an AI for matlab scripts and simulink drawings? (I am not asking how to BUILD an AI system.I am asking for help with scripting and simulink via a Mathworks ai site) ai, scripting, simulink, help, make easy, website, free MATLAB Answers — New Questions
How to Extract Delayed State Terms in a Model with Distributed Delay?
I’m working on a model with distributed delays, and I’m using the ddesd function to solve the delay differential equations. My setup involves a distributed delay, defined by:
tau = 1;
gamma = 0.5;
number_of_delays = 11; % should be odd
lags = linspace(tau-gamma,tau+gamma,number_of_delays);
tspan=[0 600];
sol=ddesd(@(t,y,Z)ddefunc(t,y,Z,lags),lags,[0.2; 0.08],tspan);
p=plot(sol.x,sol.y);
set(p,{‘LineWidth’},{2;2})
title(‘y(t)’)
xlabel(‘Time(days)’), ylabel(‘populations’)
legend(‘x’,’y’)
function yp = ddefunc(~,y,Z,lags)
a=0.1;
b=0.05;
c=0.08;
d=0.02;
yl1 = trapz(lags,Z(2,:));
yp = [a*y(1)-b*y(1)*yl1;
c*y(1)*y(2)-d*y(2)];
end
In the case of discrete delays, we can easily extract the delayed state terms using the deval or interp1 commands. However, I’m unsure how to proceed with extracting or examining the delayed state terms for distributed delay case.I’m working on a model with distributed delays, and I’m using the ddesd function to solve the delay differential equations. My setup involves a distributed delay, defined by:
tau = 1;
gamma = 0.5;
number_of_delays = 11; % should be odd
lags = linspace(tau-gamma,tau+gamma,number_of_delays);
tspan=[0 600];
sol=ddesd(@(t,y,Z)ddefunc(t,y,Z,lags),lags,[0.2; 0.08],tspan);
p=plot(sol.x,sol.y);
set(p,{‘LineWidth’},{2;2})
title(‘y(t)’)
xlabel(‘Time(days)’), ylabel(‘populations’)
legend(‘x’,’y’)
function yp = ddefunc(~,y,Z,lags)
a=0.1;
b=0.05;
c=0.08;
d=0.02;
yl1 = trapz(lags,Z(2,:));
yp = [a*y(1)-b*y(1)*yl1;
c*y(1)*y(2)-d*y(2)];
end
In the case of discrete delays, we can easily extract the delayed state terms using the deval or interp1 commands. However, I’m unsure how to proceed with extracting or examining the delayed state terms for distributed delay case. I’m working on a model with distributed delays, and I’m using the ddesd function to solve the delay differential equations. My setup involves a distributed delay, defined by:
tau = 1;
gamma = 0.5;
number_of_delays = 11; % should be odd
lags = linspace(tau-gamma,tau+gamma,number_of_delays);
tspan=[0 600];
sol=ddesd(@(t,y,Z)ddefunc(t,y,Z,lags),lags,[0.2; 0.08],tspan);
p=plot(sol.x,sol.y);
set(p,{‘LineWidth’},{2;2})
title(‘y(t)’)
xlabel(‘Time(days)’), ylabel(‘populations’)
legend(‘x’,’y’)
function yp = ddefunc(~,y,Z,lags)
a=0.1;
b=0.05;
c=0.08;
d=0.02;
yl1 = trapz(lags,Z(2,:));
yp = [a*y(1)-b*y(1)*yl1;
c*y(1)*y(2)-d*y(2)];
end
In the case of discrete delays, we can easily extract the delayed state terms using the deval or interp1 commands. However, I’m unsure how to proceed with extracting or examining the delayed state terms for distributed delay case. distributed delay, ddesd, delay differential equation, delayed state MATLAB Answers — New Questions
Simulink model for Turtlebot movement along a trajectory avoiding objects
I am working on creating a model in Simulink that allows me to control a Turtlebot waffle pi so that it moves along a 6-point path. Along the path there will be obstacles in the form of red and green spheres. The objective is for the robot to reach all the points of the path avoiding the obstacles, if the sphere is red, avoid to the right and if it is green, avoid to the left.
I have already created the following Simulink model where the most important thing is in the control function since it describes the behavior of the robot, however the error that keeps appearing is the following: Error: Block ”Project_3/MATLAB Function” does not fully set the dimensions of output ‘next_index’. Which I do not find sense since the variable next_index is defined from the beginning. I attach the images of the model that I am creating.
function [area, x_obst, y_obst, target_x, target_y, obstacle, current_index, target_theta,last_point] = WaypointSelector(a, cent, waypoints, current_index)
%Extract obstacle’s area and position
[~,i] = max(a);
area = max(a);
if ~isempty(i)
obstacle = cent(i,:);
else
obstacle = [0,0];
end
% Cordanates of the obstacles
x_obst = obstacle(1);
y_obst = obstacle(2);
% Extract target waypoint
target_x = waypoints(current_index, 1);
target_y = waypoints(current_index, 2);
last_point = size(waypoints, 1);
target_theta = waypoints(current_index, 3);
target_theta = atan2(sin(target_theta), cos(target_theta));
end
CONTROL FUNCTION:
function [v, omega, next_index] = ComputeControl(target_x, target_y, obstacle, current_index, target_theta, last_point, current_x, current_y, x_ang, y_ang, z_ang, w_ang, ranges)
% Constants
max_velocity = 0.2; % max linear velocity
max_yaw_rate = 0.4; % max angular velocity
max_distance = 0.05; % max distance to consider waypoint reached
l = 640; % size of the camera’s image
h = 480;
% Initialize output
next_index = int32(current_index); % Initialize as integer (or the appropriate type)
% Coordinates of the obstacles
x_obst = obstacle(1);
y_obst = obstacle(2);
% Position and direction of the robot
current_angle = quat2eul([x_ang y_ang z_ang w_ang]);
yaw_angle = current_angle(3);
if yaw_angle > pi
current_theta = yaw_angle – 2*pi;
else
current_theta = yaw_angle;
end
% Compute distance and angle to the target waypoint
dx = target_x – current_x;
dy = target_y – current_y;
distance = sqrt(dx^2 + dy^2); % Distance to the waypoints
dist_obs = min(ranges); % Distance to the closest obstacle (Radar)
angle_to_target = atan2(dy, dx); % Angle needed to reach the waypoints
% Adjust the angle to be in the range [-pi, pi]
if dx < 0
if dy > 0
angle_to_target = angle_to_target + pi;
else
angle_to_target = angle_to_target – pi;
end
end
% Compute delta theta and the error in the direction
d_theta = target_theta – current_theta;
angle_error = current_theta – angle_to_target;
% Compute the control logic commands to achieve the waypoints and avoid the obstacles
if (x_obst – l/2) > 0
omega = max_yaw_rate;
v = max_velocity;
else
if current_index > last_point
v = 0;
omega = 0;
next_index = current_index;
else
if distance <= max_distance && abs(d_theta) <= 0.05
next_index = current_index + 1;
else
next_index = current_index; % Ensure next_index is assigned
end
if distance > max_distance
if abs(angle_error) > 0.01
if abs(angle_error) > 0.5
omega = max_yaw_rate;
elseif abs(angle_error) > 0.3 && abs(angle_error) <= 0.5
omega = 0.5 * max_yaw_rate;
else
omega = 0.1 * max_yaw_rate;
end
if current_theta > angle_to_target && current_index < 7
omega = -omega;
end
if distance >= 3 * max_distance
v = max_velocity;
else
v = max_velocity * (distance / (distance + 1));
end
else
omega = 0;
if distance >= 3 * max_distance
v = max_velocity;
else
v = max_velocity * (distance / (distance + 1));
end
end
else
if abs(d_theta) > 0.05
omega = max_yaw_rate * d_theta;
v = 0;
if current_theta > target_theta
omega = -omega;
end
else
omega = 0;
v = 0;
end
end
end
end
% Limit the velocities just in case
v = min(v, max_velocity);
omega = min(max(omega, -max_yaw_rate), max_yaw_rate);
endI am working on creating a model in Simulink that allows me to control a Turtlebot waffle pi so that it moves along a 6-point path. Along the path there will be obstacles in the form of red and green spheres. The objective is for the robot to reach all the points of the path avoiding the obstacles, if the sphere is red, avoid to the right and if it is green, avoid to the left.
I have already created the following Simulink model where the most important thing is in the control function since it describes the behavior of the robot, however the error that keeps appearing is the following: Error: Block ”Project_3/MATLAB Function” does not fully set the dimensions of output ‘next_index’. Which I do not find sense since the variable next_index is defined from the beginning. I attach the images of the model that I am creating.
function [area, x_obst, y_obst, target_x, target_y, obstacle, current_index, target_theta,last_point] = WaypointSelector(a, cent, waypoints, current_index)
%Extract obstacle’s area and position
[~,i] = max(a);
area = max(a);
if ~isempty(i)
obstacle = cent(i,:);
else
obstacle = [0,0];
end
% Cordanates of the obstacles
x_obst = obstacle(1);
y_obst = obstacle(2);
% Extract target waypoint
target_x = waypoints(current_index, 1);
target_y = waypoints(current_index, 2);
last_point = size(waypoints, 1);
target_theta = waypoints(current_index, 3);
target_theta = atan2(sin(target_theta), cos(target_theta));
end
CONTROL FUNCTION:
function [v, omega, next_index] = ComputeControl(target_x, target_y, obstacle, current_index, target_theta, last_point, current_x, current_y, x_ang, y_ang, z_ang, w_ang, ranges)
% Constants
max_velocity = 0.2; % max linear velocity
max_yaw_rate = 0.4; % max angular velocity
max_distance = 0.05; % max distance to consider waypoint reached
l = 640; % size of the camera’s image
h = 480;
% Initialize output
next_index = int32(current_index); % Initialize as integer (or the appropriate type)
% Coordinates of the obstacles
x_obst = obstacle(1);
y_obst = obstacle(2);
% Position and direction of the robot
current_angle = quat2eul([x_ang y_ang z_ang w_ang]);
yaw_angle = current_angle(3);
if yaw_angle > pi
current_theta = yaw_angle – 2*pi;
else
current_theta = yaw_angle;
end
% Compute distance and angle to the target waypoint
dx = target_x – current_x;
dy = target_y – current_y;
distance = sqrt(dx^2 + dy^2); % Distance to the waypoints
dist_obs = min(ranges); % Distance to the closest obstacle (Radar)
angle_to_target = atan2(dy, dx); % Angle needed to reach the waypoints
% Adjust the angle to be in the range [-pi, pi]
if dx < 0
if dy > 0
angle_to_target = angle_to_target + pi;
else
angle_to_target = angle_to_target – pi;
end
end
% Compute delta theta and the error in the direction
d_theta = target_theta – current_theta;
angle_error = current_theta – angle_to_target;
% Compute the control logic commands to achieve the waypoints and avoid the obstacles
if (x_obst – l/2) > 0
omega = max_yaw_rate;
v = max_velocity;
else
if current_index > last_point
v = 0;
omega = 0;
next_index = current_index;
else
if distance <= max_distance && abs(d_theta) <= 0.05
next_index = current_index + 1;
else
next_index = current_index; % Ensure next_index is assigned
end
if distance > max_distance
if abs(angle_error) > 0.01
if abs(angle_error) > 0.5
omega = max_yaw_rate;
elseif abs(angle_error) > 0.3 && abs(angle_error) <= 0.5
omega = 0.5 * max_yaw_rate;
else
omega = 0.1 * max_yaw_rate;
end
if current_theta > angle_to_target && current_index < 7
omega = -omega;
end
if distance >= 3 * max_distance
v = max_velocity;
else
v = max_velocity * (distance / (distance + 1));
end
else
omega = 0;
if distance >= 3 * max_distance
v = max_velocity;
else
v = max_velocity * (distance / (distance + 1));
end
end
else
if abs(d_theta) > 0.05
omega = max_yaw_rate * d_theta;
v = 0;
if current_theta > target_theta
omega = -omega;
end
else
omega = 0;
v = 0;
end
end
end
end
% Limit the velocities just in case
v = min(v, max_velocity);
omega = min(max(omega, -max_yaw_rate), max_yaw_rate);
end I am working on creating a model in Simulink that allows me to control a Turtlebot waffle pi so that it moves along a 6-point path. Along the path there will be obstacles in the form of red and green spheres. The objective is for the robot to reach all the points of the path avoiding the obstacles, if the sphere is red, avoid to the right and if it is green, avoid to the left.
I have already created the following Simulink model where the most important thing is in the control function since it describes the behavior of the robot, however the error that keeps appearing is the following: Error: Block ”Project_3/MATLAB Function” does not fully set the dimensions of output ‘next_index’. Which I do not find sense since the variable next_index is defined from the beginning. I attach the images of the model that I am creating.
function [area, x_obst, y_obst, target_x, target_y, obstacle, current_index, target_theta,last_point] = WaypointSelector(a, cent, waypoints, current_index)
%Extract obstacle’s area and position
[~,i] = max(a);
area = max(a);
if ~isempty(i)
obstacle = cent(i,:);
else
obstacle = [0,0];
end
% Cordanates of the obstacles
x_obst = obstacle(1);
y_obst = obstacle(2);
% Extract target waypoint
target_x = waypoints(current_index, 1);
target_y = waypoints(current_index, 2);
last_point = size(waypoints, 1);
target_theta = waypoints(current_index, 3);
target_theta = atan2(sin(target_theta), cos(target_theta));
end
CONTROL FUNCTION:
function [v, omega, next_index] = ComputeControl(target_x, target_y, obstacle, current_index, target_theta, last_point, current_x, current_y, x_ang, y_ang, z_ang, w_ang, ranges)
% Constants
max_velocity = 0.2; % max linear velocity
max_yaw_rate = 0.4; % max angular velocity
max_distance = 0.05; % max distance to consider waypoint reached
l = 640; % size of the camera’s image
h = 480;
% Initialize output
next_index = int32(current_index); % Initialize as integer (or the appropriate type)
% Coordinates of the obstacles
x_obst = obstacle(1);
y_obst = obstacle(2);
% Position and direction of the robot
current_angle = quat2eul([x_ang y_ang z_ang w_ang]);
yaw_angle = current_angle(3);
if yaw_angle > pi
current_theta = yaw_angle – 2*pi;
else
current_theta = yaw_angle;
end
% Compute distance and angle to the target waypoint
dx = target_x – current_x;
dy = target_y – current_y;
distance = sqrt(dx^2 + dy^2); % Distance to the waypoints
dist_obs = min(ranges); % Distance to the closest obstacle (Radar)
angle_to_target = atan2(dy, dx); % Angle needed to reach the waypoints
% Adjust the angle to be in the range [-pi, pi]
if dx < 0
if dy > 0
angle_to_target = angle_to_target + pi;
else
angle_to_target = angle_to_target – pi;
end
end
% Compute delta theta and the error in the direction
d_theta = target_theta – current_theta;
angle_error = current_theta – angle_to_target;
% Compute the control logic commands to achieve the waypoints and avoid the obstacles
if (x_obst – l/2) > 0
omega = max_yaw_rate;
v = max_velocity;
else
if current_index > last_point
v = 0;
omega = 0;
next_index = current_index;
else
if distance <= max_distance && abs(d_theta) <= 0.05
next_index = current_index + 1;
else
next_index = current_index; % Ensure next_index is assigned
end
if distance > max_distance
if abs(angle_error) > 0.01
if abs(angle_error) > 0.5
omega = max_yaw_rate;
elseif abs(angle_error) > 0.3 && abs(angle_error) <= 0.5
omega = 0.5 * max_yaw_rate;
else
omega = 0.1 * max_yaw_rate;
end
if current_theta > angle_to_target && current_index < 7
omega = -omega;
end
if distance >= 3 * max_distance
v = max_velocity;
else
v = max_velocity * (distance / (distance + 1));
end
else
omega = 0;
if distance >= 3 * max_distance
v = max_velocity;
else
v = max_velocity * (distance / (distance + 1));
end
end
else
if abs(d_theta) > 0.05
omega = max_yaw_rate * d_theta;
v = 0;
if current_theta > target_theta
omega = -omega;
end
else
omega = 0;
v = 0;
end
end
end
end
% Limit the velocities just in case
v = min(v, max_velocity);
omega = min(max(omega, -max_yaw_rate), max_yaw_rate);
end simulink, turtlebot, matlab, control, gazebo, ros, image processing, motion, error MATLAB Answers — New Questions
How “medfilt1(X,N) filter logic works. How to convert this into embedded c language. please suggest how to do this.
Hello sir,
we preferred to use the median filter "medfilt1(X,N) to filter the noise and spikes in the data. please give the logic how this filter works, how we can convert the matlab code to embedded c format.
thanks & regardsHello sir,
we preferred to use the median filter "medfilt1(X,N) to filter the noise and spikes in the data. please give the logic how this filter works, how we can convert the matlab code to embedded c format.
thanks & regards Hello sir,
we preferred to use the median filter "medfilt1(X,N) to filter the noise and spikes in the data. please give the logic how this filter works, how we can convert the matlab code to embedded c format.
thanks & regards signal processing MATLAB Answers — New Questions
Software updates postponed
Hello
When I deploy software updates, the result is that they are postponed, for 5 or 6 days.
I attach the picture with the situation, as it is seen on a client’s Software Center.
I cannot find where I can change that setting, where I can cancel that delay setting. Could someone point me where to look for that setting?
HelloWhen I deploy software updates, the result is that they are postponed, for 5 or 6 days. I attach the picture with the situation, as it is seen on a client’s Software Center.I cannot find where I can change that setting, where I can cancel that delay setting. Could someone point me where to look for that setting? Read More
Migrate Intranet from old CMS to SharePoint Online
Hi,
I have a customer that wants to migrate its Intranet from an old CMS that has an API to SharePoint Online. Think of the intranet like a series of Communication Sites.
The challenge here is:
– Read pages from their API that has title, body, author, image and/or videos (can be YouTube videos or videos stored in the CMS itself that have to be migrated to Stream) and publish date
– For each page, create a corresponding SharePoint web page, and insert the appropriate web parts and if there are videos from the CMS, upload them to Stream and insert the Stream web part in the page
What kind of solution would you develop? These are the necessities I identity:
– API to Create a page
– API to create sections in the page (not sure if necesary)
– API to insert web parts in the page
– API to upload videos to Stream
Thanks
Hi,I have a customer that wants to migrate its Intranet from an old CMS that has an API to SharePoint Online. Think of the intranet like a series of Communication Sites.The challenge here is:- Read pages from their API that has title, body, author, image and/or videos (can be YouTube videos or videos stored in the CMS itself that have to be migrated to Stream) and publish date- For each page, create a corresponding SharePoint web page, and insert the appropriate web parts and if there are videos from the CMS, upload them to Stream and insert the Stream web part in the pageWhat kind of solution would you develop? These are the necessities I identity:- API to Create a page- API to create sections in the page (not sure if necesary)- API to insert web parts in the page- API to upload videos to Stream Thanks Read More
Excel Note or Comment in Cell – Can’t figure out how it was entered
I downloaded an excel template from create.microsoft.com. In cel ‘A1’, when I click that cell, a note/comment pops up. See attached image. If Im not in the cell this note/comment disappears. Normally when you enter a note/comment, when you are not in the cell there is a visual indication that a note/comment exists in that cell(i.e. for a note it is a red right pointing triangle in the upper right of the cell). when you hover over that cell the note appears. when you take your mouse away from that cell the not disappears.
However the note or comment in cell ‘A1’ doesn’t have that behavior. this note or comment only appears when you click in the cell. when I right click the cell, the only option is for a new comment or new note.
Im trying to figure out what this feature is in cell ‘A1’ to behave this way. Is this a note or a comment?
Whatever it is, where do I go to edit this or create another one just like it in another cell. BTW, this template, has the same feature in other cells. When I click other cells, another note/comment appears alerting the user what to input into the cell.
This is not a macro enabled workbook, so I know its not a macro.
Does anyone know how this is created and how to edit it?
I downloaded an excel template from create.microsoft.com. In cel ‘A1’, when I click that cell, a note/comment pops up. See attached image. If Im not in the cell this note/comment disappears. Normally when you enter a note/comment, when you are not in the cell there is a visual indication that a note/comment exists in that cell(i.e. for a note it is a red right pointing triangle in the upper right of the cell). when you hover over that cell the note appears. when you take your mouse away from that cell the not disappears. However the note or comment in cell ‘A1’ doesn’t have that behavior. this note or comment only appears when you click in the cell. when I right click the cell, the only option is for a new comment or new note. Im trying to figure out what this feature is in cell ‘A1’ to behave this way. Is this a note or a comment?Whatever it is, where do I go to edit this or create another one just like it in another cell. BTW, this template, has the same feature in other cells. When I click other cells, another note/comment appears alerting the user what to input into the cell.This is not a macro enabled workbook, so I know its not a macro.Does anyone know how this is created and how to edit it? Read More
Saving multiple e-mails in either New Outlook or Webmail
Is there a way to save multiple e-mails locally either from the webmail client or the new outlook client. The reason I ask is we have shared mailboxes and a user who needs access to e-mails that are older than 12 months. I’m aware you can save one e-mail at a time by right clicking and clicking on save as, but if you select more than 1 e-mail you no longer have this option.
I’ve tried dragging and dropping, both with ctrl and without, and I’m unable to move a copy from New Outlook locally.
Is there a way to save multiple e-mails locally either from the webmail client or the new outlook client. The reason I ask is we have shared mailboxes and a user who needs access to e-mails that are older than 12 months. I’m aware you can save one e-mail at a time by right clicking and clicking on save as, but if you select more than 1 e-mail you no longer have this option. I’ve tried dragging and dropping, both with ctrl and without, and I’m unable to move a copy from New Outlook locally. Read More
Configurando DAPR, KEDA no AKS
A CNCF (Cloud Native Computing Foundation) define Aplicações Cloud-Native como software que consistem em vários serviços pequenos e interdependentes chamados microsserviços. Essas aplicações são projetadas para aproveitar ao máximo as inovações em computação em nuvem, como escalabilidade, segurança, flexibilidade e automação.
Alguns dos projetos Cloud-Native mais conhecidos da CNCF são: Kubernetes, Prometheus, Envoy, Jaeger, Helm, DAPR, KEDA e etc.
Neste artigo, falaremos sobre DAPR, KEDA e como esta combinação pode trazer eficiência e flexibilidade na construção de aplicações em Kubernetes.
DAPR: Distributed Application Runtime
DAPR é um runtime portátil, serverless orientado a eventos que facilita a vida dos desenvolvedores na construção de microsserviços resilientes, principalmente no gerenciamento de estado, envio e consumo de mensagens via broker etc, usando uma abordagem de mesh, que simplifique bastante seu gerenciamento e também abraça a diversidade de linguagens e frameworks.
KEDA: Kubernetes Event Driven Autoscaling
KEDA torna o escalonamento automático de aplicativos simples, aplicando escalonamento automático orientado a eventos para escalar seu aplicativo com base na demanda ( filas, tópicos etc). Ele permite que você escale cargas de trabalho de 0 a N instâncias de forma eficiente (escala para zero), o que significa que seu aplicativo pode escalar dinamicamente para zero instâncias quando não estiver em uso, ajudando bastante em cenários de otimização de custos.
Desta forma, aproveitei para montar este repositório no GitHub chamado “App-Plant-Tree” que cobre conceitos sobre Arquitetura Cloud-Native combinando as seguintes tecnologias:
Go – Producer/Consumer App
Distributed Application Runtime – DAPR
Kubernetes Event Driven Autoscaling – KEDA
Azure Kubernetes Service (AKS)
Azure Container Registry (ACR)
Azure Service Bus (ASB)
Ferramentas para desenvolvimento
Go SDK
Azure CLI
DAPR CLI
Kubectl
Helm CLI
GIT bash
Visual Studio Code
Configurando a Infraestrutura
Logando no Azure usando a linha de comando(CLI):
az login
Substitua os valores das variáveis abaixo conforme seu ambiente:
– $SubscriptionID = ”
– $Location = ”
– $ResourceGroupName = ”
– $AKSClusterName = ”
– $ContainerRegistryName = ”
– $ServiceBusNamespace = ”
Aponte para sua subscription:
az account set –subscription $SubscriptionID
Criando seu resource group:
az group create –name $ResourceGroupName –location $Location
1. Criando seu cluster AKS e conecte o ACR
Crie o cluster AKS (Azure Kubernetes Service):
az aks create –resource-group $ResourceGroupName –name $AKSClusterName –node-count 3 –location $Location –node-vm-size Standard_D4ds_v5 –tier free –enable-pod-identity –network-plugin azure –generate-ssh-keys
De forma opcional, mas benéfica por trazer o suporte da Microsoft(veja detalhes nos links abaixo), você pode você pode instalar DAPR e KEDA via extension/addons.
DAPR AKS Extension
KEDA AKS Addon
Crie o ACR (Azure Container Registry):
az acr create –name $ContainerRegistryName –resource-group $ResourceGroupName –sku basic
Conecte o AKS ao ACR :
az aks update –name $AKSClusterName –resource-group $ResourceGroupName –attach-acr $ContainerRegistryName
Pegue as credenciais para se conectar ao cluster AKS:
az aks get-credentials –resource-group $ResourceGroupName –name $AKSClusterName –overwrite-existing
Verifique a conexão com o cluster:
kubectl cluster-info
2. Configurando DAPR no AKS via helmcharts
Adicione a referência:
helm repo add dapr https://dapr.github.io/helm-charts/
helm repo update
helm upgrade –install dapr dapr/dapr –namespace dapr-system –create-namespace
helm upgrade –install dapr-dashboard dapr/dapr-dashboard –namespace dapr-system –create-namespace
Verifique se os pods estão rodando:
kubectl get pods -n dapr-system
2.1 Configurando o DAPR Dashboard
para acessar o DAPR dashboard, execute o seguinte comando
dapr dashboard -k
Resultado esperado:
DAPR dashboard found in namespace: dapr-system
DAPR dashboard available at http://localhost:8080
3. Configurando KEDA no AKS via helmcharts
Adicione a referência:
helm repo add kedacore https://kedacore.github.io/charts
helm repo update
helm upgrade –install keda kedacore/keda -n keda-system –create-namespace
helm upgrade –install keda-add-ons-http kedacore/keda-add-ons-http -n keda-system –create-namespace
Verifique se os pods estão rodando:
kubectl get pods -n keda-system
4. Configurando a camada de transporte para DAPR e KEDA
Neste projeto, temos três diferentes opções para configurar a camada de transporte (escolha uma):
Azure Service Bus
Redis
RabbitMq
Deploy das aplicações no AKS
1. Criando as imagens docker
az acr login –name $ContainerRegistryName
docker build -t “$ContainerRegistryName.azurecr.io/consumer-app:1.0.0″ -f cmd/consumer/dockerfile .
docker build -t “$ContainerRegistryName.azurecr.io/producer-app:1.0.0″ -f cmd/producer/dockerfile .
2. Subindo as imagens no Container Registry ACR
docker push “$ContainerRegistryName.azurecr.io/consumer-app:1.0.0″
docker push “$ContainerRegistryName.azurecr.io/producer-app:1.0.0″
3. Aplicando Helmchart das Aplicações
helm upgrade –install app .helmcharts/app -n tree –create-namespace
Verifique se os pods estão rodando::
kubectl get pods -n tree
4. Testando as aplicações
# Revisar Logs
kubectl logs -f -l app=consumer1 –all-containers=true -n tree
# Fazer o foward da porta
kubectl port-forward pod/producer1 8081 8081 -n tree
# Enviar um post para o producer
– POST -> http://localhost:8081/plant
– Json Body: {“numberOfTrees”:100}
# Validar os pods e seus status
kubectl get pod -l app=consumer1 -n tree
4. Removendo recursos
Removendo os helm-charts:
helm uninstall app -n tree
helm uninstall keda-add-ons-http -n keda-system
helm uninstall keda -n keda-system
helm uninstall dapr -n dapr-system
Excluir todos os recursos Azure:
az aks delete –name $AKSClusterName –resource-group $ResourceGroupName
az acr delete –name $ContainerRegistryName –resource-group $ResourceGroupName
az group delete –name $ResourceGroupName
Referências
DAPR KEDA GO – Plant Tree App
DAPR – Pros/Cons
KEDA – Pros/Cons
Microsoft Tech Community – Latest Blogs –Read More
Securing Multi-Cloud Gen AI workloads using Azure Native Solutions
Note: This series is part of “Security using Azure Native services” series and assumes that you are or planning to leverage Defender for Cloud, Defender XDR Portal, and Azure Sentinel.
Introduction
AI Based Technology introduces a new set of security risks that may not be comprehensively covered by existing risk management frameworks. Based on our experience, customers often only consider the risks related to the Gen AI models like OpenAI or Anthropic. Thereby, not taking a holistic approach that cover all aspects of the workload.
This article will help you:
Understand a typical multi-cloud Gen AI workload pattern
Articulate the technical risks exists in the AI workload
Recommend security controls leveraging Azure Native services
We will not cover Data Security (cryptography, regulatory implications etc.), model specific issues like Hallucinations, deepfakes, privacy, toxicity, societal bias, supply chain security, attacks that leverage Gen AI capabilities to manifest such as Disinformation, Deepfakes, Financial Fraud etc. Instead, we aim to provide guidance on architectural security controls that will enable secure:
Configuration of AI workload
Operation of the workload
This is a two-part series:
Part 1: Provides a framework to understand the threats related to Gen AI workloads holistically and an easy reference to the native security solutions that help mitigate. We also provide sample controls using leading industry frameworks.
Part 2: Will dive deeper into the AI shared responsibility model and how that overlaps with your design choices
Threat Landscape
Let’s discuss some common threats:
Insider abuse: An insider (human or machine) sending sensitive / proprietary information to a third party GenAI model
Supply chain poisoning: Compromise of a third-party GenAI model (whether this is a SaaS or binary llm models developed by third party and downloaded by your organization)
System abuse: Manipulating the model prompts to mislead the end user of the model
Over privilege: Granting unrestricted permissions and capability to the model thereby allowing the model to perform unintentional actions
Data theft/exfiltration: Intentional or unintentional exfiltration of the proprietary models, prompts, and model outputs
Insecure configuration: Not following the leading practices when architecting and operating your AI workload
Model poisoning: Tampering with the model itself to affect the desired behavior of the model
Denial of Service: Impacting the performance of the model with resource intensive operations
We will discuss how these threats apply in a common architecture.
Reference architecture
Fig. Gen-AI cloud native workload
Let’s discuss each step so we can construct a layered defense:
Assuming you are following cloud native architecture patterns, your developer will publish all the application and infrastructure code in an Azure DevOps repo
The DevOps pipeline will then Create a container image
Pipeline will also set up respective API endpoints in Azure API management
Pipeline will deploy the image with Kubernetes manifests (note that he secrets will stored out of bound in Azure Key Vault)
User access an application that leverages GenAI (Open AI for Azure and Anthropic in AWS)
Depending on the API endpoint requested, APIM will direct the request to the containerized application running in cloud native Kubernetes platforms (AKS or EKS)
The application uses API credentials stored in KeyVault
The application makes requests to appropriate Gen AI service
The results are stored in a storage service and are reported back to the user who initiated step 5 above
Each cloud native service stores the diagnostic logs in a centralized Log Analytics Workspace (LAW)
Azure Sentinel is enabled on the LAW
The subscription where the workload is running is protected by Microsoft Defender for Cloud. Entra ID is the identity provider for this multi-cloud workload.
Layered defense using native services
If you were to follow the Kill Chain framework, in many cases the initial attack vectors may be what we have seen earlier like spear phishing, exploiting poorly written application (XSS etc.), privilege escalation. However, these attacks will lead to gen AI specific scenarios:
Injecting instructions to trick the application to query private datastores by removing the prompt and conversation history. The classic example would be Cross Site Request Forgery (CSRF) where the attacker will trick the browser (or client application) to perform this query. Without a Gen AI aware outbound filter and inbound checking this would hard to detect or prevent.
Privilege escalation, exploiting the privileges that user might have granted to a third-party app or plugin, which can query LLM model. In this scenario, an attacker can get hold of user’s browser running the plugin or the desktop client and then provide a prompt to exfiltrate the information. Like 1 above, in this case you will need Gen AI aware controls at different layers
Jailbreaking the AI safety mechanisms to trick the LLM to perform restricted capabilities like malware generation, phishing etc.
Distributed denial of service by making the model unavailable this can be via unrestricted queries
Supply chain poisoning by using unapproved images, SBOM components, in your application etc.
Hopefully, this helps you realize that you need a layered defense to mitigate, like so:
Microsoft Native Security Solutions and security controls
Microsoft’s security solutions provide deep capabilities across each of the above layers. Let’s look at some specific controls, where would they apply in the reference architecture, and the corresponding native solution. To provide a standardized framework, we leveraged leading practices provided by NIST, OWASP, ISACs and other bodies to derive the controls.
Please note that in this article we intend to provide a foundational knowledge as a result we are focusing on the high-level description of different native security components that you may be able to leverage. In subsequent articles we plan to focus specific use cases.
#
Control description
Ref architecture step
Native solution
Description
1.
Verify that systems properly handle queries that may give rise to inappropriate, malicious, or illegal usage, including facilitating manipulation, extortion, targeted impersonation, cyber-attacks, and weapons creation:
– Prompt injection (OWASP LLM01)
– Insecure Output Handling (OWASP LLM02)
– Sensitive Information Disclosure (LLM06)
– Insecure Plugin Design (LLM07)
5, 6, 8,9
Azure WAF, APIM, Defender for API, Defender for Containers,
Defender for Key Vault,
Defender for AI,
Defender for Database,
Microsoft Sentinel
Azure WAF may act as the first line of defense for injections made via API or HTTP requests like XSS reducing the likelihood and impact of LLM01 and LLM02
Defender for API can help identify risky APIs that also APIs that might respond with Sensitive Data released by the model in addition to alerting on anomalies. This is specifically useful for LLM06
Defender for Containers might detect if an attacker is trying to manipulate the running Gen AI application to change the behavior to get access to the Gen AI services
Defender for AI might detect several Gen AI specific anomalies related to the usage pattern like Jailbreak (LLM07), Unintended sensitive data disclosure (LLM06) etc.
Azure AI content safety has Prompt Shield for User Prompts this feature natively targets User Prompt injection attacks, where users deliberately exploit system vulnerabilities to elicit unauthorized behavior from the LLM (LLM01)
2.
Regularly assess and verify that security measures remain effective and have not been compromised:
– Prompt injection (OWASP LLM01)
– Insecure Output Handling (OWASP LLM02)
– Model Denial of Service (LLM04)
– Supply chain vulnerabilities (LLM05)
– Insecure Plugin Design (LLM07)
– Excessive agency (OWASP LLM08)
– Overreliance (LLM09)
– Model Theft (OWASP LLM10)
All
Defender CSPM, Defender for API, Defender for Containers,
Defender for Key Vault,
Defender for AI,
Microsoft Sentinel
DevOps Security, which is part of Defender CSPM, allows you to scan your Infrastructure as Code templates as well as your application code (via third party solution or GHAS). This enables you to prevent insecure deployment reducing the likelihood of LLM05 and LLM07
Defender CSPM has several leading practices driven recommendations for each step of the reference architecture to enable secure operations of AI workloads reducing the likelihood of LLM01
Defender for AI specifically have alerting targeted at LLM06, LLM07 (as described above) in addition to Model Theft (LLM10)
Defender for Database also has protections to prevent for LLM07 to notify of the harmful impacts of raw SQL or programming statements instead of Parameters
Monitoring the recommendations of Defender CSPM may reduce your chances of accidental exposure as well simulating the alerts from Workload protection capabilities will help you validate if you have appropriate response plans in place.
3.
Measure the rate at which recommendations from security checks and incidents are implemented. Assess how quickly the AI system can adapt and improve based on lessons learned from security incidents and feedback.
All
Defender CSPM, Microsoft Sentinel
Secure Score overtime and Governance workbook within Defender CSPM can help you identify how the security of your AI workload is trending.
In addition, you can run workbooks in Microsoft Sentinel to assess your response capabilities and specifically Azure Open AI related issues. There are also workbooks that help you identify visualize the events from the WAF
4.
Verify fine-tuning does not compromise safety and security controls.
– Prompt injection (OWASP LLM01)
– Insecure Output Handling (OWASP LLM02)
– Model Denial of Service (LLM04)
– Insecure Plugin Design (LLM07)
– Excessive agency (OWASP LLM08)
1,2,3,5,6,8
Defender CSPM, Defender for API, Defender for Containers,
Defender for AI,
Microsoft Sentinel
As mentioned in #1 above, there are native safeguards for each of these Gen AI specific threats. You may want to pre-emptively review the security alerts and recommendations to develop responses that you can deploy via Logic App and automate the response using Workflow Automation. There are several starter templates available in Defender for Cloud’s GitHub.
5.
Conduct adversarial testing at a regular cadence to map and measure GAI risks, including tests to address attempts to deceive or manipulate the application of provenance techniques or other misuses. Identify vulnerabilities and understand potential misuse scenarios and unintended outputs.
All
Defender CSPM, Defender for API, Defender for Containers, Defender for Key Vault
Defender for AI,
Microsoft Sentinel
As specified in #4, your Red Team can conduct test against your workloads and review the results in Defender for Cloud’s dashboards or in Microsoft Sentinel’s workbooks mentioned under #3
6.
Evaluate GAI system performance in real-world scenarios to observe its behavior in practical environments and reveal issues that might not surface in controlled and optimized testing environments.
11
Defender for AI, Microsoft Sentinel
You can review the current security state of the AI workload as mentioned in Microsoft Sentinel’s workbooks Azure Open AI related issues and in Defender for Cloud’s Secure Score overtime, Governance workbook, and current alerts.
7.
Establish and maintain procedures for the remediation of issues which trigger incident response processes for the use of a GAI system and provide stakeholders timelines associated with the remediation plan.
5,6,8,11
Defender CSPM, Defender for API, Defender for Containers, Defender for Key Vault,
Defender for AI,
Microsoft Sentinel
You can generate sample alerts in Defender for Cloud and review the recommended actions that are specific to each alert with each stakeholder. Customers often find it beneficial to do this exercise as part of their Cloud Center of Excellence (CCoE). You may then want to set up automation as suggested under #4 above. The Secure Score overtime and Governance workbook will help you benchmark your progress.
8.
Establish and regularly review specific criteria that warrants the deactivation of GAI systems in accordance with set risk tolerances and appetites.
5,6,11
Defender CSPM, Microsoft Sentinel
As you will use Defender for Cloud as a key component, you can leverage the alert management capabilities to manage the status, set up suppression rules, and risk exemptions for specific resources.
Similarly, in Microsoft Sentinel you can set up custom analytic rules and responses to correspond to your risk tolerance. For example, if you do not want to allow access from specific locations you can set up an analytic rule to monitor for that using Azure WAF events.
Call to action
As you saw above, the native services are more than capable to monitor the security of your Gen AI workloads. You should consider:
Discuss the reference architecture with your CCoE to see what mechanisms you currently have in place to transparently protect your Gen AI workloads
Review if you are already leveraging the security services mentioned in the table. If you are not, consider talking to your Azure Account team to see if you can do a deep dive in these services to explore the possibility of replacement
Work with your CCoE to review the alerts recommended above to determine your potential exposure and relevance. Subsequently develop a response plan.
Consider running an extended Proof of Concept of the Services mentioned above so you can evaluate the advantages of native over best of breed.
Understand that if you must, you can leverage specific capabilities in Defender for Cloud and other Azure Services to develop a comprehensive plan. For example, if you are already using a CSPM solution you might want to leverage foundational CSPM capabilities to detect AI configuration deviations along with Defender for AI workload protection. A natively protected reference architecture might look like so,
Fig. Natively protected Gen AI workload
Microsoft Tech Community – Latest Blogs –Read More
how to make an identifer for string variables
Hi
I have a list of string variables, which all ends with "_STI". How can I group them together so that I can perform the same operations to them. For example, I want to assign a number to all the variables ends with "_STI".
Thanks very muchHi
I have a list of string variables, which all ends with "_STI". How can I group them together so that I can perform the same operations to them. For example, I want to assign a number to all the variables ends with "_STI".
Thanks very much Hi
I have a list of string variables, which all ends with "_STI". How can I group them together so that I can perform the same operations to them. For example, I want to assign a number to all the variables ends with "_STI".
Thanks very much string identifier operation MATLAB Answers — New Questions
hi i started the matlab onramp course and im stuck on this further practice question i wld appreciate if anyone cld help me or even give an hint
Post Content Post Content #onramp MATLAB Answers — New Questions
Faster alternate to all() function
I am running a simulation of 100s of thousands loop and I am noticing that inside the each loop an all() function consumes almost 95% of the time. I want a faster alternate to this.
So here is my algorithm:
varname=rand([24665846,4])
for i=1:1000000
idx=idxkeep(i);
ind1=all(varname(:,1:4)==varname(idx,1:4),2);
ind=find(ind1);
endI am running a simulation of 100s of thousands loop and I am noticing that inside the each loop an all() function consumes almost 95% of the time. I want a faster alternate to this.
So here is my algorithm:
varname=rand([24665846,4])
for i=1:1000000
idx=idxkeep(i);
ind1=all(varname(:,1:4)==varname(idx,1:4),2);
ind=find(ind1);
end I am running a simulation of 100s of thousands loop and I am noticing that inside the each loop an all() function consumes almost 95% of the time. I want a faster alternate to this.
So here is my algorithm:
varname=rand([24665846,4])
for i=1:1000000
idx=idxkeep(i);
ind1=all(varname(:,1:4)==varname(idx,1:4),2);
ind=find(ind1);
end matlab, all() MATLAB Answers — New Questions
How to add space between heading of txt file?
Hey,
I have created a txt file and successfully saving data in tabular form But I am having problem in introducing the spaces between the heading of each column. It appears as "h1 h2 h3" but i want space between them so that i may look like "h1______h2_______h3" (without blanks, used to introduce space)
Thanks.Hey,
I have created a txt file and successfully saving data in tabular form But I am having problem in introducing the spaces between the heading of each column. It appears as "h1 h2 h3" but i want space between them so that i may look like "h1______h2_______h3" (without blanks, used to introduce space)
Thanks. Hey,
I have created a txt file and successfully saving data in tabular form But I am having problem in introducing the spaces between the heading of each column. It appears as "h1 h2 h3" but i want space between them so that i may look like "h1______h2_______h3" (without blanks, used to introduce space)
Thanks. headings spacing of txt, txt file MATLAB Answers — New Questions
Problem with installing SSIS extension to Visual Studio
Hi,
I am unable to install SQL Server integration services on my machine.
While installing visual studio instances are not getting detected.
Actually, I tried to restart my machine more time. However, the issue remained unresolved!!
Could you please find the screenshot as below?
Hi, I am unable to install SQL Server integration services on my machine.While installing visual studio instances are not getting detected. Actually, I tried to restart my machine more time. However, the issue remained unresolved!!Could you please find the screenshot as below? Read More
Outlook with Exchange 2019 CU13 & ModernAuthentication
Greetings everyone,
I am currently trying to get ModernAuth running in conjunction with Exchange 2019. I used these instructions for this:
I am currently failing at the Outlook point. The client opens, the setup of the mail address starts, the ADFS login window opens, user data is entered correctly and after a short time I end up back in the setup and the game starts again.
Eventlog:
Name of the faulty application: OUTLOOK.EXE, version: 16.0.17830.20138, timestamp: 0x66aaad8c
Name of the faulty module: mso20win32client.dll, version: 0.0.0.0, timestamp: 0x668f31af
Exception code: 0x01483052
Fehleroffset: 0x000000000031782d
ID of the faulty process: 0x0x16CC
Start time of the faulty application: 0x0x1DAF3BB250FB675
Path of the faulty application: C:Program FilesMicrosoft OfficerootOffice16OUTLOOK.EXE
Path of the faulty module: C:Program FilesCommon FilesMicrosoft SharedOffice16mso20win32client.dll
Berichtskennung: 6232fab8-77a5-441c-a204-b9db6bebfe1e
Full name of the faulty package:
Application ID that is relative to the bad package:
ADFS trace:
An OAuth authorization code: ‘q5q4BILC3AgCAPklqlJhAv28gd0’ was successfully sent to Client: ‘d3590ed6-52b3-4102-aeff-aad2292ab01c’ with redirectUri: ‘ms-appx-web://Microsoft. AAD.BrokerPlugin/d3590ed6-52b3-4102-aeff-aad2292ab01c’ for resource ‘https://(ExchangeServer).zentrale.etask.de/’. The user is ‘ZENTRALEexchange-test-user
‘ on the device ” if device claims exist. The client IP is ‘192.168.10.53’.
Any ideas?
Greetings everyone,I am currently trying to get ModernAuth running in conjunction with Exchange 2019. I used these instructions for this:https://learn.microsoft.com/en-us/exchange/plan-and-deploy/post-installation-tasks/enable-modern-auth-in-exchange-server-on-premises?view=exchserver-2019I am currently failing at the Outlook point. The client opens, the setup of the mail address starts, the ADFS login window opens, user data is entered correctly and after a short time I end up back in the setup and the game starts again.Eventlog:Name of the faulty application: OUTLOOK.EXE, version: 16.0.17830.20138, timestamp: 0x66aaad8cName of the faulty module: mso20win32client.dll, version: 0.0.0.0, timestamp: 0x668f31afException code: 0x01483052Fehleroffset: 0x000000000031782dID of the faulty process: 0x0x16CCStart time of the faulty application: 0x0x1DAF3BB250FB675Path of the faulty application: C:Program FilesMicrosoft OfficerootOffice16OUTLOOK.EXEPath of the faulty module: C:Program FilesCommon FilesMicrosoft SharedOffice16mso20win32client.dllBerichtskennung: 6232fab8-77a5-441c-a204-b9db6bebfe1eFull name of the faulty package:Application ID that is relative to the bad package: ADFS trace:An OAuth authorization code: ‘q5q4BILC3AgCAPklqlJhAv28gd0’ was successfully sent to Client: ‘d3590ed6-52b3-4102-aeff-aad2292ab01c’ with redirectUri: ‘ms-appx-web://Microsoft. AAD.BrokerPlugin/d3590ed6-52b3-4102-aeff-aad2292ab01c’ for resource ‘https://(ExchangeServer).zentrale.etask.de/’. The user is ‘ZENTRALEexchange-test-user’ on the device ” if device claims exist. The client IP is ‘192.168.10.53’.Any ideas? Read More
“today” keyword inside Query Template in Modern search result web part is not respecting the site
I have a SharePoint Online site collection with these regional settings (Pacific Time): –
And I am using this Search Query Template inside PnP search result web part to get the items which have their RefinableDate01 =today , as follow:-
{searchTerms} ContentType:“Carrier”
RefinableDate01=today
where the RefinableDate01 is linked to a SharePoint Date/Time field named “PU-ETA”. now i am facing this problem:-
1- Currently the time is 03:40 am Pacific Time + 10:40 am UTC.
2- I added a list item and i defined the PU-ETA Date/Time as “8/21/2024 10:00 pm “:-
3- This will be stored inside SharePoint using UTC which will be “2024-08-22T05:00:00Z”.
So when i do a search using this Query Template: –
{searchTerms} ContentType:“Carrier”
RefinableDate01=today
I will get the above item, although based on the site time zone which the user follow this item is not for today 22 August (based on their timezone) it is for yesterday 21 August.. so how i can fix this? so i can do the check for today based on the site settings timezone? and not based on UTC? So when the user specifies the Date/Time for PU-ETA as “8/21/2024 10 pm” this item should be shown inside the Today report on 21 August Pacific Time …
Thanks
I have a SharePoint Online site collection with these regional settings (Pacific Time): – And I am using this Search Query Template inside PnP search result web part to get the items which have their RefinableDate01 =today , as follow:-{searchTerms} ContentType:”Carrier”
RefinableDate01=todaywhere the RefinableDate01 is linked to a SharePoint Date/Time field named “PU-ETA”. now i am facing this problem:-1- Currently the time is 03:40 am Pacific Time + 10:40 am UTC.2- I added a list item and i defined the PU-ETA Date/Time as “8/21/2024 10:00 pm “:- 3- This will be stored inside SharePoint using UTC which will be “2024-08-22T05:00:00Z”.So when i do a search using this Query Template: -{searchTerms} ContentType:”Carrier”
RefinableDate01=todayI will get the above item, although based on the site time zone which the user follow this item is not for today 22 August (based on their timezone) it is for yesterday 21 August.. so how i can fix this? so i can do the check for today based on the site settings timezone? and not based on UTC? So when the user specifies the Date/Time for PU-ETA as “8/21/2024 10 pm” this item should be shown inside the Today report on 21 August Pacific Time … Thanks Read More
Cant build model for arduino via Simulink
I’ve recently installed the "Simulink Support Package for Arduino Hardware", and tried to do the "getting started" basic model with the led blinking.
But when i try to deploy the model on my board, i get this error :
=== Build (Elapsed: 4 sec) ===
### Starting build procedure for: first_step
### Generating code and artifacts to ‘Model specific’ folder structure
### Generating code into build folder: C:Users33687Desktop1-ESTACAMatlab_testfirst_step_ert_rtw
### Invoking Target Language Compiler on first_step.rtw
### Using System Target File: C:Program FilesMATLABR2020brtwcertert.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
### Writing header file first_step_types.h
### Writing header file first_step.h
### Writing header file first_step_private.h
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing source file first_step.c
.
### Writing header file rtmodel.h
### Writing source file first_step_data.c
### Writing source file ert_main.c
Error: File: C:Program FilesMATLABR2020brtwctlclibutillib.tlc Line: 4412 Column: 19
Unable to open output file C:Users33687Desktop1-ESTACAMatlab_testfirst_step_ert_rtwmodelsources.txt [ofstream::open operation failed]
Main program:
==> [00] C:Program FilesMATLABR2020brtwctlclibutillib.tlc:SLibCreateBuildSourcesTxtFile(4412)
[01] C:Program FilesMATLABR2020brtwctlcmwformatwide.tlc:<NONE>(595)
### TLC code generation complete.
### Build procedure for first_step aborted due to an error.
Top model targets built:
Model Action Rebuild Reason
======================================================================
first_step Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 4.267s
Error:Error: Errors occurred – aborting
If anyone got the same problem and resolved it i’ll be really grateful !I’ve recently installed the "Simulink Support Package for Arduino Hardware", and tried to do the "getting started" basic model with the led blinking.
But when i try to deploy the model on my board, i get this error :
=== Build (Elapsed: 4 sec) ===
### Starting build procedure for: first_step
### Generating code and artifacts to ‘Model specific’ folder structure
### Generating code into build folder: C:Users33687Desktop1-ESTACAMatlab_testfirst_step_ert_rtw
### Invoking Target Language Compiler on first_step.rtw
### Using System Target File: C:Program FilesMATLABR2020brtwcertert.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
### Writing header file first_step_types.h
### Writing header file first_step.h
### Writing header file first_step_private.h
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing source file first_step.c
.
### Writing header file rtmodel.h
### Writing source file first_step_data.c
### Writing source file ert_main.c
Error: File: C:Program FilesMATLABR2020brtwctlclibutillib.tlc Line: 4412 Column: 19
Unable to open output file C:Users33687Desktop1-ESTACAMatlab_testfirst_step_ert_rtwmodelsources.txt [ofstream::open operation failed]
Main program:
==> [00] C:Program FilesMATLABR2020brtwctlclibutillib.tlc:SLibCreateBuildSourcesTxtFile(4412)
[01] C:Program FilesMATLABR2020brtwctlcmwformatwide.tlc:<NONE>(595)
### TLC code generation complete.
### Build procedure for first_step aborted due to an error.
Top model targets built:
Model Action Rebuild Reason
======================================================================
first_step Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 4.267s
Error:Error: Errors occurred – aborting
If anyone got the same problem and resolved it i’ll be really grateful ! I’ve recently installed the "Simulink Support Package for Arduino Hardware", and tried to do the "getting started" basic model with the led blinking.
But when i try to deploy the model on my board, i get this error :
=== Build (Elapsed: 4 sec) ===
### Starting build procedure for: first_step
### Generating code and artifacts to ‘Model specific’ folder structure
### Generating code into build folder: C:Users33687Desktop1-ESTACAMatlab_testfirst_step_ert_rtw
### Invoking Target Language Compiler on first_step.rtw
### Using System Target File: C:Program FilesMATLABR2020brtwcertert.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
### Writing header file first_step_types.h
### Writing header file first_step.h
### Writing header file first_step_private.h
### Writing header file rtwtypes.h
### Writing header file multiword_types.h
### Writing source file first_step.c
.
### Writing header file rtmodel.h
### Writing source file first_step_data.c
### Writing source file ert_main.c
Error: File: C:Program FilesMATLABR2020brtwctlclibutillib.tlc Line: 4412 Column: 19
Unable to open output file C:Users33687Desktop1-ESTACAMatlab_testfirst_step_ert_rtwmodelsources.txt [ofstream::open operation failed]
Main program:
==> [00] C:Program FilesMATLABR2020brtwctlclibutillib.tlc:SLibCreateBuildSourcesTxtFile(4412)
[01] C:Program FilesMATLABR2020brtwctlcmwformatwide.tlc:<NONE>(595)
### TLC code generation complete.
### Build procedure for first_step aborted due to an error.
Top model targets built:
Model Action Rebuild Reason
======================================================================
first_step Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 4.267s
Error:Error: Errors occurred – aborting
If anyone got the same problem and resolved it i’ll be really grateful ! arduino, model, error MATLAB Answers — New Questions
time delay in simulink to be used with c code generation
I am trying to interface a STM32F411RE board with a 4 digital seven segment display via simulink and embedded coder support. To do so i need to introduce various time delays for example: the clock pin goes high and then after 2 micro-seconds it goes low etc. but i an unable to model such time delay. I have tried introducing a for loop that does nothing but the code generator optimizes the code and omits the for loop as it is not providing any fruitful output. is there any way that i can turn this optimization off so that it keeps the for loop? I have tried another way where i introduce a dummy variable inside for loop but the c code generator changes the order of the commands and moves the for loop in the start and not where i want the delay to be. please let me know if anyone has dealt with a similar problem? memory block/delay block also doesn’t work.
Thank you!!I am trying to interface a STM32F411RE board with a 4 digital seven segment display via simulink and embedded coder support. To do so i need to introduce various time delays for example: the clock pin goes high and then after 2 micro-seconds it goes low etc. but i an unable to model such time delay. I have tried introducing a for loop that does nothing but the code generator optimizes the code and omits the for loop as it is not providing any fruitful output. is there any way that i can turn this optimization off so that it keeps the for loop? I have tried another way where i introduce a dummy variable inside for loop but the c code generator changes the order of the commands and moves the for loop in the start and not where i want the delay to be. please let me know if anyone has dealt with a similar problem? memory block/delay block also doesn’t work.
Thank you!! I am trying to interface a STM32F411RE board with a 4 digital seven segment display via simulink and embedded coder support. To do so i need to introduce various time delays for example: the clock pin goes high and then after 2 micro-seconds it goes low etc. but i an unable to model such time delay. I have tried introducing a for loop that does nothing but the code generator optimizes the code and omits the for loop as it is not providing any fruitful output. is there any way that i can turn this optimization off so that it keeps the for loop? I have tried another way where i introduce a dummy variable inside for loop but the c code generator changes the order of the commands and moves the for loop in the start and not where i want the delay to be. please let me know if anyone has dealt with a similar problem? memory block/delay block also doesn’t work.
Thank you!! c code generation, time delay, matlab, simulink MATLAB Answers — New Questions
I have matlab code, when i run the program i could ‘t get the values and also graph.Can u help me in this regards?
Here, i have attached my program.Here, i have attached my program. Here, i have attached my program. help me to remove error. MATLAB Answers — New Questions