Month: June 2024
How do I get LDAP user information for logged in user into my MATLAB WebApp?
I have a WebApp server (Windows, R2022a) running a couple of apps, and it is behind LDAP authentication. When a user logs in, I can see that the user information is stored somewhere within the server because the correct username appears in the upper right corner of the main MATLAB WebApp server screen. What I would like to do is access that information inside my app. Is there a MATLAB command within the app that can access the logged in user? I tried:
user = compiler.UserInfo()
but all the fields were empty.
Thank you!
-GregI have a WebApp server (Windows, R2022a) running a couple of apps, and it is behind LDAP authentication. When a user logs in, I can see that the user information is stored somewhere within the server because the correct username appears in the upper right corner of the main MATLAB WebApp server screen. What I would like to do is access that information inside my app. Is there a MATLAB command within the app that can access the logged in user? I tried:
user = compiler.UserInfo()
but all the fields were empty.
Thank you!
-Greg I have a WebApp server (Windows, R2022a) running a couple of apps, and it is behind LDAP authentication. When a user logs in, I can see that the user information is stored somewhere within the server because the correct username appears in the upper right corner of the main MATLAB WebApp server screen. What I would like to do is access that information inside my app. Is there a MATLAB command within the app that can access the logged in user? I tried:
user = compiler.UserInfo()
but all the fields were empty.
Thank you!
-Greg ldap, webapp server MATLAB Answers — New Questions
Does Matlab support system objects for X410 USRP?
Does Matlab R2024a support system objects such as comm.SDRuTransmitter or comm.SDRuReceiver with the X410 USRP when using Wireless TestBench? If not, is this something that will be available in future updates?Does Matlab R2024a support system objects such as comm.SDRuTransmitter or comm.SDRuReceiver with the X410 USRP when using Wireless TestBench? If not, is this something that will be available in future updates? Does Matlab R2024a support system objects such as comm.SDRuTransmitter or comm.SDRuReceiver with the X410 USRP when using Wireless TestBench? If not, is this something that will be available in future updates? usrp, matlab, sdr MATLAB Answers — New Questions
UIFigure appearance (scaling) change between 2023b and 2024a
I wrote an app in 2023b, but after installing 2024a the figure doesn’t appear the same, and some of my UI controls actually fall off the figure in 2024a. Below is a simplified example of the issue.
Here is the code I ran in both versions:
fig = uifigure(Name="This is in 2023b");
% fig = uifigure(Name="This is in 2024a");
lbl = uilabel(fig);
lbl.Text = "This is a label";
lbl.Position = [20 200 100 60];
Here is a screenshot of the outputs side-by-side:
As you can see the font and the spacing in 2024a is slightly larger, as if it is scaled differently. And it’s not just with UILables, the size and spacing is larger for all objects in 2024a compared to 2023b.
I reset all default groot settings with reset(groot, "default")
I recursivly cleared all personal settings with [setting].clearPersonalValue
But I still get this result.
It’s a fairly large and complex app with a lot of ui controls and I don’t want to rewrite it because if this.
Is there a setting somewhere I’m overlooking, or something else I’m missing?I wrote an app in 2023b, but after installing 2024a the figure doesn’t appear the same, and some of my UI controls actually fall off the figure in 2024a. Below is a simplified example of the issue.
Here is the code I ran in both versions:
fig = uifigure(Name="This is in 2023b");
% fig = uifigure(Name="This is in 2024a");
lbl = uilabel(fig);
lbl.Text = "This is a label";
lbl.Position = [20 200 100 60];
Here is a screenshot of the outputs side-by-side:
As you can see the font and the spacing in 2024a is slightly larger, as if it is scaled differently. And it’s not just with UILables, the size and spacing is larger for all objects in 2024a compared to 2023b.
I reset all default groot settings with reset(groot, "default")
I recursivly cleared all personal settings with [setting].clearPersonalValue
But I still get this result.
It’s a fairly large and complex app with a lot of ui controls and I don’t want to rewrite it because if this.
Is there a setting somewhere I’m overlooking, or something else I’m missing? I wrote an app in 2023b, but after installing 2024a the figure doesn’t appear the same, and some of my UI controls actually fall off the figure in 2024a. Below is a simplified example of the issue.
Here is the code I ran in both versions:
fig = uifigure(Name="This is in 2023b");
% fig = uifigure(Name="This is in 2024a");
lbl = uilabel(fig);
lbl.Text = "This is a label";
lbl.Position = [20 200 100 60];
Here is a screenshot of the outputs side-by-side:
As you can see the font and the spacing in 2024a is slightly larger, as if it is scaled differently. And it’s not just with UILables, the size and spacing is larger for all objects in 2024a compared to 2023b.
I reset all default groot settings with reset(groot, "default")
I recursivly cleared all personal settings with [setting].clearPersonalValue
But I still get this result.
It’s a fairly large and complex app with a lot of ui controls and I don’t want to rewrite it because if this.
Is there a setting somewhere I’m overlooking, or something else I’m missing? uifigure, settings, groot, uifigure font, uifigure scaling MATLAB Answers — New Questions
How to save the values of data tips of a plot
What function to use to save the data tip values of a plot to some variables in my app designerWhat function to use to save the data tip values of a plot to some variables in my app designer What function to use to save the data tip values of a plot to some variables in my app designer datatips MATLAB Answers — New Questions
Error code 404 : When Overwriting a Sharepoint column that contains space before ‘/’ in it’s name
I have created a SharePoint List with column name that contains space before ‘/’. Ex: “ABC /DEF”
When I am trying to overwrite the same column it fails with Error . Response code: 404.
So does it have anything to do with column name? Are there any guidelines on creating column name with special characters (including space, ‘/’) in sharepoint list?
I have created a SharePoint List with column name that contains space before ‘/’. Ex: “ABC /DEF”When I am trying to overwrite the same column it fails with Error . Response code: 404. So does it have anything to do with column name? Are there any guidelines on creating column name with special characters (including space, ‘/’) in sharepoint list? Read More
Set default font in Office Outlook app and OWA
For our organisation we want to set our default font to Ubuntu, size 11, with color code #215e99. Is there any (easy) way how to do this? We are using Office365 and we manage all our devices within the Microsoft Endpoint Manager. It seems there is no specific policy available to configure this.
For our organisation we want to set our default font to Ubuntu, size 11, with color code #215e99. Is there any (easy) way how to do this? We are using Office365 and we manage all our devices within the Microsoft Endpoint Manager. It seems there is no specific policy available to configure this. Read More
Trouble removing CALC Error
This is the Formula i’m using, however when the formula doesnt return a result I get the #Calc error.
=LET( filtered, FILTER( F2:F9000, ISNUMBER(XMATCH(G2:G9000, H2:H3, )) ), UNIQUE(filtered))
I’ve tried inserting “No Event” into the formula but either I’m not putting it into the string correctly or I need to do something else.
This is the Formula i’m using, however when the formula doesnt return a result I get the #Calc error. =LET( filtered, FILTER( F2:F9000, ISNUMBER(XMATCH(G2:G9000, H2:H3, )) ), UNIQUE(filtered)) I’ve tried inserting “No Event” into the formula but either I’m not putting it into the string correctly or I need to do something else. Read More
Prevent SQL Injection attacks on your PostgreSQL servers
SQL injections are one of the most common and popular application attack vectors used with the goal of retrieving sensitive data from companies. When you hear about stolen financial information, defaced web sites or even systems takeover, they often happen through complex hacking attempt, which in many cases starts with common SQL injection vulnerabilities being exploited. Fortunately, you can follow some very easy techniques to prevent SQL injection affecting your system with PostgreSQL backend.
What is SQL Injection?
SQL injection (SQLi) is a common cybersecurity exploit that targets commercial and open-source relational databases using specifically crafted SQL statements to trick the systems into doing unexpected and undesired things. SQL injection attacks allow penetrators to spoof identity, tamper with existing data stored in databases, cause repudiation issues such as voiding transactions or changing balances and ultimately quite often to become administrators of the database server. SQL Injection is more common with older web development platforms, such as PHP, ASP, JSP, CGI due to the prevalence of older data access interfaces, but can occur with newer platforms as well, when not taking advantage of available methods to reduce this vulnerability.
Pic 1. Typical SQL Injection diagram courtesy of Cloudflare
Within the last 20 years, many SQL injection attacks have targeted large websites, businesses, and social media marketing platforms. Many of these attacks resulted in serious data breaches. A couple of notable examples are listed below:
7-Eleven breach. a group of attackers used SQL injection to penetrate corporate systems at several companies, primarily the 7-Eleven retail chain, stealing 130 million charge card numbers.
Ghost Shell attack. Hackers from APT group Team GhostShell targeted 53 universities using the SQL injection and stole and published 36,000 personal records owned by students, faculty, and staff.
Freepik breach. In 2020, Freepik, one of the largest online graphic resources sites in the world with 18 million monthly unique users, says that hackers were able to steal emails and password hashes for 8.3M Freepik and Flaticon users in an SQL injection attack against the company’s Flaticon website.
Types of SQL Injection attack
SQL Injection (SQLi) is commonly classified to several types:
Union-based SQL Injection– Union-based SQL Injection represents the most popular type of SQL injection and uses the UNION operator in SQL. The UNION operator is used to combine the result-set of two or more SELECT statements to retrieve data from the database.
Error Based SQL Injection– this method is usually deployed against Microsoft SQL Server databases. In this attack, the malicious actor causes an application to display an error. originating from database. It manipulates the database into generating an error that informs the malicious actor of the database’s structure.
Blind SQL Injection – in this attack, no error messages are received from the database; We extract the data by submitting queries to the database. Blind SQL injections can be divided into Boolean-based SQL Injection and time-based SQL Injection.
Example of SQL Injection
This example shows how an attacker can use SQL injection to circumvent an application’s SQL Based authentication and gain administrator privileges.
Consider a simple authentication system using a database table with usernames and passwords. A user’s POST request will provide the variables user and password, and these are inserted into a SQL statement:
sql = “SELECT id FROM users WHERE username='” + user + “‘ AND password='” + password + “‘”
The problem here is that the SQL statement uses string concatenation to combine data. The attacker can provide a string like this instead of the password string variable:
password’ OR 5=5
Finally, we have a resulting SQL query that will be run against the database:
SELECT id FROM users WHERE username=’user’ AND password=’pass’ OR 1=1′
Because 1=1 is a condition that always evaluates to true, the entire WHERE statement will be true, regardless of the username or password provided. Moreover, WHERE statement will return the first ID from the users table, which is commonly the administrator. This means the attacker can access the application without authentication, and also has administrator privileges.
Preventing SQL Injection attacks
There are number of methods for reducing the risk of SQL injection. As a best practice, several strategies should be utilized. Let’s look at most popular implementations:
Using Parameterized Queries.
At its core, this method separates SQL logic from the data being passed. Using placeholders instead of directly embedding user input into queries, the database strictly recognizes the input as data. This means that even if an attacker tries to insert malicious code, the database won’t execute it as a command. As a developer, adopting parameterized queries is not just a best practice; it’s a fundamental shift in how user input is processed, ensuring a higher level of security.
Escape All User Supplied Input. When writing SQL, specific characters or words have particular meaning. For example, the ‘*’ character means “any” and the words “OR” is a conditional. To circumvent users who enter these characters either accidentally or more likely maliciously into an API request to the database, user supplied input can be escaped. Escaping a character is the way of telling the database not to parse it as a command or conditional but instead treat it as literal input, aka string.
Enforce Least Privilege. As a general rule, in all instances where a website needs to use dynamic SQL, it is important to reduce the exposure to SQL injection by limiting permissions of your application loginuser to the most marrow scope required to execute the relevant query. This means that an administrative account should never be application loginuser and executing SQL commands as a result of the API call from an unauthorized request. Enforcing least privilege can help reduce the risks of dynamic SQL queries.
Resources
For more information on SQL injection, as well as security best practices with Postgres Flexible Server see following:
Security – Azure Database for PostgreSQL – Flexible Server | Microsoft Learn
SQl Injection: example of SQL Injections and Recommendations to avoid it. – Microsoft Community Hub
Postgres SQL Injection Cheat Sheet | pentestmonkey
Investigation: A Pentesting PostgreSQL with SQL Injections (onsecurity.io)
To learn more about our Flexible Server managed service, see the Azure Database for PostgreSQL service page. We’re always eager to hear customer feedback, so please reach out to us at Ask Azure DB for PostgreSQL.
Microsoft Tech Community – Latest Blogs –Read More
Boxfusion and Skypoint offer transactable partner solutions in Azure Marketplace
Microsoft partners like Boxfusion and Skypoint deliver transact-capable offers, which allow you to purchase directly from Azure Marketplace. Learn about these offers below:
Botsa: Botsa works with Microsoft Teams to provide a simple, familiar, and user-friendly interface for your employees to improve internal communications and processes. By handling routine queries, Botsa frees up your staff to focus on more complex tasks, increasing overall productivity and transforming your workplace experience. Reduce operational costs by automating common queries and processes.
Skypoint AI Platform for Senior Living: Skypoint’s AI platform unifies and leverages common senior living data sources so you can safely and securely “chat with your data” for instant answers and drive senior living experiences in more meaningful ways. It allows you to deliver better care, services, and experiences while optimizing operational expenses, leading to improved overall outcomes.
Microsoft Tech Community – Latest Blogs –Read More
Multivariate Newthon’s Method
Dear All,
I am trying to solve a multivariate function by using the Newthon’s Method. However, I get an error message in the lwhen I run my code (exactly in newtons_method file), and I could not figure out what is going on. Here is the files that I am using:
%This file is the one that appears here: Multivariate Newton’s Method (newtons_method_n)
function [x,k,x_all] = newtons_method_n(f,J,x0,opts)
if (nargin < 4) || isempty(opts) || ~isfield(opts,’k_max’)
k_max = 200;
else
k_max = opts.k_max;
end
if (nargin < 4) || isempty(opts) || ~isfield(opts,’return_all’)
return_all = false;
else
return_all = opts.return_all;
end
if (nargin < 4) || isempty(opts) || ~isfield(opts,’TOL’)
TOL = 1e-10;
else
TOL = opts.TOL;
end
n = length(x0);
if f(x0) == zeros(n,1)
x = x0;
return
end
x_curr = x0;
x_next = zeros(n,1);
if return_all
x_all = zeros(n,k_max+1);
end
for k = 1:k_max
if return_all
x_all(:,k) = x_curr;
end
y = J(x_curr)(-f(x_curr));
x_next = x_curr+y;
if (norm(y) < TOL)
break;
end
x_curr = x_next;
end
x = x_next;
if return_all
x_all(:,k+1) = x;
x_all = x_all(:,1:(k+1));
end
end
This is the main.n file:
clear all
clc
% Global variables are only parameters which do not change
global a b theta t d n L Y g
load DATA
n = 19; % Number of countries
a = 0.134813590592666;
b = 0.21221;
theta = 8.28; % Shape of Pareto dist
relaw = aw./aw(n,1); % Relative wage to US
t = exp( b*(S+theta*(log(relaw))) ); % Technology: see Table VI
d = D; % Geographic barriers dni^(-theta)
L = l; % Labor
Y = y; % Income
elast = 0.1; % Elasticity of wage adjustment
% Gamma constant (as in the original code)
g = (b^(-b))*((1-b)^(-(1-b)));
g = g^(theta);
disp(‘Newton iterative procedure starts here’)
w = aw; % Set initial wages at data
% Set bounds (implied by the model) for prices
pbounds = bounds(w);
p0 = 0.5*(pbounds(:,1)+pbounds(:,2)); % Half way between min and max
[pval,fval] = newtons_method(@(p) prices(p,w),p0);
And finally the prices.m file:
function [fval,fjac] = prices(p,w)
global b theta t d n g
aux1 = g*t.*(w.^(-theta*b));
aux2 = repmat(aux1,1,n)’;
G = d.*aux2;
fval = Gp -p.^(1-b);
fjac = inv(G) – (1-b)*diag(p.^(-b));
With all this on hand, any idea about why is there an error?
Thank you in advanced!Dear All,
I am trying to solve a multivariate function by using the Newthon’s Method. However, I get an error message in the lwhen I run my code (exactly in newtons_method file), and I could not figure out what is going on. Here is the files that I am using:
%This file is the one that appears here: Multivariate Newton’s Method (newtons_method_n)
function [x,k,x_all] = newtons_method_n(f,J,x0,opts)
if (nargin < 4) || isempty(opts) || ~isfield(opts,’k_max’)
k_max = 200;
else
k_max = opts.k_max;
end
if (nargin < 4) || isempty(opts) || ~isfield(opts,’return_all’)
return_all = false;
else
return_all = opts.return_all;
end
if (nargin < 4) || isempty(opts) || ~isfield(opts,’TOL’)
TOL = 1e-10;
else
TOL = opts.TOL;
end
n = length(x0);
if f(x0) == zeros(n,1)
x = x0;
return
end
x_curr = x0;
x_next = zeros(n,1);
if return_all
x_all = zeros(n,k_max+1);
end
for k = 1:k_max
if return_all
x_all(:,k) = x_curr;
end
y = J(x_curr)(-f(x_curr));
x_next = x_curr+y;
if (norm(y) < TOL)
break;
end
x_curr = x_next;
end
x = x_next;
if return_all
x_all(:,k+1) = x;
x_all = x_all(:,1:(k+1));
end
end
This is the main.n file:
clear all
clc
% Global variables are only parameters which do not change
global a b theta t d n L Y g
load DATA
n = 19; % Number of countries
a = 0.134813590592666;
b = 0.21221;
theta = 8.28; % Shape of Pareto dist
relaw = aw./aw(n,1); % Relative wage to US
t = exp( b*(S+theta*(log(relaw))) ); % Technology: see Table VI
d = D; % Geographic barriers dni^(-theta)
L = l; % Labor
Y = y; % Income
elast = 0.1; % Elasticity of wage adjustment
% Gamma constant (as in the original code)
g = (b^(-b))*((1-b)^(-(1-b)));
g = g^(theta);
disp(‘Newton iterative procedure starts here’)
w = aw; % Set initial wages at data
% Set bounds (implied by the model) for prices
pbounds = bounds(w);
p0 = 0.5*(pbounds(:,1)+pbounds(:,2)); % Half way between min and max
[pval,fval] = newtons_method(@(p) prices(p,w),p0);
And finally the prices.m file:
function [fval,fjac] = prices(p,w)
global b theta t d n g
aux1 = g*t.*(w.^(-theta*b));
aux2 = repmat(aux1,1,n)’;
G = d.*aux2;
fval = Gp -p.^(1-b);
fjac = inv(G) – (1-b)*diag(p.^(-b));
With all this on hand, any idea about why is there an error?
Thank you in advanced! Dear All,
I am trying to solve a multivariate function by using the Newthon’s Method. However, I get an error message in the lwhen I run my code (exactly in newtons_method file), and I could not figure out what is going on. Here is the files that I am using:
%This file is the one that appears here: Multivariate Newton’s Method (newtons_method_n)
function [x,k,x_all] = newtons_method_n(f,J,x0,opts)
if (nargin < 4) || isempty(opts) || ~isfield(opts,’k_max’)
k_max = 200;
else
k_max = opts.k_max;
end
if (nargin < 4) || isempty(opts) || ~isfield(opts,’return_all’)
return_all = false;
else
return_all = opts.return_all;
end
if (nargin < 4) || isempty(opts) || ~isfield(opts,’TOL’)
TOL = 1e-10;
else
TOL = opts.TOL;
end
n = length(x0);
if f(x0) == zeros(n,1)
x = x0;
return
end
x_curr = x0;
x_next = zeros(n,1);
if return_all
x_all = zeros(n,k_max+1);
end
for k = 1:k_max
if return_all
x_all(:,k) = x_curr;
end
y = J(x_curr)(-f(x_curr));
x_next = x_curr+y;
if (norm(y) < TOL)
break;
end
x_curr = x_next;
end
x = x_next;
if return_all
x_all(:,k+1) = x;
x_all = x_all(:,1:(k+1));
end
end
This is the main.n file:
clear all
clc
% Global variables are only parameters which do not change
global a b theta t d n L Y g
load DATA
n = 19; % Number of countries
a = 0.134813590592666;
b = 0.21221;
theta = 8.28; % Shape of Pareto dist
relaw = aw./aw(n,1); % Relative wage to US
t = exp( b*(S+theta*(log(relaw))) ); % Technology: see Table VI
d = D; % Geographic barriers dni^(-theta)
L = l; % Labor
Y = y; % Income
elast = 0.1; % Elasticity of wage adjustment
% Gamma constant (as in the original code)
g = (b^(-b))*((1-b)^(-(1-b)));
g = g^(theta);
disp(‘Newton iterative procedure starts here’)
w = aw; % Set initial wages at data
% Set bounds (implied by the model) for prices
pbounds = bounds(w);
p0 = 0.5*(pbounds(:,1)+pbounds(:,2)); % Half way between min and max
[pval,fval] = newtons_method(@(p) prices(p,w),p0);
And finally the prices.m file:
function [fval,fjac] = prices(p,w)
global b theta t d n g
aux1 = g*t.*(w.^(-theta*b));
aux2 = repmat(aux1,1,n)’;
G = d.*aux2;
fval = Gp -p.^(1-b);
fjac = inv(G) – (1-b)*diag(p.^(-b));
With all this on hand, any idea about why is there an error?
Thank you in advanced! optimization, functions MATLAB Answers — New Questions
How do I mesh a matlab model
I am trying to mesh a geometry. The geometry was modelled on matlab. Most meshing examples on matlab involve importing of the geometry. How do I mesh a model that was made in matlab. The model code as well as the mesh code has been given below.
rect1=[3
4
-530
530
530
-530
0
0
-530
-530];
C1=[1
0
0
228.6];
C2=[1
0
0
520.5];
C1 = [C1;zeros(length(rect1) – length(C1),1)];
C2 = [C2;zeros(length(rect1) – length(C2),1)];
gd = [C1,C2,rect1];
ns = (char(‘C1′,’C2′,’rect1’));
ns = ns’;
sf='(C2)-(C1+rect1)’;
dl = decsg(gd,sf,ns);
model = createpde("thermal","transient");
ge = geometryFromEdges(model,dl);
% 2D -> 3D extrusion
gd1 = extrude(ge,96);
figure
pdegplot(gd1,"FaceLabels","on")
model = femodel(Geometry="gd1");
model = generateMesh(model,Hmax=5,Hmin=1);
pdemesh(model)I am trying to mesh a geometry. The geometry was modelled on matlab. Most meshing examples on matlab involve importing of the geometry. How do I mesh a model that was made in matlab. The model code as well as the mesh code has been given below.
rect1=[3
4
-530
530
530
-530
0
0
-530
-530];
C1=[1
0
0
228.6];
C2=[1
0
0
520.5];
C1 = [C1;zeros(length(rect1) – length(C1),1)];
C2 = [C2;zeros(length(rect1) – length(C2),1)];
gd = [C1,C2,rect1];
ns = (char(‘C1′,’C2′,’rect1’));
ns = ns’;
sf='(C2)-(C1+rect1)’;
dl = decsg(gd,sf,ns);
model = createpde("thermal","transient");
ge = geometryFromEdges(model,dl);
% 2D -> 3D extrusion
gd1 = extrude(ge,96);
figure
pdegplot(gd1,"FaceLabels","on")
model = femodel(Geometry="gd1");
model = generateMesh(model,Hmax=5,Hmin=1);
pdemesh(model) I am trying to mesh a geometry. The geometry was modelled on matlab. Most meshing examples on matlab involve importing of the geometry. How do I mesh a model that was made in matlab. The model code as well as the mesh code has been given below.
rect1=[3
4
-530
530
530
-530
0
0
-530
-530];
C1=[1
0
0
228.6];
C2=[1
0
0
520.5];
C1 = [C1;zeros(length(rect1) – length(C1),1)];
C2 = [C2;zeros(length(rect1) – length(C2),1)];
gd = [C1,C2,rect1];
ns = (char(‘C1′,’C2′,’rect1’));
ns = ns’;
sf='(C2)-(C1+rect1)’;
dl = decsg(gd,sf,ns);
model = createpde("thermal","transient");
ge = geometryFromEdges(model,dl);
% 2D -> 3D extrusion
gd1 = extrude(ge,96);
figure
pdegplot(gd1,"FaceLabels","on")
model = femodel(Geometry="gd1");
model = generateMesh(model,Hmax=5,Hmin=1);
pdemesh(model) mesh MATLAB Answers — New Questions
Collision over-simplification in RST
Hello,
I am working with MATLAB to visualize the collision meshes of a robot I’ve designed. When using the show(robot) function, I notice that the collision meshes appear less detailed, I guess, the idea is to optimize execution time and reduce CPU load.
Could you please provide information on the maximum number of triangles allowed per STL file for collision meshes? I aim to achieve a balance between having detailed collision meshes and maintaining computational efficiency.
How it’s supposed to look like :
meshTri = stlread("concept_c-bras5_col.stl");
trisurf(meshTri)
axis equal
How it actually looks like :
rbt = importrobot("concept.urdf");
show(rbt,Collisions="on");
As you can see it’s really ugly. Do you know how to improve the collision meshes make them more accurate ?Hello,
I am working with MATLAB to visualize the collision meshes of a robot I’ve designed. When using the show(robot) function, I notice that the collision meshes appear less detailed, I guess, the idea is to optimize execution time and reduce CPU load.
Could you please provide information on the maximum number of triangles allowed per STL file for collision meshes? I aim to achieve a balance between having detailed collision meshes and maintaining computational efficiency.
How it’s supposed to look like :
meshTri = stlread("concept_c-bras5_col.stl");
trisurf(meshTri)
axis equal
How it actually looks like :
rbt = importrobot("concept.urdf");
show(rbt,Collisions="on");
As you can see it’s really ugly. Do you know how to improve the collision meshes make them more accurate ? Hello,
I am working with MATLAB to visualize the collision meshes of a robot I’ve designed. When using the show(robot) function, I notice that the collision meshes appear less detailed, I guess, the idea is to optimize execution time and reduce CPU load.
Could you please provide information on the maximum number of triangles allowed per STL file for collision meshes? I aim to achieve a balance between having detailed collision meshes and maintaining computational efficiency.
How it’s supposed to look like :
meshTri = stlread("concept_c-bras5_col.stl");
trisurf(meshTri)
axis equal
How it actually looks like :
rbt = importrobot("concept.urdf");
show(rbt,Collisions="on");
As you can see it’s really ugly. Do you know how to improve the collision meshes make them more accurate ? matlab MATLAB Answers — New Questions
vastly different optimization results from different matlab versions (r2023b,2021b,2020b)
[I just came across the problem and want to put down what I have for now. Will come back to improve the question once I narrow it down. THX]
I was solving a high-dimensional nonlinear optimization problem with self written gradient descent method. Running the exact same code (literally the same file, with no workspace or command window inputs), version 2023b gave me very different results from 2021b. I then compared with 2020b, which produced the same result as 2021b. Comparing the outputs, I found that 2023b calculated the gradient differently.
2020b and 2021b gave the following and converged after 18 iterations.
direction = [4.33783e-06 2.33596e-06 -5.33992e-06 -8.36479e-06 -9.19797e-05 1 ]
2023b gave the following and didn’t converge after 44 iterations.
direction = [4.17191e-06 2.24661e-06 -5.13617e-06 -7.53861e-06 -5.19154e-05 1 ]
The code is very slow, so I can’t let it run forever and find out when it will converge.
As far as I know, my code doesn’t involve any randomness. It does use a lot of matrices and high-order polynomials, as well as conditions.
I went through the release notes from r2021b onwards, and noticed a change to the round function, which I don’t use explicitly but can affect the conditions I suppose?round function change
There’re also some performance improvements on matrix calculations.[I just came across the problem and want to put down what I have for now. Will come back to improve the question once I narrow it down. THX]
I was solving a high-dimensional nonlinear optimization problem with self written gradient descent method. Running the exact same code (literally the same file, with no workspace or command window inputs), version 2023b gave me very different results from 2021b. I then compared with 2020b, which produced the same result as 2021b. Comparing the outputs, I found that 2023b calculated the gradient differently.
2020b and 2021b gave the following and converged after 18 iterations.
direction = [4.33783e-06 2.33596e-06 -5.33992e-06 -8.36479e-06 -9.19797e-05 1 ]
2023b gave the following and didn’t converge after 44 iterations.
direction = [4.17191e-06 2.24661e-06 -5.13617e-06 -7.53861e-06 -5.19154e-05 1 ]
The code is very slow, so I can’t let it run forever and find out when it will converge.
As far as I know, my code doesn’t involve any randomness. It does use a lot of matrices and high-order polynomials, as well as conditions.
I went through the release notes from r2021b onwards, and noticed a change to the round function, which I don’t use explicitly but can affect the conditions I suppose?round function change
There’re also some performance improvements on matrix calculations. [I just came across the problem and want to put down what I have for now. Will come back to improve the question once I narrow it down. THX]
I was solving a high-dimensional nonlinear optimization problem with self written gradient descent method. Running the exact same code (literally the same file, with no workspace or command window inputs), version 2023b gave me very different results from 2021b. I then compared with 2020b, which produced the same result as 2021b. Comparing the outputs, I found that 2023b calculated the gradient differently.
2020b and 2021b gave the following and converged after 18 iterations.
direction = [4.33783e-06 2.33596e-06 -5.33992e-06 -8.36479e-06 -9.19797e-05 1 ]
2023b gave the following and didn’t converge after 44 iterations.
direction = [4.17191e-06 2.24661e-06 -5.13617e-06 -7.53861e-06 -5.19154e-05 1 ]
The code is very slow, so I can’t let it run forever and find out when it will converge.
As far as I know, my code doesn’t involve any randomness. It does use a lot of matrices and high-order polynomials, as well as conditions.
I went through the release notes from r2021b onwards, and noticed a change to the round function, which I don’t use explicitly but can affect the conditions I suppose?round function change
There’re also some performance improvements on matrix calculations. version changes, different results MATLAB Answers — New Questions
Time Format
hello all,
I had entered a number 6 in a cell and choose the time format.
instead of instead of showing me the time as 6:00 am it gives with the date and time together!
can i know the mistake i made pls.
i am trying to schedule some work in a regular basis using the time. How do i go about to get only 6:30 am or 6:00 pm, etc.
thank u in advance to one and all
hello all,I had entered a number 6 in a cell and choose the time format.instead of instead of showing me the time as 6:00 am it gives with the date and time together! can i know the mistake i made pls. i am trying to schedule some work in a regular basis using the time. How do i go about to get only 6:30 am or 6:00 pm, etc. thank u in advance to one and all Read More
Storage full but only 1% used
I am not an IT high knowledge. Can use programs but don’t always understand how tings work. I have onedrive with 1TB storage. I am wanting to use the account for backup of my files on laptop. When I look at Manage my storage it says 1% in use but when I try to place folders/files onto onedrive it says not enough space. I cannot understand this. I’ve tried emptying the recycling bin but cannot seem to be able to delete anything – either in one go or individual files. Instructions say “Delete in Navigation Bar” but not on my screen! Can anyone help me please?
I am not an IT high knowledge. Can use programs but don’t always understand how tings work. I have onedrive with 1TB storage. I am wanting to use the account for backup of my files on laptop. When I look at Manage my storage it says 1% in use but when I try to place folders/files onto onedrive it says not enough space. I cannot understand this. I’ve tried emptying the recycling bin but cannot seem to be able to delete anything – either in one go or individual files. Instructions say “Delete in Navigation Bar” but not on my screen! Can anyone help me please? Read More
Windows Admin Center 2311 – EntraID Authentication issues
Hello everybody
This problem has already been reported under post: WAC Build 2311 in HA Not Authenticating w/ Entra AD Properly
However, since there has been no feedback from Microsoft for some time, I am reopening the topic.
I am using Windows Admin Center 2311 with EntraID authentication enabled. The redirect URLs are fine, and the ID tokens are used (Hybrid Flow) But I always get the message:
Method not found: ‘Microsoft.IdentityModel.Tokens.SecurityKey Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities.FindKeyMatch(System.String, System.String, Microsoft.IdentityModel.Tokens.SecurityKey, System.Collections.Generic.IEnumerable`1<Microsoft.IdentityModel.Tokens.SecurityKey>)’.
I have also used Azure’s Sign-in Diagnostic, which states that:
“The user sign-in failed due to application configuration issues. The reply URL does not match the reply URLs configured for the application {appName}. Make sure the reply URL sent in the request matches one added to your application in the Azure portal.”
…no matter what I configure. I also double checked the reply URLs. Is there any news about this issue ?
thanks for a feedback, br yves
Hello everybodyThis problem has already been reported under post: WAC Build 2311 in HA Not Authenticating w/ Entra AD ProperlyHowever, since there has been no feedback from Microsoft for some time, I am reopening the topic.I am using Windows Admin Center 2311 with EntraID authentication enabled. The redirect URLs are fine, and the ID tokens are used (Hybrid Flow) But I always get the message:Method not found: ‘Microsoft.IdentityModel.Tokens.SecurityKey Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities.FindKeyMatch(System.String, System.String, Microsoft.IdentityModel.Tokens.SecurityKey, System.Collections.Generic.IEnumerable`1<Microsoft.IdentityModel.Tokens.SecurityKey>)’.I have also used Azure’s Sign-in Diagnostic, which states that:”The user sign-in failed due to application configuration issues. The reply URL does not match the reply URLs configured for the application {appName}. Make sure the reply URL sent in the request matches one added to your application in the Azure portal.”…no matter what I configure. I also double checked the reply URLs. Is there any news about this issue ?thanks for a feedback, br yves Read More
Availability of Microsoft Teams Room features Voice, Face Recognition for Live Transcription in UAE
Hello,
We’re exploring the idea of setting up Microsoft Teams Rooms in our office space in Dubai. However, before investing in the hardware, I am researching the availability of certain features, specifically the Voice and Face Recognition capabilities for Microsoft Teams Rooms in the United Arab Emirates.
Can anyone confirm if these facial and voice recognition features are available in the UAE. Because I couldn’t find it officially anywhere?
Thank you!
Hello, We’re exploring the idea of setting up Microsoft Teams Rooms in our office space in Dubai. However, before investing in the hardware, I am researching the availability of certain features, specifically the Voice and Face Recognition capabilities for Microsoft Teams Rooms in the United Arab Emirates. Can anyone confirm if these facial and voice recognition features are available in the UAE. Because I couldn’t find it officially anywhere? Thank you! Read More
Any update on the stickers on the desk?
Is it still in development? Never heard any update on this.
Is it still in development? Never heard any update on this. Read More
Removing the grey margin of a plot (follow up question)
This is a follow-up question to Removing the grey margin of a plot. If I use the same code proposed by @KSSV within a subplot environment, the picture goes out the left margin (and probably the right margin as well):
subplot(1,2,1) % <– If I use subplotm the picture goes out the left (and maybe right) margin
plot(peaks)
title(‘Plot of Peaks Function’)
axis off
ax = gca;
outerpos = ax.OuterPosition;
ti = ax.TightInset;
left = outerpos(1) + ti(1);
bottom = outerpos(2) + ti(2);
ax_width = outerpos(3) – ti(1) – ti(3);
ax_height = outerpos(4) – ti(2) – ti(4);
ax.Position = [left bottom ax_width ax_height];
Is there a way to correctly adjust the left (and maybe the right) margin, in such a way that the entire figure lies inside the subplot?This is a follow-up question to Removing the grey margin of a plot. If I use the same code proposed by @KSSV within a subplot environment, the picture goes out the left margin (and probably the right margin as well):
subplot(1,2,1) % <– If I use subplotm the picture goes out the left (and maybe right) margin
plot(peaks)
title(‘Plot of Peaks Function’)
axis off
ax = gca;
outerpos = ax.OuterPosition;
ti = ax.TightInset;
left = outerpos(1) + ti(1);
bottom = outerpos(2) + ti(2);
ax_width = outerpos(3) – ti(1) – ti(3);
ax_height = outerpos(4) – ti(2) – ti(4);
ax.Position = [left bottom ax_width ax_height];
Is there a way to correctly adjust the left (and maybe the right) margin, in such a way that the entire figure lies inside the subplot? This is a follow-up question to Removing the grey margin of a plot. If I use the same code proposed by @KSSV within a subplot environment, the picture goes out the left margin (and probably the right margin as well):
subplot(1,2,1) % <– If I use subplotm the picture goes out the left (and maybe right) margin
plot(peaks)
title(‘Plot of Peaks Function’)
axis off
ax = gca;
outerpos = ax.OuterPosition;
ti = ax.TightInset;
left = outerpos(1) + ti(1);
bottom = outerpos(2) + ti(2);
ax_width = outerpos(3) – ti(1) – ti(3);
ax_height = outerpos(4) – ti(2) – ti(4);
ax.Position = [left bottom ax_width ax_height];
Is there a way to correctly adjust the left (and maybe the right) margin, in such a way that the entire figure lies inside the subplot? margin, subplot, outerposition, tightinset, margins MATLAB Answers — New Questions
Plot shows in legend but not in graph?
subplot(2,2,1);
plot(x1,y1,’bs’)
hold on
p1 = polyfit(x1,y1,35);
f1 = polyval(p1,x1);
plot(x1,f1,’–r’)
hold off
legend
title(‘Data Set 1’)
xlabel(‘X1 Values’)
ylabel(‘Y1 Values’)
subplot(2,2,2);
plot(x2,y2,’g*’)
hold on
p2 = polyfit(x2,y2,35);
f2 = polyval(p2,x2);
plot(x2,f2,’–b’)
hold off
legend
title(‘Data Set 2’)
xlabel(‘X2 Values’)
ylabel(‘Y2 Values’)subplot(2,2,1);
plot(x1,y1,’bs’)
hold on
p1 = polyfit(x1,y1,35);
f1 = polyval(p1,x1);
plot(x1,f1,’–r’)
hold off
legend
title(‘Data Set 1’)
xlabel(‘X1 Values’)
ylabel(‘Y1 Values’)
subplot(2,2,2);
plot(x2,y2,’g*’)
hold on
p2 = polyfit(x2,y2,35);
f2 = polyval(p2,x2);
plot(x2,f2,’–b’)
hold off
legend
title(‘Data Set 2’)
xlabel(‘X2 Values’)
ylabel(‘Y2 Values’) subplot(2,2,1);
plot(x1,y1,’bs’)
hold on
p1 = polyfit(x1,y1,35);
f1 = polyval(p1,x1);
plot(x1,f1,’–r’)
hold off
legend
title(‘Data Set 1’)
xlabel(‘X1 Values’)
ylabel(‘Y1 Values’)
subplot(2,2,2);
plot(x2,y2,’g*’)
hold on
p2 = polyfit(x2,y2,35);
f2 = polyval(p2,x2);
plot(x2,f2,’–b’)
hold off
legend
title(‘Data Set 2’)
xlabel(‘X2 Values’)
ylabel(‘Y2 Values’) subplot, multiple MATLAB Answers — New Questions