Month: August 2024
New Blog | Public preview: Microsoft Entra ID FIDO2 provisioning APIs
By Alex Weinert
Today I’m excited to announce a great new way to onboard employees with admin provisioning of FIDO2 security keys (passkeys) on behalf of users.
Our customers love passkeys as a phishing-resistant method for their users, but some were concerned that registration was limited to users registering their own security keys. Today we’re announcing the new Microsoft Entra ID FIDO2 provisioning APIs that empowers organizations to handle this provisioning for their users, providing secure and seamless authentication from day one.
While customers can still deploy security keys in their default configuration to their users, or allow users to bring their own security keys which requires self-service registration by a user, the APIs allow keys to be pre-provisioned for users, so users have an easier experience on first use.
Adopting phishing-resistant authentication is critical – attackers have increased their use of Adversary-in-the-Middle (AitM) phishing and social engineering attacks to target MFA-enabled users. Phishing-resistant authentication methods, including passkeys, certificate-based authentication (CBA), and Windows Hello for Business, are the best ways to protect from these attacks.
Phishing-resistant authentication is also a key requirement of Executive Order 14028 which requires phishing-resistant authentication for all agency staff, contractors, and partners. While most federal customers use preexisting smartcard systems to achieve compliance, passkeys provide a secure alternative for their users looking for improved ways to securely sign in. With today’s release of admin provisioning, they also have a simplified onboarding process for users.
Read the full post here: Public preview: Microsoft Entra ID FIDO2 provisioning APIs
By Alex Weinert
Today I’m excited to announce a great new way to onboard employees with admin provisioning of FIDO2 security keys (passkeys) on behalf of users.
Our customers love passkeys as a phishing-resistant method for their users, but some were concerned that registration was limited to users registering their own security keys. Today we’re announcing the new Microsoft Entra ID FIDO2 provisioning APIs that empowers organizations to handle this provisioning for their users, providing secure and seamless authentication from day one.
While customers can still deploy security keys in their default configuration to their users, or allow users to bring their own security keys which requires self-service registration by a user, the APIs allow keys to be pre-provisioned for users, so users have an easier experience on first use.
Adopting phishing-resistant authentication is critical – attackers have increased their use of Adversary-in-the-Middle (AitM) phishing and social engineering attacks to target MFA-enabled users. Phishing-resistant authentication methods, including passkeys, certificate-based authentication (CBA), and Windows Hello for Business, are the best ways to protect from these attacks.
Phishing-resistant authentication is also a key requirement of Executive Order 14028 which requires phishing-resistant authentication for all agency staff, contractors, and partners. While most federal customers use preexisting smartcard systems to achieve compliance, passkeys provide a secure alternative for their users looking for improved ways to securely sign in. With today’s release of admin provisioning, they also have a simplified onboarding process for users.
Read the full post here: Public preview: Microsoft Entra ID FIDO2 provisioning APIs
Word 365 for Mac not showing red lines under spelling errors…
I’m not sure what happened, but I think maybe someone sent a document with certain settings on it, and now I don’t see any of the red squiggly lines that highlight spelling and grammar errors on Word.
I’m using Word 365 on Mac.
I’ve already tried uninstalling and reinstalling word to no effect.
Check spelling as you type and Check grammar as you type are turned ON in the settings.
If anyone could help I’d be very grateful, as it’s driving me insane!
I’m not sure what happened, but I think maybe someone sent a document with certain settings on it, and now I don’t see any of the red squiggly lines that highlight spelling and grammar errors on Word. I’m using Word 365 on Mac. I’ve already tried uninstalling and reinstalling word to no effect. Check spelling as you type and Check grammar as you type are turned ON in the settings. If anyone could help I’d be very grateful, as it’s driving me insane! Read More
List users not in distribution lists
I am looking for a way to list all users that are not in 8 specific distribution lists.
I have found an option that gets close but it is not correct.
I only want to display the users that are not in list 1, or list 2, or list 3, or list 4, or list 5 or list 6 or, list 7, or list 8.
The script I found does not appear to apply the “or” to the query.
I also need it to export to a file rather than display on the screen.
Here is a copy of the syntax I found.
$Users = Get-Mailbox | ? {$_.PrimarySmtpAddress -like “*MyDomain.com”} #Enter your domain
$DistributionGroups = @(“List 1″,”List 2″,”List 3″,”List 4″,”List 5″,”List 6″,”List 7″,”List 8”) #Enter names of your distributiongroups
foreach($DistributionGroup in $DistributionGroups)
{
$DistributionGroupMembers = Get-DistributionGroupMember $DistributionGroup
foreach($User in $Users)
{
foreach($DistributionGroupMember in $DistributionGroupMembers)
{
if($DistributionGroupMember.PrimarySmtpAddress -ne $User.PrimarySmtpAddress)
{
Write-Host “$($User.PrimarySmtpAddress) missing in $DistributionGroup” #Export output here fx.
}
}
}
}
I am looking for a way to list all users that are not in 8 specific distribution lists.I have found an option that gets close but it is not correct.I only want to display the users that are not in list 1, or list 2, or list 3, or list 4, or list 5 or list 6 or, list 7, or list 8.The script I found does not appear to apply the “or” to the query.I also need it to export to a file rather than display on the screen.Here is a copy of the syntax I found. $Users = Get-Mailbox | ? {$_.PrimarySmtpAddress -like “*MyDomain.com”} #Enter your domain$DistributionGroups = @(“List 1″,”List 2″,”List 3″,”List 4″,”List 5″,”List 6″,”List 7″,”List 8”) #Enter names of your distributiongroupsforeach($DistributionGroup in $DistributionGroups){$DistributionGroupMembers = Get-DistributionGroupMember $DistributionGroupforeach($User in $Users){foreach($DistributionGroupMember in $DistributionGroupMembers){if($DistributionGroupMember.PrimarySmtpAddress -ne $User.PrimarySmtpAddress){Write-Host “$($User.PrimarySmtpAddress) missing in $DistributionGroup” #Export output here fx.}}}} Read More
How to convert euler angles to rotation matrix and back to euler angles consistently?
I want to compare the rotations from two different sources. However, I can do it only in R3, using Euler angles. However, it seems even for an elementary conversion, we don’t get matching euler vectors. I know that there can be non-unique representations for the same rotation matrix, but is there a way, where I can enforce some particular angle range output so that the vectors match? Maybe a constraint like rotation in Z has to be positive.
For eg.
%% Euler Angle -> Rotation Matrix -> Euler Angle
Rzc = -0.0030; Ryc = -2.4788; Rxc = 0.0180;
eul_seq_c_in = [Rzc, Ryc, Rxc]
rotm_c = eul2rotm(eul_seq_c_in);
eul_seq_c_out = rotm2eul(rotm_c)
%% Many to One Mapping for Euler Angle
eul2rotm(eul_seq_c_in)
eul2rotm(eul_seq_c_out)
For my application, all I get is a sequence of euler angles as an input. Then, I get a rotation transform independently, whose Euler sequence is calculated. And then I verify, if they represent the same rotation transform.I want to compare the rotations from two different sources. However, I can do it only in R3, using Euler angles. However, it seems even for an elementary conversion, we don’t get matching euler vectors. I know that there can be non-unique representations for the same rotation matrix, but is there a way, where I can enforce some particular angle range output so that the vectors match? Maybe a constraint like rotation in Z has to be positive.
For eg.
%% Euler Angle -> Rotation Matrix -> Euler Angle
Rzc = -0.0030; Ryc = -2.4788; Rxc = 0.0180;
eul_seq_c_in = [Rzc, Ryc, Rxc]
rotm_c = eul2rotm(eul_seq_c_in);
eul_seq_c_out = rotm2eul(rotm_c)
%% Many to One Mapping for Euler Angle
eul2rotm(eul_seq_c_in)
eul2rotm(eul_seq_c_out)
For my application, all I get is a sequence of euler angles as an input. Then, I get a rotation transform independently, whose Euler sequence is calculated. And then I verify, if they represent the same rotation transform. I want to compare the rotations from two different sources. However, I can do it only in R3, using Euler angles. However, it seems even for an elementary conversion, we don’t get matching euler vectors. I know that there can be non-unique representations for the same rotation matrix, but is there a way, where I can enforce some particular angle range output so that the vectors match? Maybe a constraint like rotation in Z has to be positive.
For eg.
%% Euler Angle -> Rotation Matrix -> Euler Angle
Rzc = -0.0030; Ryc = -2.4788; Rxc = 0.0180;
eul_seq_c_in = [Rzc, Ryc, Rxc]
rotm_c = eul2rotm(eul_seq_c_in);
eul_seq_c_out = rotm2eul(rotm_c)
%% Many to One Mapping for Euler Angle
eul2rotm(eul_seq_c_in)
eul2rotm(eul_seq_c_out)
For my application, all I get is a sequence of euler angles as an input. Then, I get a rotation transform independently, whose Euler sequence is calculated. And then I verify, if they represent the same rotation transform. rotation, transforms, euler MATLAB Answers — New Questions
EEG data Visualization for .mat file
I have an EEG data stored as . mat file , I want to visualize the EEG , What command should I use?
the sampling rate = 500
num of channels = 66
num of points = 250734
sample file is attached as image because the file size is too much big.I have an EEG data stored as . mat file , I want to visualize the EEG , What command should I use?
the sampling rate = 500
num of channels = 66
num of points = 250734
sample file is attached as image because the file size is too much big. I have an EEG data stored as . mat file , I want to visualize the EEG , What command should I use?
the sampling rate = 500
num of channels = 66
num of points = 250734
sample file is attached as image because the file size is too much big. eeg, image processing, visualization MATLAB Answers — New Questions
NaN issue and if statement
I’m having trouble with my code when I add an if condition to check if B_body(3) is less than 1e-5.
Without the if condition, everything works fine.
But when I add the if condition, I get a warning and B_body(3) values become NaN.
I’ve tried several solutions, but nothing works.
Any ideas on how to fix this?
epsilon=1e-5;
if abs(B_body(3))<epsilon
T_rw=[0;0;0];
else
T_rw = [0; 0; 1] * (B_body’ * T_commanded) / (B_body(3));
endI’m having trouble with my code when I add an if condition to check if B_body(3) is less than 1e-5.
Without the if condition, everything works fine.
But when I add the if condition, I get a warning and B_body(3) values become NaN.
I’ve tried several solutions, but nothing works.
Any ideas on how to fix this?
epsilon=1e-5;
if abs(B_body(3))<epsilon
T_rw=[0;0;0];
else
T_rw = [0; 0; 1] * (B_body’ * T_commanded) / (B_body(3));
end I’m having trouble with my code when I add an if condition to check if B_body(3) is less than 1e-5.
Without the if condition, everything works fine.
But when I add the if condition, I get a warning and B_body(3) values become NaN.
I’ve tried several solutions, but nothing works.
Any ideas on how to fix this?
epsilon=1e-5;
if abs(B_body(3))<epsilon
T_rw=[0;0;0];
else
T_rw = [0; 0; 1] * (B_body’ * T_commanded) / (B_body(3));
end nan MATLAB Answers — New Questions
Organizer joining a Team and then starting a meeting
I recently tried to go into a meeting using the Join the Meeting link. But I also tried to use the Meeting ID and Passcode. I am the organizer along with one other person. We have many participants that bypass the lobby. Once in, the START MEETING button appears at the top right.
What happened is BEFORE the organizer (me) went in, one of the participants clicked START MEETING. I was not then able to even get in with the Join the Meeting link nor by entering the meeting ID and the passcode. I got a screen that said I had to register but then when I tried to register, the REGISTER button was greyed out. At the end, I (as the trainer/organizer) was not able to get in to deliver my training.
My colleague and I tested this with different meeting links and it seemed the consistent problem was if a participant clicked START MEETING prior to the organizer getting into the meeting.
Is there a way to NOT allow participants to actually click START MEETING?
I recently tried to go into a meeting using the Join the Meeting link. But I also tried to use the Meeting ID and Passcode. I am the organizer along with one other person. We have many participants that bypass the lobby. Once in, the START MEETING button appears at the top right.What happened is BEFORE the organizer (me) went in, one of the participants clicked START MEETING. I was not then able to even get in with the Join the Meeting link nor by entering the meeting ID and the passcode. I got a screen that said I had to register but then when I tried to register, the REGISTER button was greyed out. At the end, I (as the trainer/organizer) was not able to get in to deliver my training.My colleague and I tested this with different meeting links and it seemed the consistent problem was if a participant clicked START MEETING prior to the organizer getting into the meeting. Is there a way to NOT allow participants to actually click START MEETING? Read More
EDATES and SUMIFS Help
Hi All,
I have created a spreadsheet showing all frequent costs of my company which has columns for frequency, date and description.
On my second sheet I have the dates for 6 months across the top row and the frequency and description in the first column.
To populate the data in the first month I have input a simple SUMIF based on the date and the description of my frequent cost sheet.
For the following 11 months, I wanted to do a SUMIF based on the date in the first month.
For example:
SUMIF(AA$2:BE$2,EDATE(BF$2,-1),AA12:BE12),0)
AA$2:BE$2 are my date rows (range)
BF$2 is my current date (criteria)
AA12:BE12 are my costs (sum range) the issue I’m running into is if there is a cost on the 31st August, it will not pick it up on the 30th September.
Any idea how to fix this?
Thanks
Hi All, I have created a spreadsheet showing all frequent costs of my company which has columns for frequency, date and description.On my second sheet I have the dates for 6 months across the top row and the frequency and description in the first column. To populate the data in the first month I have input a simple SUMIF based on the date and the description of my frequent cost sheet. For the following 11 months, I wanted to do a SUMIF based on the date in the first month.For example:SUMIF(AA$2:BE$2,EDATE(BF$2,-1),AA12:BE12),0)AA$2:BE$2 are my date rows (range)BF$2 is my current date (criteria)AA12:BE12 are my costs (sum range) the issue I’m running into is if there is a cost on the 31st August, it will not pick it up on the 30th September. Any idea how to fix this? Thanks Read More
Sharepoint Connector ADF
Hi,
I am analyzing sharepoint connector which is used in ADF. I would like to know the limitations of using sharepoint connector in ADF in terms of
Authentication type supportedSpecific connection configuration neededCopy a whole folder or multiple files from sharepointthe size of the file which can be downloadedSecurity/firewall issuesAny other limitations or issues that we can expect
Hi,I am analyzing sharepoint connector which is used in ADF. I would like to know the limitations of using sharepoint connector in ADF in terms ofAuthentication type supportedSpecific connection configuration neededCopy a whole folder or multiple files from sharepointthe size of the file which can be downloadedSecurity/firewall issuesAny other limitations or issues that we can expect Read More
Toggles for GPT-4 and GPT-4 Turbo in Copilot Pro completely disappeared. Been missing for days.
Current Copilot Pro subscriber and a few days ago my toggles for which GPT-4 to select disappeared.
I’ve checked in Edge, Edge Dev, Edge Canary, and Chrome to make sure it’s not my browser being stupid and it’s gone everywhere. Even checked in the iOS mobile app and not there either.
Not sure if there’s some sort of A/B testing going around or it’s an Insider thing or what, but I can’t find any information suggesting that so not really sure what’s going on.
Is an updated GPT-4o being rolled out to Copilot Pro currently or something that does away with the toggles? Or is my shiz just borked? Am I the only one with this issue?
Any help or input is appreciated, thank you!
Current Copilot Pro subscriber and a few days ago my toggles for which GPT-4 to select disappeared. I’ve checked in Edge, Edge Dev, Edge Canary, and Chrome to make sure it’s not my browser being stupid and it’s gone everywhere. Even checked in the iOS mobile app and not there either. Not sure if there’s some sort of A/B testing going around or it’s an Insider thing or what, but I can’t find any information suggesting that so not really sure what’s going on. Is an updated GPT-4o being rolled out to Copilot Pro currently or something that does away with the toggles? Or is my shiz just borked? Am I the only one with this issue? Any help or input is appreciated, thank you! Read More
SharePoint Lists – Display one Choice selection in a Second Column Also.
I have two columns in a SharePoint List. Let’s call the Column 1 and Column 2. They are both Choice Columns. They also both share two common choices, Completed and Cancelled. If someone selects one of those choices in either column, I would like it to be automatically displayed in the other column also. Meaning, both columns should match if Completed or Cancelled are selected in either column. If another choice is selected in either column, the other column should remain empty, for a manual selection of one of the other choices. What would the JSON code be to do something like this?
I have two columns in a SharePoint List. Let’s call the Column 1 and Column 2. They are both Choice Columns. They also both share two common choices, Completed and Cancelled. If someone selects one of those choices in either column, I would like it to be automatically displayed in the other column also. Meaning, both columns should match if Completed or Cancelled are selected in either column. If another choice is selected in either column, the other column should remain empty, for a manual selection of one of the other choices. What would the JSON code be to do something like this? Read More
Join us for Partner Pre-Day at the European Microsoft Fabric Community Conference!
Join us Tuesday, September 24, 2024 for a full day of partner engagement on all things Microsoft Fabric, from partner-specific opportunities to strategies for landing key workloads with your customers. This learning and networking event is offered for free, exclusively to partners attending the European Microsoft Fabric Community Conference (FabCon Europe).
The conference will explore the limitless possibilities of Microsoft Fabric and the latest developments in analytics and AI. With 130 sessions, four keynotes, Ask the Experts opportunities, and plenty of networking activities, this will be the ultimate European event for Microsoft data, analytics, and AI.
The free Partner Pre-Day will include:
Deep dives into content specifically tailored for Microsoft partners.
A conversational AMA with top Microsoft leadership.
Time to mix and mingle with your peers and Microsoft counterparts.
Purchase your pass* to FabCon Europe and then make plans to join us early for this free day of partner content and networking.
Join us Tuesday, September 24, 2024 for a full day of partner engagement on all things Microsoft Fabric, from partner-specific opportunities to strategies for landing key workloads with your customers. This learning and networking event is offered for free, exclusively to partners attending the European Microsoft Fabric Community Conference (FabCon Europe).
The conference will explore the limitless possibilities of Microsoft Fabric and the latest developments in analytics and AI. With 130 sessions, four keynotes, Ask the Experts opportunities, and plenty of networking activities, this will be the ultimate European event for Microsoft data, analytics, and AI.
The free Partner Pre-Day will include:
Deep dives into content specifically tailored for Microsoft partners.
A conversational AMA with top Microsoft leadership.
Time to mix and mingle with your peers and Microsoft counterparts.
Purchase your pass* to FabCon Europe and then make plans to join us early for this free day of partner content and networking. Read More
Most widely used SharePoint Framework ISVs from the Store – July 2024
We are excited to see the continuous growth on the submissions of the SharePoint Framework (SPFx) solutions to the app source and on the usage of the SharePoint store for extending experiences for SharePoint and Microsoft Viva. Here are the top 10 most wide used ISVs based on the solution installations from the store and/or from Microsoft AppSource during July 2024.
SharePoint Framework is extensibility model for Microsoft Viva, Microsoft Teams, Outlook, Microsoft 365 app and SharePoint. It enables the same code to be used easily across the Microsoft 365 with this widely adopted tooling which uses industry standard tech with easy and automatic SSO and hosting. Usage of SPFx is growing steady and we have currently tens of millions of monthly active users in Microsoft 365 on custom extensibility build with SPFx.
Here are the latest roadmap items around SharePoint Framework and store:
Chart card support for the Viva Connections with the SPFx 1.19 release – more options in upcoming 1.20 release (beta in August 2024)
Deprecation of SharePoint add-in and Azure ACS authentication models – UX powered extensibility should be transformed to us SharePoint Framework powered implementations. Add-in model was introduced back in 2012 and has not really evolved since. This deprecation does not impact SharePoint Framework (SPFx) solutions.
Additional capabilities and features for SharePoint Framework solutions in Microsoft 365 as part of the SPFx 1.18 release.
Enabling Microsoft Viva Connections targeted solutions, powered by SharePoint Framework, in the app source and store – Will be automatically set for suitable SPFx solutions as part of the submission pipeline
Extending SharePoint Framework solutions across the Microsoft 365 with support for Microsoft Teams, Microsoft Viva, Outlook, Microsoft 365 app (Office), SharePoint and more – see the v1.16 release announcement for more details
Alignment of SharePoint Framework solution packaging model with the Microsoft Teams packages – include the best of both worlds and enable SPFx powered solutions across the Microsoft 365
Support for SharePoint Framework solutions in the Microsoft Teams store – no exact schedule, dependent on the previous bullet point
Support SharePoint Framework extensibility for list and library new, edit and view panels
and more to come…
What about AI extensibility story with SPFx? – Yes. Please see following session from Build 2024 for the preview of the upcoming extensibility options with the SPFx in the context of AI – Integrating your bots and Copilot experiences natively into SharePoint and Viva Connections. These will be also covered in our public community calls in autumn 2024.
We are looking forward to more great solutions that enable innovation, and help our customers get more done with Microsoft Viva, Microsoft Teams, SharePoint and more.
These are the ISVs which has the most usage from the SharePoint store during last month:
Accelerator 365 by Reply
Solution details:
Solutions at app source / store
Solution provider: Accelerator 365 by Reply
Sprinklr, Inc.
Solution details:
Solutions at app source / store
Solution provider: Sprinklr, Inc.
Achievers
Solution details:
Solutions at app source / store
Solution provider: Achievers
Ichicraft
Solution details:
Solutions at app source / store
Solution provider: Ichicract
Lightning Tools Ltd
Solution details:
Solutions at app source / store
Solution provider: Lightning Tools
Envoqon Software
Solution details:
Solutions at app source / store
Solution provider: Envogon Software
SharePoint|sapiens
Solution details:
Solution at app source / store
Solution provider: SharePoint | sapiens
Bloch Engineering
Solution details:
Solutions at app source / store
Solution provider: Bloch Engineering
Plumsail Inc
Solution details:
Solutions at app source / store
Solution provider: Plumsail Inc
Sharepointalist
Solution details:
Solutions at app source / store
Solution provider: Sharepointalist
Resources
Please see following resources around getting started on building extensibility for Microsoft Teams, Microsoft Viva and SharePoint using SharePoint Framework.
Announcing SharePoint Framework 1.19 with updates on building enterprise extensibility within Microsoft 365
Announcing SharePoint Framework 1.18 with updates for Microsoft Teams, Microsoft Viva and SharePoint
Announcing general availability of SharePoint Framework 1.16 – Enabling SPFx across Microsoft 365 platform
Explore and deploy SharePoint Framework solutions from partners in SharePoint (Microsoft 365)
Overview of the SharePoint Framework
Publish SharePoint Framework applications to the marketplace
Overview of Viva Connections Extensibility
Guidance for implementing partner offerings for Viva Connections with ACEs and custom APIs
Microsoft Learn – Extend Microsoft Viva Connections
SharePoint Framework samples to get started from Microsoft and community – Microsoft 365 & Power Platform Unified Sample Gallery
Happy coding! 🧡
Microsoft Tech Community – Latest Blogs –Read More
Import numpy and scipy (maybe through Anaconda) in Matlab
(1) Introduction.
This is a follow up question of Call a Python function inside a MATLAB loop.
I am trying to run the following Python function (which is saved as anderson_darling.py) on Matlab:
def ADtest(a,b):
rng = np.random.default_rng()
method = stats.PermutationMethod(n_resamples=9999, random_state=rng)
res = stats.anderson_ksamp([a,b], method=method)
print(a)
print(b)
print(res.statistic)
print(res.critical_values)
print(res.pvalue)
if __name__ == "__main__":
import sys
import numpy as np
from scipy import stats
input_list1 = list(map(int, sys.argv[1].strip(‘[]’).split(‘,’)))
input_list2 = list(map(int, sys.argv[2].strip(‘[]’).split(‘,’)))
a = np.array(input_list1)
b = np.array(input_list2)
ADtest(a,b)
To run this file, I open a Terminal (throgh Visual Studio Code, but this is not relevant), and I give the following command:
(base) xyz@xyz myfolder % python3 anderson_darling.py "[1,3,5,6,4,6,7,1,2,7]" "[1,3,5,6,4,6,7,1,2,7]"
The result, that appears on the Terminal is the following:
[1 3 5 6 4 6 7 1 2 7] % <– array a
[1 3 5 6 4 6 7 1 2 7] % <– array b
-1.4363560826434034 % <– res.statistic
[0.325 1.226 1.961 2.718 3.752 4.592 6.546] % <– res.critical_values
1.0 % <– res.pvalue
(2) Problem.
Now, when I go to the editor of Matlab, I try to follow some indications of @Pavan Sahith, from Call a Python function inside a MATLAB loop:
a = [1,3,5,6,4,6,7,1,2,7];
b = [1,3,5,6,4,6,7,1,2,7];
% Convert MATLAB arrays to Python lists
py_a = py.list(a);
py_b = py.list(b);
py.anderson_darling.ADtest(py_a,py_b)
However, I get the following error on the Matlab Command Window:
Error using anderson_darling>ADtest
Python Error: NameError: name ‘np’ is not defined
(3) Potential source/reason of the problem & Question
I guess the problem is related to the way of importing "numpy" and "scipy" to Matlab. I found the following discussions on the Matlab forum, but it looks like they are related to Windows:
How to activate Anaconda environment in Matlab?
MATLAB Crashes when Using Conda Environment Other than Base
import numpy to matlab
problem with python numpy
I instead use Mac and I do not know what to do.
Therefore, how can I successfully import and use "numpy" and "scipy" to Matlab?
(4) Additional information on my system.
If it can help, my Python, Anaconda (the "numpy" and "scipy" packages are contained in (Ana)conda) and Matlab versions are the following ones:
From Terminal:
(base) xyz@xyz ~ % python3 –version
Python 3.12.4
(base) xyz@xyz ~ % conda –version
conda 24.7.1
(base) xyz@xyz ~ % conda info –envs
# conda environments:
#
base * /opt/anaconda3
/usr/local/anaconda3
From the Matlab’s Command Window:
% Python Version for your system (inside Matlab)
% https://ch.mathworks.com/help/matlab/ref/pyenv.html
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Library/Developer/CommandLineTools/usr/bin/python3"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9"
Status: Loaded
ExecutionMode: InProcess
ProcessID: "4128"
ProcessName: "MATLAB"
% Matlab version
>> version
ans =
‘23.2.0.2515942 (R2023b) Update 7′(1) Introduction.
This is a follow up question of Call a Python function inside a MATLAB loop.
I am trying to run the following Python function (which is saved as anderson_darling.py) on Matlab:
def ADtest(a,b):
rng = np.random.default_rng()
method = stats.PermutationMethod(n_resamples=9999, random_state=rng)
res = stats.anderson_ksamp([a,b], method=method)
print(a)
print(b)
print(res.statistic)
print(res.critical_values)
print(res.pvalue)
if __name__ == "__main__":
import sys
import numpy as np
from scipy import stats
input_list1 = list(map(int, sys.argv[1].strip(‘[]’).split(‘,’)))
input_list2 = list(map(int, sys.argv[2].strip(‘[]’).split(‘,’)))
a = np.array(input_list1)
b = np.array(input_list2)
ADtest(a,b)
To run this file, I open a Terminal (throgh Visual Studio Code, but this is not relevant), and I give the following command:
(base) xyz@xyz myfolder % python3 anderson_darling.py "[1,3,5,6,4,6,7,1,2,7]" "[1,3,5,6,4,6,7,1,2,7]"
The result, that appears on the Terminal is the following:
[1 3 5 6 4 6 7 1 2 7] % <– array a
[1 3 5 6 4 6 7 1 2 7] % <– array b
-1.4363560826434034 % <– res.statistic
[0.325 1.226 1.961 2.718 3.752 4.592 6.546] % <– res.critical_values
1.0 % <– res.pvalue
(2) Problem.
Now, when I go to the editor of Matlab, I try to follow some indications of @Pavan Sahith, from Call a Python function inside a MATLAB loop:
a = [1,3,5,6,4,6,7,1,2,7];
b = [1,3,5,6,4,6,7,1,2,7];
% Convert MATLAB arrays to Python lists
py_a = py.list(a);
py_b = py.list(b);
py.anderson_darling.ADtest(py_a,py_b)
However, I get the following error on the Matlab Command Window:
Error using anderson_darling>ADtest
Python Error: NameError: name ‘np’ is not defined
(3) Potential source/reason of the problem & Question
I guess the problem is related to the way of importing "numpy" and "scipy" to Matlab. I found the following discussions on the Matlab forum, but it looks like they are related to Windows:
How to activate Anaconda environment in Matlab?
MATLAB Crashes when Using Conda Environment Other than Base
import numpy to matlab
problem with python numpy
I instead use Mac and I do not know what to do.
Therefore, how can I successfully import and use "numpy" and "scipy" to Matlab?
(4) Additional information on my system.
If it can help, my Python, Anaconda (the "numpy" and "scipy" packages are contained in (Ana)conda) and Matlab versions are the following ones:
From Terminal:
(base) xyz@xyz ~ % python3 –version
Python 3.12.4
(base) xyz@xyz ~ % conda –version
conda 24.7.1
(base) xyz@xyz ~ % conda info –envs
# conda environments:
#
base * /opt/anaconda3
/usr/local/anaconda3
From the Matlab’s Command Window:
% Python Version for your system (inside Matlab)
% https://ch.mathworks.com/help/matlab/ref/pyenv.html
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Library/Developer/CommandLineTools/usr/bin/python3"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9"
Status: Loaded
ExecutionMode: InProcess
ProcessID: "4128"
ProcessName: "MATLAB"
% Matlab version
>> version
ans =
‘23.2.0.2515942 (R2023b) Update 7’ (1) Introduction.
This is a follow up question of Call a Python function inside a MATLAB loop.
I am trying to run the following Python function (which is saved as anderson_darling.py) on Matlab:
def ADtest(a,b):
rng = np.random.default_rng()
method = stats.PermutationMethod(n_resamples=9999, random_state=rng)
res = stats.anderson_ksamp([a,b], method=method)
print(a)
print(b)
print(res.statistic)
print(res.critical_values)
print(res.pvalue)
if __name__ == "__main__":
import sys
import numpy as np
from scipy import stats
input_list1 = list(map(int, sys.argv[1].strip(‘[]’).split(‘,’)))
input_list2 = list(map(int, sys.argv[2].strip(‘[]’).split(‘,’)))
a = np.array(input_list1)
b = np.array(input_list2)
ADtest(a,b)
To run this file, I open a Terminal (throgh Visual Studio Code, but this is not relevant), and I give the following command:
(base) xyz@xyz myfolder % python3 anderson_darling.py "[1,3,5,6,4,6,7,1,2,7]" "[1,3,5,6,4,6,7,1,2,7]"
The result, that appears on the Terminal is the following:
[1 3 5 6 4 6 7 1 2 7] % <– array a
[1 3 5 6 4 6 7 1 2 7] % <– array b
-1.4363560826434034 % <– res.statistic
[0.325 1.226 1.961 2.718 3.752 4.592 6.546] % <– res.critical_values
1.0 % <– res.pvalue
(2) Problem.
Now, when I go to the editor of Matlab, I try to follow some indications of @Pavan Sahith, from Call a Python function inside a MATLAB loop:
a = [1,3,5,6,4,6,7,1,2,7];
b = [1,3,5,6,4,6,7,1,2,7];
% Convert MATLAB arrays to Python lists
py_a = py.list(a);
py_b = py.list(b);
py.anderson_darling.ADtest(py_a,py_b)
However, I get the following error on the Matlab Command Window:
Error using anderson_darling>ADtest
Python Error: NameError: name ‘np’ is not defined
(3) Potential source/reason of the problem & Question
I guess the problem is related to the way of importing "numpy" and "scipy" to Matlab. I found the following discussions on the Matlab forum, but it looks like they are related to Windows:
How to activate Anaconda environment in Matlab?
MATLAB Crashes when Using Conda Environment Other than Base
import numpy to matlab
problem with python numpy
I instead use Mac and I do not know what to do.
Therefore, how can I successfully import and use "numpy" and "scipy" to Matlab?
(4) Additional information on my system.
If it can help, my Python, Anaconda (the "numpy" and "scipy" packages are contained in (Ana)conda) and Matlab versions are the following ones:
From Terminal:
(base) xyz@xyz ~ % python3 –version
Python 3.12.4
(base) xyz@xyz ~ % conda –version
conda 24.7.1
(base) xyz@xyz ~ % conda info –envs
# conda environments:
#
base * /opt/anaconda3
/usr/local/anaconda3
From the Matlab’s Command Window:
% Python Version for your system (inside Matlab)
% https://ch.mathworks.com/help/matlab/ref/pyenv.html
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Library/Developer/CommandLineTools/usr/bin/python3"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9"
Status: Loaded
ExecutionMode: InProcess
ProcessID: "4128"
ProcessName: "MATLAB"
% Matlab version
>> version
ans =
‘23.2.0.2515942 (R2023b) Update 7’ numpy, scipy, module, matlab, python, import, python function, anaconda, conda, python3, py, pyenv MATLAB Answers — New Questions
Why does opening Simulink for the first time in a MATLAB session take a long time?
Regardless of how I open Simulink, when I open it for the first time in a new MATLAB session, it takes almost 15 minutes to open. After the loading process, nothing else in Simulink is slow. How can I speed up this load time?Regardless of how I open Simulink, when I open it for the first time in a new MATLAB session, it takes almost 15 minutes to open. After the loading process, nothing else in Simulink is slow. How can I speed up this load time? Regardless of how I open Simulink, when I open it for the first time in a new MATLAB session, it takes almost 15 minutes to open. After the loading process, nothing else in Simulink is slow. How can I speed up this load time? MATLAB Answers — New Questions
Simulink Model Error – Please Help
Can u please help solve this error ?Can u please help solve this error ? Can u please help solve this error ? simulink MATLAB Answers — New Questions
Patch and fill functions are not shading area between confidence intervals in 2024a
I am trying to fill the area between two confidence intervals in Matlab 2024a. It is a depth-temperature chart where depth is Y and the confidence intervals are an upper and lower temperature bound in X. I have searched everything online, tried many things, and do not understand why the lines of the upper and lower bound will appear, but the area between the confidence intervals will not shade when calling both patch() and fill(). Here is a bit of my code:
clf;
plot(meanT, Depth, "r-", ‘LineWidth’, 2)
hold on
patch([Tlower; fliplr(Tupper)], [Depth; fliplr(Depth)], ‘g’)
Depth, meanT, Tlower, Tupper are all [nx1]. I have tried changing fliplr to flipud or just flip with no success. I have also tried transforming Tupper/Tlower to be sorted so they are smallest-to-largest and calling patch()/fill() on the sorted values. Same issue occurs. Any help to resolve this is much appreciated.I am trying to fill the area between two confidence intervals in Matlab 2024a. It is a depth-temperature chart where depth is Y and the confidence intervals are an upper and lower temperature bound in X. I have searched everything online, tried many things, and do not understand why the lines of the upper and lower bound will appear, but the area between the confidence intervals will not shade when calling both patch() and fill(). Here is a bit of my code:
clf;
plot(meanT, Depth, "r-", ‘LineWidth’, 2)
hold on
patch([Tlower; fliplr(Tupper)], [Depth; fliplr(Depth)], ‘g’)
Depth, meanT, Tlower, Tupper are all [nx1]. I have tried changing fliplr to flipud or just flip with no success. I have also tried transforming Tupper/Tlower to be sorted so they are smallest-to-largest and calling patch()/fill() on the sorted values. Same issue occurs. Any help to resolve this is much appreciated. I am trying to fill the area between two confidence intervals in Matlab 2024a. It is a depth-temperature chart where depth is Y and the confidence intervals are an upper and lower temperature bound in X. I have searched everything online, tried many things, and do not understand why the lines of the upper and lower bound will appear, but the area between the confidence intervals will not shade when calling both patch() and fill(). Here is a bit of my code:
clf;
plot(meanT, Depth, "r-", ‘LineWidth’, 2)
hold on
patch([Tlower; fliplr(Tupper)], [Depth; fliplr(Depth)], ‘g’)
Depth, meanT, Tlower, Tupper are all [nx1]. I have tried changing fliplr to flipud or just flip with no success. I have also tried transforming Tupper/Tlower to be sorted so they are smallest-to-largest and calling patch()/fill() on the sorted values. Same issue occurs. Any help to resolve this is much appreciated. patch, fill, shading MATLAB Answers — New Questions
I open Matlab after a computer crash and the editor is clear . Is there a file which stores which files were open prior to the crash?
Matlab closed incorrectly after a PC shutdown. When I restarted, all of the open m-files open in the editor have gone (as tabs, not from the hard drive). Is there any record of the open files anywhere?
ThksMatlab closed incorrectly after a PC shutdown. When I restarted, all of the open m-files open in the editor have gone (as tabs, not from the hard drive). Is there any record of the open files anywhere?
Thks Matlab closed incorrectly after a PC shutdown. When I restarted, all of the open m-files open in the editor have gone (as tabs, not from the hard drive). Is there any record of the open files anywhere?
Thks editor, files, crash MATLAB Answers — New Questions
Unable to Scroll by Clicking Scroll Arrows in Windows 11
A friend is having trouble scrolling by clicking on these small arrows:
While the touchpad scrolling is functioning properly, clicking on these arrows does not move the page. Can you suggest which settings may be causing this issue?
A friend is having trouble scrolling by clicking on these small arrows: While the touchpad scrolling is functioning properly, clicking on these arrows does not move the page. Can you suggest which settings may be causing this issue? Read More
Struggling to Easily Move or Copy Files in the New File Explorer
Wow, can you believe it? I recently upgraded to the W11 operating system! I’m still trying to figure out how some of the applications work in this new setup, but I’m sure I’ll get the hang of it soon. I’ll update all my specs shortly, but for now, let’s focus on something else.
I currently have three hard drives – C, D, and M. My default download location is a folder cleverly named “Downloads” on my C drive. When I used to open downloads before, File Explorer in W10 would allow me to easily Move, Copy, Rename, and more with just a simple click. It feels a bit different now.
I’d like to know how to MOVE a file or folder from my C Drive to my M Drive. Additionally, if I connect a USB stick, how can I COPY a file or folder to it?
Thanks a bunch in advance for your help!
Wow, can you believe it? I recently upgraded to the W11 operating system! I’m still trying to figure out how some of the applications work in this new setup, but I’m sure I’ll get the hang of it soon. I’ll update all my specs shortly, but for now, let’s focus on something else. I currently have three hard drives – C, D, and M. My default download location is a folder cleverly named “Downloads” on my C drive. When I used to open downloads before, File Explorer in W10 would allow me to easily Move, Copy, Rename, and more with just a simple click. It feels a bit different now. I’d like to know how to MOVE a file or folder from my C Drive to my M Drive. Additionally, if I connect a USB stick, how can I COPY a file or folder to it? Thanks a bunch in advance for your help! Read More