Month: August 2024
Can you please fix the text in microsoft booking (French)
So my company is using microsoft booking, everything is very professional, it’s starting to work nicely, but can you please fix the text since I can’t do it inside the booking itself.
I know it’s in french, but there is obviously no backslash in that word. It feels unprofessional and people are complaining.
We should see ”N’importe quel employé”
and not ”N’importe quel employé”
So my company is using microsoft booking, everything is very professional, it’s starting to work nicely, but can you please fix the text since I can’t do it inside the booking itself. I know it’s in french, but there is obviously no backslash in that word. It feels unprofessional and people are complaining. We should see ”N’importe quel employé” and not ”N’importe quel employé” Read More
How do I get a refund from Google Pay wrong transaction?
Call Google Pay India Support number: 0811-6941368″”” Customers can reach the Customer Care number toll free at 1-800-419-0157. (Available 24/7) Option 2 – In-app support: Customers have an option to initiate chat support for all Complaints.
Call Google Pay India Support number: 0811-6941368″”” Customers can reach the Customer Care number toll free at 1-800-419-0157. (Available 24/7) Option 2 – In-app support: Customers have an option to initiate chat support for all Complaints. Read More
DataSource Error when connecting to Dataverse from Excel
Hi,
I’m trying to connect to Dataverse tables from Excel via Get Data > From Power Platform > From Dataverse. I was able to sign in and access my environments. However, as I tried to expand the environment folder to access the tables, I got the following error: “The parameterized query expects ‘@tds_client_correlation_id’, which is not supplied.”
In Power BI, I followed the same steps using the same credentials and it worked just fine.
This is particularly odd because it was working well as of a few days ago (I even wrote a VBA script to automate data streaming and processing).
Would appreciate your help!
New Hugging Face Models on Azure AI: Multilingual, SLM and BioMed- July 2024 Update
In May, we announced a deepened partnership with Hugging Face and we continue to add more leading-edge Hugging Face models to the Azure AI model catalog on a monthly basis. We have 1550+ models in the Hugging Face collection and we added 20+ models in July including highly-ranked multilingual models, tuned for Asian languages like Mandarin, Japanese, Indonesian, Thai, Malay, Vietnamese. This blog posts kicks off a monthly roundup of the most recently added models to this collection, spotlighting notable metrics or features that may be relevant to your specific application development requirements.
What’s New in July 2024
We added 20+ models to the Hugging Face collection in the Azure AI model catalog in July. These included multilingual models (focus on Chinese, Dutch, Arabic, South-East Asian), embedding models, text generation (SLM and LLM) and models with a domain-specific focus (e.g., biomedical). The table below summarizes additions by task and notable features. Click model name to view related model cards on Azure AI for more details. In the next section, we’ll put the spotlight on a couple of models or model families that may be of particular interest to developers exploring SLMs or multilingual applications.
Model Name · Inference Task
Notable Features
01
01-ai/Yi-1.5-34B ﹒ Text Generation
Top-ranked bilingual language model (with English, Chinese)
02
01-ai/Yi-34B-Chat ﹒ Text Generation
03
BramVanroy/GEITje-7B-ultra ﹒ Text Generation
Bilingual (with English, Dutch)
04
BAAI/bge-m3﹒ Sentence Similarity
Multi-lingual, Multi-functional RAG
05
stanford-crfm/BioMedLM ﹒ Text Generation
Biomedical, MedQA (not for prod)
06
BioMistral/BioMistral-7B ﹒ Text Generation
Biomedical, MedQA (from Mistral)
07
m42-health/Llama3-Med42-70B ﹒ Text Generation
Clinical, MedQA (not for prod)
08
m42-health/Llama3-Med42-8B ﹒ Text Generation
Clinical, MedQA (not for prod)
09
shenzhi-wang/Llama3.1-8B-Chinese-Chat
Bilingual (with English, Chinese)
10
HuggingFaceTB/SmolLM-1.7B ﹒ Text Generation
SLM, high-quality training corpus
11
AI-MO/NuminaMath-7B-TIR ﹒ Text Generation
1st progress prize – AI Math Olympiad
12
google-t5/t5-base ﹒Translation
Reframe NLP Tasks with one format
13
jbochi/madlad400-3b-mt ﹒ Translation
Multilingual (450 lang), uses T5 arch.
14
teknium/OpenHermes-2.5-Mistral-7B ﹒ Text Generation
Tackle complex conversation topics
15
Intel/neural-chat-7b-v3-1﹒ Text Generation
SlimOrca data, Intel Gaudi fine-tuned
16
hfl/chinese-llama-2-7b ﹒ Text Generation
Optimized for Chinese vocab
17
shibing624/mengzi-t5-base-chinese-correction ﹒ T2TG
T5 for Chinese Spelling Correction
18
GeneZC/MiniChat-1.5-3B ﹒ Text Generation
Fine-tuned Llama2-7B (outperforms)
19
sail/Sailor-0.5B ﹒ Text Generation
Tuned for SEA (South-East Asian lang) Indonesian, Thai, Malay, Vietnamese-
20
sail/Sailor-1.8B-Chat ﹒ Text Generation
21
FreedomIntelligence/AceGPT-v1.5-13B ﹒ Text Generation
AceGPT family – Arabic lang domain
Spotlight On: Multilingual Models
Multilingual models tap into the power of Large Language Models, but with support for queries created in multiple languages (beyond just English). This extends your application reach to new audiences and unlocks your ability to drive region-focused domain-specific solutions. Let’s look at some notable additions from the list above in more detail.
1. Yi Series by 01.AI
The information below is summarized from these model creator resources:
Model Website · Technical Report · Yi Series Models (GitHub) · Cookbook
The Yi series of models are large language models trained from scratch by 01-AI to support bilingual (English, Chinese) text generation tasks, and are considered one of the strongest LLMs for language understanding, commonsense reasoning, reading comprehension and more. The model comes in three sizes – 5B (for personal use), 9B (for coding and math) and 34B (for personal, academic and commercial use) with both base and fine-tuned (chat) model options. We added the 01-ai/Yi-34B-Chat model to the catalog in July – here’s a look at how it performs against comparable LLMs on popular benchmarks.
The base model ranked first among all existing open-source models in both English and Chinese benchmarks. The chat model outperformed other LLMs (except GPT-4-Turbo) on the AlpacaEval Leaderboard in January 2024. The model performance was evaluated with zero-shot and few-shot prompting – ranking highly on most benchmarks, making it a proficient model for bilingual conversational use.
The Yi-1.5 series of models is an upgraded version of Yi with all those capabilities and a much stronger performance in coding, math, reasoning and instruction-following capabilities thanks to being continuously pre-trained on a high-quality corpus (500B tokens) and fine-tune on 3M diverse samples. The 01-ai/Yi-1.5-34B model was added to the Azure AI catalog in July. Based on the provided data, the model achieved parity with, or outperformed, comparable models across multiple popular benchmarks.
2. Sailor: Open Language Models for South-East Asia
The information below is summarized from these model creator resources:
Model Website · Technical Report · Sailor Language Models
Sailor is a suite of Open Language Models tailored for South-East Asia (SEA) built from the Qwen 1.5 model which performs well for these languages. The models are designed to understand and generate text for the diverse languages dominating the SEA region.
The base models are fine-tuned with open-source datasets to get instruction-tuned Sailor-chat model variants. In July, we added the sail/Sailor-0.5B base model and the sail/Sailor-1.8B-Chat chat model to the Hugging Face collection in the Azure AI model catalog.
Sailor is continually pretrained on 200B-400B tokens over 7 languages (Indonesian, Vietnamese, Thai, Malay, Lao, English and Chinese) using well-known publicly-available corpus with aggressive de-duplication and data cleaning to create a high-quality dataset. The models are then evaluated 4 core tasks – using these well-known benchmarks.
Question Answering: XQuAD (Thai, Vietnamese) and TydiQA (Indonesian).
Commonsense Reasoning: XCOPA (Indonesian, Thai, Vietnamese).
Reading Comprehension: Belebele (Indonesian, Thai, Vietnamese).
Examination: M3Exam (Javanese, Thai, Vietnamese).
The results shown below are taken from their website, with the highlighted row reflected the base model we just added to the catalog. The evaluation reports the 3-shot Exact Match (EM) for prompts provided in the local languages. Baseline models outperforming Sailor models are highlighted in green – with results showing this family’s proficiency in SEA languages across all four task categories. Note: Sailor models are licensed for research and commercial use – you should see the Qwen 1.5 license for exceptions.
Get Started Using Hugging Face Models on Azure
Getting started with using Hugging Face models in Azure involves three steps:
Pick the right model from the catalog: Explore the Hugging Face Collection.
Deploy the model to Azure: use Azure AI Studio or Python SDK or Azure CLI.
Run a test inference: use Python Samples or Create your own test sample.
Samples are available for core tasks – for instance this sample shown above walks you through the end-to-end process for a text generation task with streaming support. Simply replace the default model with a different Hugging Face model from the Azure AI catalog, and run.
Request a Hugging Face Model for the Azure catalog
Want to see a different Hugging Face hub model on the Azure AI catalog? Request it by visiting that model’s page on the Hugging Face hub. Click the “Azure ML” option under the Deploy dropdown (top right on page). If that model is not currently in our catalog (e.g., SmolLM-135M) you will see the “Request to add” option as shown. If it was already added to the catalog (e.g., SmolLM-1.7B) you will instead get a `Go to model in AzureML` option.
Get Involved
As we announced in May 2024, we will deepen Hugging Face hub and Azure AI platform integrations with model discoverability, custom deployment, and fine-tuning in focus. Here are a few actions you can take today to help us improve this developer experience.
Want to join a private preview program for these features? Complete this form.
Want to try inference using these models, code-first? Explore the Python samples.
Want to explore the Hugging Face models in Azure? Browse the Model catalog.
Want to learn more about the Azure AI catalog & usage? Read the Documentation.
Microsoft Tech Community – Latest Blogs –Read More
Manage your Generative AI APIs with Azure API Management and Azure Open AI
This is for you who have started with Generative AI APIs and you’re looking to take those APIs into production. At high-level, there are things to consider like load balancing error management and cost management. We’ll mention those in this article and guide you to an Azure Sample where you can get started deploying an enterprise-ready solution.
Scenario: you want to take your generative AI to production.
So, you’re starting to use Azure Open AI, you like what you see, and you see how you can add this AI functionality to several of the apps in your company.
However, you have a big operation with many customers and many different apps and enterprise grade requirements on security and you know you must tackle all that before you can adopt generative AI to your business.
Problems we must address
You write up a list of problems that you need to address to fully implement generative AI:
– Load balancing and circuit breaker: With many customers, it’s key that you can distribute the load across multiple instances. Also, error management is super important, to ensure that if one instance fails, the others can take over. In the cloud a common approach to error management is Circuit breaker helps by stopping the requests to the failing instance and redirecting them to the healthy ones.
– Monitoring and metrics: You want to monitor the usage of the AI model, how many requests are coming in, how many are failing, and how many are successful. Also, how many tokens are being used and how many are left. What about caching the responses to reduce the load on the AI model and save costs and improve performance.
– Security: You want to secure the AI model; you don’t want anyone to access it. You have perhaps started by using API keys but for enterprise scenarios, you want to use managed identity.
You ask yourself; can a cloud service handle the above problems? It looks like Azure APIM management has an interesting approach to the above problem. In fact, there’s an Azure sample that seems to implement the above, let’s dive in to see how:
Resources
Here’s some great resource to get you started and also learn more about the features implemented in the Azure Sample.
– Azure sample – APIM + Generative AI
– Azure API Management – Overview and key concepts | Microsoft Learn
– Azure API Management policy reference – azure-openai-token-limit | Microsoft Learn
– Azure API Management policy reference – azure-openai-emit-token-metric | Microsoft Learn
– Azure API Management backends | Microsoft Learn
– Use managed identities in Azure API Management | Microsoft Learn
Introducing: enterprise grade sample using APIM + Generative AI
In this sample, we get a chat app (frontend and backend) and a set of cloud resources that can be deployed to Azure using Azure Developer CLI, azd. Below is the user interface of the app included in the sample:
Architecture view of the sample
Ok, so first we get a chat window, great, that’s a good start, but let’s learn more about the architecture, how the sample is implemented:
The easiest way to describe how the architecture works is considering an incoming web request and what happens to it. In our case, we have a POST request with a prompt.
Request is hitting the API, and the API considers what to do with it:
Authentication, first it checks whether you’re allowed by checking the subscriberID you provided in your request
Routing. Next the API checks the policies to determines whether this request is within token limits (and the request is logged), thereafter it’s sent to the loadBalancer, where the load balancer determines which backend to send it to (each backend has 1:1 association with an Azure Open AI endpoint )
There’s an alternate scenario here where if a backend responds with error within a certain time interval and a certain type of error the request is routed to a healthy resource
Creating a response, the assigned Azure Open AI endpoint responds, and the user sees the response rendered in the chat app.
Above is the happy path, if an endpoint throws errors for some reason with a certain frequency and/or error code the circuit breaker logic is triggered, and the request is routed to a healthy endpoint. Another reason for not getting a chat response back is if the token limits have been hit, i.e. rate limiting (you’ve for example made too many requests in a short time span).
Also note how a semantic cache could be made to respond instead if a response and prompt is similar to what’s already in the cache.
How to get started
Ensure you have a terminal up and running and that you Azure Developer CLI, azd installed. Then run the following steps:
Clone the repo (or start in codespaces)
git clone https://github.com/Azure-Samples/genai-gateway-apim.git
Login to Azure,
azd auth login
Run app, at this point, you have your cloud resources deployed. To test these out, run the app locally (you need to have Node.js installed), at repo directory, run the below commands in a terminal:
cd src
npm install
npm start
This will start the app on http://localhost:3000 and the API is available at http:localhost:1337.
What next
Our suggestion is that you go and check out the Azure Sample – APIM + Gen AI Try deploying it and see how it works.
Let us know if you have any questions or feedback.
Microsoft Tech Community – Latest Blogs –Read More
Expanding the Azure AI Model Inference API: Integrating Azure AI into Your Development Environment
We believe that building AI applications should be intuitive, flexible, and integrated. To help simplify the AI development lifecycle, we are thrilled to announce the latest updates to the Azure AI model inference API, enhancing its capabilities and broadening its utility for a code-first experience that brings the power of Azure AI directly within the environments and the tools developers prefer. The Azure AI model inference API provides developers with a single, consistent API and endpoint URL, enabling seamless interaction with a wide variety of foundation models, including those from Azure OpenAI Service, Mistral, Meta, Cohere, and Microsoft Research.
This announcement focuses on integrating model access via GitHub, introducing inference SDKs, expanding support for self-hosted models, integrating with Azure API Management, and enhancing retrieval augmented generation (RAG) systems with LlamaIndex.
Key features in this announcement:
1. Single Common API for Model Access via GitHub: With the GitHub Models announcement last week, developers can now access models from the Azure AI model catalog directly through GitHub using a single API and experiment with different AI models in the playground with their GitHub account. This integration allows for seamless interaction with various models, including GPT-4o, Llama 3, Mistral Large, Command R+, and Phi-3. By unifying model access, we simplify the AI development process and enable more efficient workflows.
The integration with GitHub is particularly significant for application developers. GitHub is a central hub for coding, collaboration, and version control. By bringing Azure AI capabilities directly into GitHub, we ensure that developers can remain in their preferred development environment to experiment with multiple models, reducing context switching and streamlining the AI development process.
2. Inference SDKs for Multiple Languages: To support diverse development environments, we are introducing inference SDKs for Python, JavaScript, and C#. These SDKs allow developers to effortlessly integrate AI models into their applications using inference clients in the language of their choice, making it easier to build and scale AI solutions across different platforms. These SDKs can be integrated with LLM App development tools such as prompt flow, LangChain, and Semantic Kernel.
Inference SDKs for C#, JavaScript, and Python
3. Model inference API Expansion to Managed Compute: At Microsoft Build 2024, we introduced the Azure AI model inference API for models deployed as serverless API endpoints and Azure OpenAI Service, enabling developers to consume predictions from a diverse set of models in a consistent way and easily switch between models to compare the performance.
The model inference API now includes inference support for open source models deployed to our self-hosted managed online endpoints, providing enhanced flexibility and control over model deployment and inferencing. This feature allows you to leverage the full potential of AI models, including Mistral, Llama 3, and Phi-3 tailored to specific use cases, optimizing both performance and cost-efficiency.
4. Integration with Azure API Management: We are also expanding the GenAI Gateway capabilities in Azure API Management to support a wider range of large language models through the Azure AI model inference API, in addition to the support for Azure OpenAI Service. New policies, such as the LLM Token Limit Policy, LLM Emit Token Metric Policy, and LLM Semantic Caching Policy, provide detailed insights and control over token resources, ensuring efficient and cost-effective use of models. These policies allow for real-time monitoring, cost management, and improved efficiency by caching responses based on the semantic content of prompts. Read this blog to learn more about integration.
5. Take RAG to the next level with LlamaIndex: Lastly, we are happy to announce the integration of the Azure AI model inference API into the LlamaIndex ecosystem. Now developers can elevate their RAG systems built with LlamaIndex by leveraging the extensive power of the Azure AI model catalog.
Two new packages have been introduced to the LlamaIndex ecosystem:
llama-index-embeddings-azure-inference
llama-index-llms-azure-inference
These packages enable the seamless incorporation of Azure AI models into the LlamaIndex framework, allowing users to select the optimal model for each task.
Getting Started: To begin using the Azure AI model inference API, visit our documentation page for detailed instructions and examples. Whether you’re building chatbots, data analytics tools, or sophisticated AI-driven applications, the Azure AI model inference API and SDKs provide the foundation you need to succeed.
While this announcement focuses on the GitHub integration and inference API/SDKs, we are working on bringing additional features in subsequent phases. Stay tuned for more updates as we continue to enhance the Azure AI model inference API to meet all your development needs.
Microsoft Tech Community – Latest Blogs –Read More
Buzzling sound when playing 16-ch audio to Motu Pro Audio
I have problem when play my sound to Motu. There is "nuzzling sound" during the silence part of your audio, especially in the end of audio.
original audio
after_played_to_16ch
Am I correctly use this code to play in using Motu?
I don’t have any issue when I play directly from Audacity or Reaper.
Thanks
% Define the file and volume settings
audioFile = ‘chapel2m_0_order3_02_eight_new_shoes.wav’; % Path to your audio file
volumeLevel = 0.01; % Desired volume level (0 to 1)
% Get audio file information
info = audioinfo(audioFile);
fs = info.TotalSamples / info.Duration; % Sample rate of the audio file
numChannels = info.NumChannels; % Number of channels in the audio file
% Create an audio file reader
fileReader = dsp.AudioFileReader(audioFile, ‘PlayCount’, Inf);
fileReader.SamplesPerFrame = 8192; % Larger buffer size to avoid underflow/overflow
% Create an audio device writer with ASIO driver and MOTU Pro Audio device
deviceWriter = audioDeviceWriter(‘Driver’, ‘ASIO’, ‘Device’, ‘MOTU Pro Audio’, …
‘SampleRate’, fs, ‘ChannelMappingSource’, ‘Auto’);
% Setup the audio device writer with the correct sample rate and channel mapping
setup(deviceWriter, zeros(fileReader.SamplesPerFrame, numChannels));
% Process and play the audio
while ~isDone(fileReader)
% Read audio data
audioData = fileReader();
% Adjust the audio data by the volume level
audioData = audioData * volumeLevel;
% Write the adjusted audio data to the device
deviceWriter(audioData);
end
% Release resources
release(fileReader);
release(deviceWriter);I have problem when play my sound to Motu. There is "nuzzling sound" during the silence part of your audio, especially in the end of audio.
original audio
after_played_to_16ch
Am I correctly use this code to play in using Motu?
I don’t have any issue when I play directly from Audacity or Reaper.
Thanks
% Define the file and volume settings
audioFile = ‘chapel2m_0_order3_02_eight_new_shoes.wav’; % Path to your audio file
volumeLevel = 0.01; % Desired volume level (0 to 1)
% Get audio file information
info = audioinfo(audioFile);
fs = info.TotalSamples / info.Duration; % Sample rate of the audio file
numChannels = info.NumChannels; % Number of channels in the audio file
% Create an audio file reader
fileReader = dsp.AudioFileReader(audioFile, ‘PlayCount’, Inf);
fileReader.SamplesPerFrame = 8192; % Larger buffer size to avoid underflow/overflow
% Create an audio device writer with ASIO driver and MOTU Pro Audio device
deviceWriter = audioDeviceWriter(‘Driver’, ‘ASIO’, ‘Device’, ‘MOTU Pro Audio’, …
‘SampleRate’, fs, ‘ChannelMappingSource’, ‘Auto’);
% Setup the audio device writer with the correct sample rate and channel mapping
setup(deviceWriter, zeros(fileReader.SamplesPerFrame, numChannels));
% Process and play the audio
while ~isDone(fileReader)
% Read audio data
audioData = fileReader();
% Adjust the audio data by the volume level
audioData = audioData * volumeLevel;
% Write the adjusted audio data to the device
deviceWriter(audioData);
end
% Release resources
release(fileReader);
release(deviceWriter); I have problem when play my sound to Motu. There is "nuzzling sound" during the silence part of your audio, especially in the end of audio.
original audio
after_played_to_16ch
Am I correctly use this code to play in using Motu?
I don’t have any issue when I play directly from Audacity or Reaper.
Thanks
% Define the file and volume settings
audioFile = ‘chapel2m_0_order3_02_eight_new_shoes.wav’; % Path to your audio file
volumeLevel = 0.01; % Desired volume level (0 to 1)
% Get audio file information
info = audioinfo(audioFile);
fs = info.TotalSamples / info.Duration; % Sample rate of the audio file
numChannels = info.NumChannels; % Number of channels in the audio file
% Create an audio file reader
fileReader = dsp.AudioFileReader(audioFile, ‘PlayCount’, Inf);
fileReader.SamplesPerFrame = 8192; % Larger buffer size to avoid underflow/overflow
% Create an audio device writer with ASIO driver and MOTU Pro Audio device
deviceWriter = audioDeviceWriter(‘Driver’, ‘ASIO’, ‘Device’, ‘MOTU Pro Audio’, …
‘SampleRate’, fs, ‘ChannelMappingSource’, ‘Auto’);
% Setup the audio device writer with the correct sample rate and channel mapping
setup(deviceWriter, zeros(fileReader.SamplesPerFrame, numChannels));
% Process and play the audio
while ~isDone(fileReader)
% Read audio data
audioData = fileReader();
% Adjust the audio data by the volume level
audioData = audioData * volumeLevel;
% Write the adjusted audio data to the device
deviceWriter(audioData);
end
% Release resources
release(fileReader);
release(deviceWriter); audio, motu, 16-channel MATLAB Answers — New Questions
tleread() loading incorrect data
Hello,
I’m trying to load TLE data to MATLAB using tleread function. Examining the MeanMotion values, they seem to either be loaded incorrectly or some conversion is going on. I tried to look in the help files for the tleread but couldn’t find any details.
For instance, this is the tle data for the Iridium constellation: https://celestrak.org/NORAD/elements/gp.php?GROUP=iridium&FORMAT=tle
When saved as a .tle file and loaded to MATLAB, the MeanMotion values are incorrect.
I’m using MATLAB online, so version R2024a. I also tried it on a locally installed MATLAB (2024a), and getting the same results.
Am I missing something?Hello,
I’m trying to load TLE data to MATLAB using tleread function. Examining the MeanMotion values, they seem to either be loaded incorrectly or some conversion is going on. I tried to look in the help files for the tleread but couldn’t find any details.
For instance, this is the tle data for the Iridium constellation: https://celestrak.org/NORAD/elements/gp.php?GROUP=iridium&FORMAT=tle
When saved as a .tle file and loaded to MATLAB, the MeanMotion values are incorrect.
I’m using MATLAB online, so version R2024a. I also tried it on a locally installed MATLAB (2024a), and getting the same results.
Am I missing something? Hello,
I’m trying to load TLE data to MATLAB using tleread function. Examining the MeanMotion values, they seem to either be loaded incorrectly or some conversion is going on. I tried to look in the help files for the tleread but couldn’t find any details.
For instance, this is the tle data for the Iridium constellation: https://celestrak.org/NORAD/elements/gp.php?GROUP=iridium&FORMAT=tle
When saved as a .tle file and loaded to MATLAB, the MeanMotion values are incorrect.
I’m using MATLAB online, so version R2024a. I also tried it on a locally installed MATLAB (2024a), and getting the same results.
Am I missing something? satellite, tle data, constellation MATLAB Answers — New Questions
timeout error when output of entry-point function is vector with PIL configuration
Greetings
I’m working on deploying deep learning on raspberry pi 4 with matlab version 2024a. I’m facing timeout error when output of entry-point function with PIL configuration is vector. however when configuration is mex, the code has successfully implemtned. Simple code below can demonstrate the issue.
Kindly, how the code with PIL configuration can be fixed so that the output from entry-point function is vector or matrix ?
the driver for this request is described in more details in my case study below.
% raspberry connection and configuration
r = raspi(‘raspberrypi’,’pi’,’raspberry’);
cfg = coder.config(‘lib’,’ecoder’,true);
cfg.VerificationMode = ‘PIL’;
cfg.TargetLang = ‘C++’;
dlcfg = coder.DeepLearningConfig(‘arm-compute’);
dlcfg.ArmComputeVersion = ‘20.02.1’;
dlcfg.ArmArchitecture = ‘armv7’;
cfg.DeepLearningConfig = dlcfg;
cfg.MATLABSourceComments = 1;
hw = coder.hardware(‘Raspberry Pi’);
cfg.Hardware = hw;
cfg.CodeExecutionProfiling = true;
Case 1: with mex configuration, successfuly implemented
type dummy
t = ones(1,3);
codegen dummy -args {t} -report -config:mex
% testing deployement
x=[1,2,3];
testDummy= dummy_mex(x);
Case 2: with pil configuraiton, timeout error generated
type dummy
cfg.Hardware.BuildDir = ‘~/dummy’;
t = ones(1,3);
codegen dummy -args {t} -report -config cfg
% testing deployement
x=[1,2,3];
testDummy= dummy_pil(x);
entry-point function
function out = dummy(in)
%#codegen
out = in;
end
Case Study
my case study has raw data consists of 8 channels where I need to extract features from wavelet scattering network then pass them into trained lstm network. My code is similar to the below example, but the difference is my input raw data is 8 channels, while the example is one channel. openExample(‘wavelet/CodeGenerationForFaultDetectionUsingWaveletAndRNNExample’).
I’m getting the below error:
Number of features of input passed to the predict method must be a code generation time constant
So, I decided to breakdown entry-point function into two functions for easier troubleshooting. First featureFunction is to extract wavelet features from raw data (batch: 500samples x 8 channels), the second predictFunction is to take the generated wavelet features (32 C x 102 T) into trained lstm network.
prdictFunction_pil worked find which accept input size (32 x 102), and get predicted labels.
featureFunction_pil gives the below error
Error using rtw.pil.SILPILInterface.throwMException (line 1774)
The timeout of 300 seconds for receiving data from the rtiostream interface has been exceeded. There might be multiple reasons for this communications failure.
You should:
(a) Check that the target hardware configuration is correct, for example, check that the byte ordering is correct.
(b) Confirm that the target application is running on the target hardware.
(c) Consider the possibility of application run-time failures (e.g. divide by zero exceptions, incorrect custom code integration, etc.).
Note (c): To identify possible reasons for the run-time failure, consider using SIL, which supports signal handlers and debugging.
If you cannot find a solution, consider using the method setTimeoutRecvSecs of rtw.connectivity.RtIOStreamHostCommunicator to increase the timeout value.Greetings
I’m working on deploying deep learning on raspberry pi 4 with matlab version 2024a. I’m facing timeout error when output of entry-point function with PIL configuration is vector. however when configuration is mex, the code has successfully implemtned. Simple code below can demonstrate the issue.
Kindly, how the code with PIL configuration can be fixed so that the output from entry-point function is vector or matrix ?
the driver for this request is described in more details in my case study below.
% raspberry connection and configuration
r = raspi(‘raspberrypi’,’pi’,’raspberry’);
cfg = coder.config(‘lib’,’ecoder’,true);
cfg.VerificationMode = ‘PIL’;
cfg.TargetLang = ‘C++’;
dlcfg = coder.DeepLearningConfig(‘arm-compute’);
dlcfg.ArmComputeVersion = ‘20.02.1’;
dlcfg.ArmArchitecture = ‘armv7’;
cfg.DeepLearningConfig = dlcfg;
cfg.MATLABSourceComments = 1;
hw = coder.hardware(‘Raspberry Pi’);
cfg.Hardware = hw;
cfg.CodeExecutionProfiling = true;
Case 1: with mex configuration, successfuly implemented
type dummy
t = ones(1,3);
codegen dummy -args {t} -report -config:mex
% testing deployement
x=[1,2,3];
testDummy= dummy_mex(x);
Case 2: with pil configuraiton, timeout error generated
type dummy
cfg.Hardware.BuildDir = ‘~/dummy’;
t = ones(1,3);
codegen dummy -args {t} -report -config cfg
% testing deployement
x=[1,2,3];
testDummy= dummy_pil(x);
entry-point function
function out = dummy(in)
%#codegen
out = in;
end
Case Study
my case study has raw data consists of 8 channels where I need to extract features from wavelet scattering network then pass them into trained lstm network. My code is similar to the below example, but the difference is my input raw data is 8 channels, while the example is one channel. openExample(‘wavelet/CodeGenerationForFaultDetectionUsingWaveletAndRNNExample’).
I’m getting the below error:
Number of features of input passed to the predict method must be a code generation time constant
So, I decided to breakdown entry-point function into two functions for easier troubleshooting. First featureFunction is to extract wavelet features from raw data (batch: 500samples x 8 channels), the second predictFunction is to take the generated wavelet features (32 C x 102 T) into trained lstm network.
prdictFunction_pil worked find which accept input size (32 x 102), and get predicted labels.
featureFunction_pil gives the below error
Error using rtw.pil.SILPILInterface.throwMException (line 1774)
The timeout of 300 seconds for receiving data from the rtiostream interface has been exceeded. There might be multiple reasons for this communications failure.
You should:
(a) Check that the target hardware configuration is correct, for example, check that the byte ordering is correct.
(b) Confirm that the target application is running on the target hardware.
(c) Consider the possibility of application run-time failures (e.g. divide by zero exceptions, incorrect custom code integration, etc.).
Note (c): To identify possible reasons for the run-time failure, consider using SIL, which supports signal handlers and debugging.
If you cannot find a solution, consider using the method setTimeoutRecvSecs of rtw.connectivity.RtIOStreamHostCommunicator to increase the timeout value. Greetings
I’m working on deploying deep learning on raspberry pi 4 with matlab version 2024a. I’m facing timeout error when output of entry-point function with PIL configuration is vector. however when configuration is mex, the code has successfully implemtned. Simple code below can demonstrate the issue.
Kindly, how the code with PIL configuration can be fixed so that the output from entry-point function is vector or matrix ?
the driver for this request is described in more details in my case study below.
% raspberry connection and configuration
r = raspi(‘raspberrypi’,’pi’,’raspberry’);
cfg = coder.config(‘lib’,’ecoder’,true);
cfg.VerificationMode = ‘PIL’;
cfg.TargetLang = ‘C++’;
dlcfg = coder.DeepLearningConfig(‘arm-compute’);
dlcfg.ArmComputeVersion = ‘20.02.1’;
dlcfg.ArmArchitecture = ‘armv7’;
cfg.DeepLearningConfig = dlcfg;
cfg.MATLABSourceComments = 1;
hw = coder.hardware(‘Raspberry Pi’);
cfg.Hardware = hw;
cfg.CodeExecutionProfiling = true;
Case 1: with mex configuration, successfuly implemented
type dummy
t = ones(1,3);
codegen dummy -args {t} -report -config:mex
% testing deployement
x=[1,2,3];
testDummy= dummy_mex(x);
Case 2: with pil configuraiton, timeout error generated
type dummy
cfg.Hardware.BuildDir = ‘~/dummy’;
t = ones(1,3);
codegen dummy -args {t} -report -config cfg
% testing deployement
x=[1,2,3];
testDummy= dummy_pil(x);
entry-point function
function out = dummy(in)
%#codegen
out = in;
end
Case Study
my case study has raw data consists of 8 channels where I need to extract features from wavelet scattering network then pass them into trained lstm network. My code is similar to the below example, but the difference is my input raw data is 8 channels, while the example is one channel. openExample(‘wavelet/CodeGenerationForFaultDetectionUsingWaveletAndRNNExample’).
I’m getting the below error:
Number of features of input passed to the predict method must be a code generation time constant
So, I decided to breakdown entry-point function into two functions for easier troubleshooting. First featureFunction is to extract wavelet features from raw data (batch: 500samples x 8 channels), the second predictFunction is to take the generated wavelet features (32 C x 102 T) into trained lstm network.
prdictFunction_pil worked find which accept input size (32 x 102), and get predicted labels.
featureFunction_pil gives the below error
Error using rtw.pil.SILPILInterface.throwMException (line 1774)
The timeout of 300 seconds for receiving data from the rtiostream interface has been exceeded. There might be multiple reasons for this communications failure.
You should:
(a) Check that the target hardware configuration is correct, for example, check that the byte ordering is correct.
(b) Confirm that the target application is running on the target hardware.
(c) Consider the possibility of application run-time failures (e.g. divide by zero exceptions, incorrect custom code integration, etc.).
Note (c): To identify possible reasons for the run-time failure, consider using SIL, which supports signal handlers and debugging.
If you cannot find a solution, consider using the method setTimeoutRecvSecs of rtw.connectivity.RtIOStreamHostCommunicator to increase the timeout value. code generation, matlab coder, raspberry, deployment MATLAB Answers — New Questions
OneDrive for Business
I am a global admin for a medium sized corporation. In all my years, I’ve never had anyone do this – We terminated an employee and before she turned in her laptop, she deleted one folder from her OneDrive that contained 145,000 files (83gb). I thought it would be an easy task to restore them, but after three days, I’m reaching out for help.
When I create a link to OneDrive from the users profile, I don’t see a recycle bin. When I go to the direct URL for that recycle bin, It comes up, but my only option is to “empty recycle bin”. Here, I can select up the 2000 items and hit “restore” and it works, but I can only select 100 at a time and then another hundred and another hundred. If it goes past 2000 I get an error.
in Powershell, I’ve tried using modules Microsoft.Online.SharePoint.Powershell as well as PNP.Powershell but it doesn’t give me an option to restore these files. I can find documentation online to restore a OneDrive account back to a certain date (which would be perfect) But apparently, it only works for personal OneDrive accounts. That makes no sense.
Has anyone ever had to do something like this before? Is it even possible? Even built another laptop and installed O365 for this user – still no recycle bin.
Thanks for any advice.
I am a global admin for a medium sized corporation. In all my years, I’ve never had anyone do this – We terminated an employee and before she turned in her laptop, she deleted one folder from her OneDrive that contained 145,000 files (83gb). I thought it would be an easy task to restore them, but after three days, I’m reaching out for help. When I create a link to OneDrive from the users profile, I don’t see a recycle bin. When I go to the direct URL for that recycle bin, It comes up, but my only option is to “empty recycle bin”. Here, I can select up the 2000 items and hit “restore” and it works, but I can only select 100 at a time and then another hundred and another hundred. If it goes past 2000 I get an error. in Powershell, I’ve tried using modules Microsoft.Online.SharePoint.Powershell as well as PNP.Powershell but it doesn’t give me an option to restore these files. I can find documentation online to restore a OneDrive account back to a certain date (which would be perfect) But apparently, it only works for personal OneDrive accounts. That makes no sense. Has anyone ever had to do something like this before? Is it even possible? Even built another laptop and installed O365 for this user – still no recycle bin. Thanks for any advice. Read More
“Auto-start Teams” can’t be checked even tried uninstall/install several times.
Microsoft Teams version 24193.1805.3040.8975
Does anyone have similar symptom? Thank you.
Microsoft Teams version 24193.1805.3040.8975Does anyone have similar symptom? Thank you. Read More
Multiple Task Update Bug – Fixed Work to Fixed Duration
I am having a recent issue where I am unable to highlight the entire schedule and change everything from fixed duration to fixed work and vice versa.
My process is: highlight all tasks (including summaries) > Task Information (Multiple Task Information) > Advanced Tab > Task Type.
In the recent past, this would change the entire schedule to the selected task type. Now, MS Project closes the Task Information window and no changes are made.
Any confirmation that this is a bug, or any fix would be greatly appreciated.
I am having a recent issue where I am unable to highlight the entire schedule and change everything from fixed duration to fixed work and vice versa.My process is: highlight all tasks (including summaries) > Task Information (Multiple Task Information) > Advanced Tab > Task Type.In the recent past, this would change the entire schedule to the selected task type. Now, MS Project closes the Task Information window and no changes are made.Any confirmation that this is a bug, or any fix would be greatly appreciated. Read More
Microsoft Student Community Tour in Berlin
On June 13, an exciting and collaborative event unfolded in Berlin Microsoft Most Valuable Professionals (MVPs), Microsoft Learn Student Ambassadors, and Microsoft employees (FTEs). The event was a significant part of the Microsoft Student Community Tour, which we initiated last year alongside MVPs, Student Ambassadors, and local Microsoft teams in various cities, including Karlsruhe, Stuttgart, Hamburg, Zürich, and Munich.
Engaging Content and Community Building
The event was designed to educate and inspire, focusing on key technology trends and community engagement strategies. One of the highlights was the session led by Pablo Veramendi, Director of Audience Evangelism at Microsoft, who introduced the Student Ambassador Program. This segment emphasized the importance of connecting with the local student community and provided participants with actionable insights into leveraging Microsoft’s resources for their personal and professional growth.
Participants left the event equipped with new knowledge and a reinforced sense of community. They were inspired to apply what they had learned, fostering their skills and connections to the next level. The day’s success was a testament to the collaborative efforts of MVPs, MLSAs, and Microsoft employees, showcasing the immense potential of teamwork and innovative thinking.
A Unified Effort
The event in Berlin was a testament to the power of collaboration. Our MVPs, including Zaid Zaim, Alexander Wachtel, and Michael Greth, teamed up with Student Ambassador, Sandro Speth and Microsoft employees to craft a compelling agenda. This collaboration ensured that the topics were not only relevant but also inspiring for local students. Together, they handpicked speakers, designed engaging presentations, and executed a well-coordinated outreach to the student community in Berlin.
The MVPs played an instrumental role in this event. They diligently prepared their sessions, sharing expertise on cutting-edge topics such as mixed reality, Microsoft Mesh, and community building. Their involvement went beyond presentation; they provided on-site support, ensuring a seamless experience for all attendees. Their contributions exemplified how MVPs can significantly enhance the quality and impact of such events.
Looking Ahead
As we reflect on the success of the Berlin event, we express our gratitude to our MVPs, Student Ambassadors, and Microsoft colleagues. Their tireless efforts and passion were key to creating a memorable experience for all attendees. We eagerly anticipate more opportunities to engage with and support our vibrant student communities, continuing to foster growth, innovation, and a spirit of collaboration.
The Microsoft Student Community Tour in Berlin not only highlighted the power of collaboration but also showcased the profound impact MVPs can have in such initiatives. Together, we are paving the way for a future where technology and community intersect, driving positive change and empowering the next generation of innovators.
Microsoft Tech Community – Latest Blogs –Read More
Skilvul, Biji-Biji Initiative, Kartu Prakerja, dan Microsoft Kolaborasi Wujudkan Masa Depan Digital Indonesia Melalui Skilvul Innovation Challenge
Jakarta, 8 Agustus 2024 – Kolaborasi antara Skilvul, Biji-Biji Initiative, Kartu Prakerja, dan Microsoft dalam mengembangkan keterampilan digital generasi muda Indonesia melalui program Talenta AI mencapai puncaknya dengan berlangsungnya Skilvul Innovation Challenge Day Cycle 2. Kompetisi ini mempertemukan 150 peserta Talenta AI dari 20 provinsi di Indonesia untuk menghasilkan produk inovasi digital sebagai solusi permasalahan sosial. Terdapat tiga tema utama yang diangkat, yaitu bidang ketidaksetaraan akses terhadap sumber daya digital dan pendidikan di Indonesia, pemberdayaan UMKM untuk pertumbuhan berkelanjutan, dan revolusi kesehatan dengan teknologi inovatif.
Seluruh peserta terpilih merupakan peserta program Talenta AI yang telah berhasil lulus ujian sertifikasi Microsoft di bidang kecerdasan buatan (AI), data analytics, dan keamanan siber, Sebelumnya, program Skilvul Innovation Challenge Cycle 1 telah berhasil diselenggarakan dengan diikuti oleh 69 peserta.
William Hendradjaja, Chief of Business Skilvul, menyampaikan rasa bahagia karena akhirnya dapat membuka kesempatan variasi pelatihan keterampilan digital yang lebih menarik untuk lebih banyak orang di Indonesia. “Di balik esensi acara seperti ini, kita tidak hanya melihat pertukaran ilmu dengan mentor dan proses pembelajaran, tapi juga pertemuan dengan teman-teman dalam grup, membuat proyek menarik dan menyelesaikan tantangan. Pesan saya untuk teman-teman yang telah mengikuti program ini, ajaklah teman-teman lainnya untuk ikut serta dan menikmati keseruan belajar dalam program seperti ini,” ujar William.
Setelah melalui penilaian ketat oleh juri dari Skilvul, Biji-Biji Initiative, Kartu Prakerja, dan Microsoft, empat penghargaan dalam Skilvul Innovation Challenge Day Cycle 2 diberikan kepada tim berbeda:
Juara 1 diraih oleh tim Senyummu, yang menghadirkan aplikasi untuk mendeteksi penyakit dan kerusakan gigi melalui analisis foto gigi berbasis AI. Melalui aplikasi ini, pengguna dapat melakukan perawatan kesehatan gigi dengan lebih mudah, khususnya bagi masyarakat yang memiliki keterbatasan akses dan dana untuk rutin ke dokter gigi.
Juara 2 diberikan kepada tim SmartFish dan QuakeWatch, sebuah solusi yang dihadirkan untuk memberikan peringatan dini bahaya gempa, dan merekomendasikan lokasi tangkapan ikan serta variasinya.
Juara 3 diberikan kepada tim InWarung, sebuah solusi bagi pemilik UMKM untuk dapat melakukan prediksi inventaris warung berdasarkan jumlah pesanan aktual pembelian.
Penghargaan Booth Terbaik diraih oleh tim Diabetes Vision, yang menggunakan teknologi AI untuk mempermudah pengguna mendeteksi jumlah kandungan gula dalam makanan melalui unggahan foto.
Sebagai bagian dari persiapan kompetisi, sejumlah mentor industri dari perusahaan konsultan, perusahaan provider jaringan, serta perusahaan energi, turut diundang untuk memaparkan studi kasus dan membantu peserta dalam mengembangkan portfolio berbasis masalah sosial mereka. Portfolio tersebut selanjutnya dipresentasikan kepada mitra industri dengan harapan membuka peluang lebih besar untuk peserta memperoleh pekerjaan di bidang teknologi.
Supahrat Juramongkol, Philanthropies Lead Microsoft ASEAN menyampaikan, “Innovation Challenge Day adalah bukti dari potensi luar biasa yang ada pada diri generasi muda Indonesia, dalam memanfaatkan kekuatan teknologi untuk menciptakan perubahan di masyarakat. Apresiasi mendalam kepada semua peserta yang telah mencurahkan hati dan pikiran mereka untuk mengembangkan solusi inovatif bagi sejumlah tantangan paling mendesak yang dihadapi masyarakat kita saat ini. Saya percaya, semangat, dedikasi, dan kreativitas generasi muda Indonesia yang diperlihatkan dalam kompetisi ini, akan terus menciptakan dampak positif pada masyarakat, dan bahkan memberikan nilai ekonomi baru bagi Indonesia.”
Sebagai platform pembelajaran teknologi yang berfokus pada pengembangan keterampilan digital dan inovasi, Skilvul berkomitmen untuk membekali generasi muda Indonesia dengan keterampilan yang relevan di era digital. Skilvul memiliki misi membantu peserta program mengembangkan keahlian yang dibutuhkan untuk sukses di dunia kerja. Itulah sebabnya, program Skilvul Innovation Challenge tidak hanya berfokus pada pelatihan teknis dan sertifikasi, tetapi juga memberikan pendampingan karier berupa pengembangan soft skills, seperti komunikasi, kerja sama dalam tim, pemecahan masalah, dan design thinking.
Selain perwakilan Skilvul dan Microsoft, Innovation Challenge Day juga dihadiri oleh Rashvin Pal Singh, Group CEO Biji-Biji Initiative & Mereka, dan Maulana Okto Fitriadi, Head of Engineering PMO Kartu Prakerja yang memberikan sambutan sekaligus memotivasi para peserta.
###
How do I find the width of a curve at 1/e^2 but there are multiple points at this value
I am trying to find the width of a curve taken from the intensity vs x-index of an image (see below) at intensity = 1/e^2, essentially finding the beam diameter of a laser.
The resulting plot is:
The value of 1/e^2 is -3.55e4. Right now its calculating the width from the red points on the plot, but I’d like it to calculate the points from the green points. I’ve tried making it so it finds the points where the slope is negative, but that doesn’t seem to work. Even if you have an idea of how to do this that would be helpful, I can try to figure out the code from there. Still pretty new to matlab.
My code is:
clear
im=imread("D:THORS Imaging8.06.24Result of on_20000-off_20000.tif")
im=imrotate(im, -96,"bilinear")
im=imcrop(im, [200, 450, 700, 150]);
result=im
imshow(result)
%Sums pixel intensity in each verticle column
vertsum = sum(result, 1);
%Subtracts maximum intensity
vertsum =vertsum-max(vertsum);
%Sets threshold for baseline intensity
thresholdhigh = -100; %Threshold value chosen base on intensity of image
%Remove points above the threshold
vertsum = vertsum(vertsum <= thresholdhigh);
%Performs moving average on data
vertsum = movmean(vertsum,100);
%Sets data points fo create the Gaussian fit
[xData, yData] = prepareCurveData( [], vertsum );
%Sets conversion factor between pixels and cm
conversion = 3.5/1024;
%Convert pixels to cm
xcm = xData * conversion;
%Generates plot
plot(xcm, yData );
%% Find width of barrier
%Set the height of the fitted curve equal to the distance between 0 and the
%Height of intensity value
min = min(yData)
max=max(yData)
height=max-min
%Sets variable for 1/e^2, chosen due to gaussian shape of the beam
e = (1/((2.718281828459045)^2))
%Sets y-value on the curve at 1/e^2
pointY = max-(height * e)
%Finds nearest left side x-value on curve at 1/e^2
leftIndexWidth = find(yData <= pointY, 1, ‘first’)
%Finds nearest right side y-value on curve at 1/e^2
rightIndexWidth = find(yData <= pointY, 1, ‘last’)
%Converts pixel coordinate to cm
leftIndexWidth = leftIndexWidth * conversion
rightIndexWidth = rightIndexWidth * conversion
%Calculates width of curve at 1/e^2
widthpx = rightIndexWidth – leftIndexWidthI am trying to find the width of a curve taken from the intensity vs x-index of an image (see below) at intensity = 1/e^2, essentially finding the beam diameter of a laser.
The resulting plot is:
The value of 1/e^2 is -3.55e4. Right now its calculating the width from the red points on the plot, but I’d like it to calculate the points from the green points. I’ve tried making it so it finds the points where the slope is negative, but that doesn’t seem to work. Even if you have an idea of how to do this that would be helpful, I can try to figure out the code from there. Still pretty new to matlab.
My code is:
clear
im=imread("D:THORS Imaging8.06.24Result of on_20000-off_20000.tif")
im=imrotate(im, -96,"bilinear")
im=imcrop(im, [200, 450, 700, 150]);
result=im
imshow(result)
%Sums pixel intensity in each verticle column
vertsum = sum(result, 1);
%Subtracts maximum intensity
vertsum =vertsum-max(vertsum);
%Sets threshold for baseline intensity
thresholdhigh = -100; %Threshold value chosen base on intensity of image
%Remove points above the threshold
vertsum = vertsum(vertsum <= thresholdhigh);
%Performs moving average on data
vertsum = movmean(vertsum,100);
%Sets data points fo create the Gaussian fit
[xData, yData] = prepareCurveData( [], vertsum );
%Sets conversion factor between pixels and cm
conversion = 3.5/1024;
%Convert pixels to cm
xcm = xData * conversion;
%Generates plot
plot(xcm, yData );
%% Find width of barrier
%Set the height of the fitted curve equal to the distance between 0 and the
%Height of intensity value
min = min(yData)
max=max(yData)
height=max-min
%Sets variable for 1/e^2, chosen due to gaussian shape of the beam
e = (1/((2.718281828459045)^2))
%Sets y-value on the curve at 1/e^2
pointY = max-(height * e)
%Finds nearest left side x-value on curve at 1/e^2
leftIndexWidth = find(yData <= pointY, 1, ‘first’)
%Finds nearest right side y-value on curve at 1/e^2
rightIndexWidth = find(yData <= pointY, 1, ‘last’)
%Converts pixel coordinate to cm
leftIndexWidth = leftIndexWidth * conversion
rightIndexWidth = rightIndexWidth * conversion
%Calculates width of curve at 1/e^2
widthpx = rightIndexWidth – leftIndexWidth I am trying to find the width of a curve taken from the intensity vs x-index of an image (see below) at intensity = 1/e^2, essentially finding the beam diameter of a laser.
The resulting plot is:
The value of 1/e^2 is -3.55e4. Right now its calculating the width from the red points on the plot, but I’d like it to calculate the points from the green points. I’ve tried making it so it finds the points where the slope is negative, but that doesn’t seem to work. Even if you have an idea of how to do this that would be helpful, I can try to figure out the code from there. Still pretty new to matlab.
My code is:
clear
im=imread("D:THORS Imaging8.06.24Result of on_20000-off_20000.tif")
im=imrotate(im, -96,"bilinear")
im=imcrop(im, [200, 450, 700, 150]);
result=im
imshow(result)
%Sums pixel intensity in each verticle column
vertsum = sum(result, 1);
%Subtracts maximum intensity
vertsum =vertsum-max(vertsum);
%Sets threshold for baseline intensity
thresholdhigh = -100; %Threshold value chosen base on intensity of image
%Remove points above the threshold
vertsum = vertsum(vertsum <= thresholdhigh);
%Performs moving average on data
vertsum = movmean(vertsum,100);
%Sets data points fo create the Gaussian fit
[xData, yData] = prepareCurveData( [], vertsum );
%Sets conversion factor between pixels and cm
conversion = 3.5/1024;
%Convert pixels to cm
xcm = xData * conversion;
%Generates plot
plot(xcm, yData );
%% Find width of barrier
%Set the height of the fitted curve equal to the distance between 0 and the
%Height of intensity value
min = min(yData)
max=max(yData)
height=max-min
%Sets variable for 1/e^2, chosen due to gaussian shape of the beam
e = (1/((2.718281828459045)^2))
%Sets y-value on the curve at 1/e^2
pointY = max-(height * e)
%Finds nearest left side x-value on curve at 1/e^2
leftIndexWidth = find(yData <= pointY, 1, ‘first’)
%Finds nearest right side y-value on curve at 1/e^2
rightIndexWidth = find(yData <= pointY, 1, ‘last’)
%Converts pixel coordinate to cm
leftIndexWidth = leftIndexWidth * conversion
rightIndexWidth = rightIndexWidth * conversion
%Calculates width of curve at 1/e^2
widthpx = rightIndexWidth – leftIndexWidth fwhm, curve fitting MATLAB Answers — New Questions
How do I solve system of differentials using ode45 and eom functions
Hello and thank you for taking the time to read my question!
I am trying to solve a system of differential equations for analytically and then numerically for and and plot the two for comparison. I also have to analytically find tension T in terms of theta then numerically find it in terms of time. The given equations for motion in normal-tangiential form are , and . The starting position is at rad with m=2 kg, g=9.81 m/s^2, and r=0.5 m.
Below is my code so far. I keep getting an error trying to run the ode45 function saying that inputs must be floats, namely a single or double. I have to use the ode45 function as a requirment for the assignment, but I’m not sure if I have to use the eom bit.
Error:
Error using superiorfloat (line 13)
Inputs must be floats,
namely single or double.
Error in odearguments (line 114)
dataType = superiorfloat(t0,y0,f0);
Error in ode45 (line 104)
odearguments(odeIsFuncHandle,odeTreatAsMFile, solver_name, ode, tspan, y0, options, varargin);
Error in ESCI204_M1_Myers (line 74)
[T,S] = ode45(@eom,linspace(0,2,101),[0,0]);
Code:
%Givens:
theta0 = -pi/6;
m = 2;
g = 9.81;
r = 0.5;
syms Tens theta t thetaA
thetaA = linspace(-pi/6,pi/6,101);
% % DETERMINE ANALYTICALLY:————————————————
%Equation for angular velocity in terms of theta
thetadA = sqrt((-360*g/(pi*r))*(cos(theta0)-cos(thetaA)));
%Equation for Tension in terms of theta
TensA = 3*m*g*cos(thetaA)-2*m*g;
hold on
plot(thetaA,thetadA, ‘black’) %analytical solution for thetad(theta)
xlabel(‘Angular Position (rad) or time (t)’)
ylabel(‘Angular Velocity (rad/sec)’)
% % DETERMINE NUMERICALLY:
% 1) The angular velocity and angular position of the mass about point C
% as a function of time by integration of the equation of motion, thetadd
% 2) The tension in the string as a function of time.
function ds = eom(t,s) %S is current states – vector of current position and vel
%Givens:
theta0 = -pi/6;
m = 2;
g = 9.81;
r = 0.5;
syms Tens
ds(1,1) = sqrt((Tens-m*g*cos(s(1)))/(m*r)); % Derivative of position (s(1) = thetad
ds(2,1) = (-g*sin(s(1)))/r; % Derivative of velocity = thetadd
end
[T,S] = ode45(@eom,linspace(0,2,101),[0,0]);Hello and thank you for taking the time to read my question!
I am trying to solve a system of differential equations for analytically and then numerically for and and plot the two for comparison. I also have to analytically find tension T in terms of theta then numerically find it in terms of time. The given equations for motion in normal-tangiential form are , and . The starting position is at rad with m=2 kg, g=9.81 m/s^2, and r=0.5 m.
Below is my code so far. I keep getting an error trying to run the ode45 function saying that inputs must be floats, namely a single or double. I have to use the ode45 function as a requirment for the assignment, but I’m not sure if I have to use the eom bit.
Error:
Error using superiorfloat (line 13)
Inputs must be floats,
namely single or double.
Error in odearguments (line 114)
dataType = superiorfloat(t0,y0,f0);
Error in ode45 (line 104)
odearguments(odeIsFuncHandle,odeTreatAsMFile, solver_name, ode, tspan, y0, options, varargin);
Error in ESCI204_M1_Myers (line 74)
[T,S] = ode45(@eom,linspace(0,2,101),[0,0]);
Code:
%Givens:
theta0 = -pi/6;
m = 2;
g = 9.81;
r = 0.5;
syms Tens theta t thetaA
thetaA = linspace(-pi/6,pi/6,101);
% % DETERMINE ANALYTICALLY:————————————————
%Equation for angular velocity in terms of theta
thetadA = sqrt((-360*g/(pi*r))*(cos(theta0)-cos(thetaA)));
%Equation for Tension in terms of theta
TensA = 3*m*g*cos(thetaA)-2*m*g;
hold on
plot(thetaA,thetadA, ‘black’) %analytical solution for thetad(theta)
xlabel(‘Angular Position (rad) or time (t)’)
ylabel(‘Angular Velocity (rad/sec)’)
% % DETERMINE NUMERICALLY:
% 1) The angular velocity and angular position of the mass about point C
% as a function of time by integration of the equation of motion, thetadd
% 2) The tension in the string as a function of time.
function ds = eom(t,s) %S is current states – vector of current position and vel
%Givens:
theta0 = -pi/6;
m = 2;
g = 9.81;
r = 0.5;
syms Tens
ds(1,1) = sqrt((Tens-m*g*cos(s(1)))/(m*r)); % Derivative of position (s(1) = thetad
ds(2,1) = (-g*sin(s(1)))/r; % Derivative of velocity = thetadd
end
[T,S] = ode45(@eom,linspace(0,2,101),[0,0]); Hello and thank you for taking the time to read my question!
I am trying to solve a system of differential equations for analytically and then numerically for and and plot the two for comparison. I also have to analytically find tension T in terms of theta then numerically find it in terms of time. The given equations for motion in normal-tangiential form are , and . The starting position is at rad with m=2 kg, g=9.81 m/s^2, and r=0.5 m.
Below is my code so far. I keep getting an error trying to run the ode45 function saying that inputs must be floats, namely a single or double. I have to use the ode45 function as a requirment for the assignment, but I’m not sure if I have to use the eom bit.
Error:
Error using superiorfloat (line 13)
Inputs must be floats,
namely single or double.
Error in odearguments (line 114)
dataType = superiorfloat(t0,y0,f0);
Error in ode45 (line 104)
odearguments(odeIsFuncHandle,odeTreatAsMFile, solver_name, ode, tspan, y0, options, varargin);
Error in ESCI204_M1_Myers (line 74)
[T,S] = ode45(@eom,linspace(0,2,101),[0,0]);
Code:
%Givens:
theta0 = -pi/6;
m = 2;
g = 9.81;
r = 0.5;
syms Tens theta t thetaA
thetaA = linspace(-pi/6,pi/6,101);
% % DETERMINE ANALYTICALLY:————————————————
%Equation for angular velocity in terms of theta
thetadA = sqrt((-360*g/(pi*r))*(cos(theta0)-cos(thetaA)));
%Equation for Tension in terms of theta
TensA = 3*m*g*cos(thetaA)-2*m*g;
hold on
plot(thetaA,thetadA, ‘black’) %analytical solution for thetad(theta)
xlabel(‘Angular Position (rad) or time (t)’)
ylabel(‘Angular Velocity (rad/sec)’)
% % DETERMINE NUMERICALLY:
% 1) The angular velocity and angular position of the mass about point C
% as a function of time by integration of the equation of motion, thetadd
% 2) The tension in the string as a function of time.
function ds = eom(t,s) %S is current states – vector of current position and vel
%Givens:
theta0 = -pi/6;
m = 2;
g = 9.81;
r = 0.5;
syms Tens
ds(1,1) = sqrt((Tens-m*g*cos(s(1)))/(m*r)); % Derivative of position (s(1) = thetad
ds(2,1) = (-g*sin(s(1)))/r; % Derivative of velocity = thetadd
end
[T,S] = ode45(@eom,linspace(0,2,101),[0,0]); eom, ode45, code, error MATLAB Answers — New Questions
How to suspend execution until excel workbook 100% synced with Microsoft forms
I have a PowerShell script that’s extracting cell values from a table that’s synced to a Microsoft Form. However, when I run the script in the morning it’s extracting the cell values before the forms is 100% synced so I’m not getting all of the data from the day before.
I can sleep the script for maybe 20 seconds but is there a way to suspend execution of the script until the forms is 100% synced then immediately continue execution because sometimes it’s already synced and other times it’s not?
# create excel instance
$excel = new-object -comobject excel.application
# open excel workbook
try {
$workbook = $excel.Workbooks.Open($filePath, $true)
} catch {
throw “microsoft excel cannot access file -> please run the script again”
}
# set excel worksheet
$worksheet = $workbook.Sheets.Item(1)
# set excel table
$table = $worksheet.ListObjects.Item(“Form”)
# extract cell values
$values = @()
for ($i = 9; $i -le 15; $i++) {
foreach ($cell in $table.Range.Columns.Item($i).SpecialCells(12).Cells) {
$values += $cell.Value2 | Where-Object { $_ -match “^d” }
}
}
I have a PowerShell script that’s extracting cell values from a table that’s synced to a Microsoft Form. However, when I run the script in the morning it’s extracting the cell values before the forms is 100% synced so I’m not getting all of the data from the day before. I can sleep the script for maybe 20 seconds but is there a way to suspend execution of the script until the forms is 100% synced then immediately continue execution because sometimes it’s already synced and other times it’s not? # create excel instance
$excel = new-object -comobject excel.application
# open excel workbook
try {
$workbook = $excel.Workbooks.Open($filePath, $true)
} catch {
throw “microsoft excel cannot access file -> please run the script again”
}
# set excel worksheet
$worksheet = $workbook.Sheets.Item(1)
# set excel table
$table = $worksheet.ListObjects.Item(“Form”)
# extract cell values
$values = @()
for ($i = 9; $i -le 15; $i++) {
foreach ($cell in $table.Range.Columns.Item($i).SpecialCells(12).Cells) {
$values += $cell.Value2 | Where-Object { $_ -match “^d” }
}
} Read More
Use of Copilot in SharePoint
When will Copilot be available in SharePoint if you have a Copilot M365 license and is there any Microsoft material available hon how to use copilot in SharePoint
When will Copilot be available in SharePoint if you have a Copilot M365 license and is there any Microsoft material available hon how to use copilot in SharePoint Read More
Option Windows wird vorberetet bei neuem Rechnner beim ersten Mal einlogen
Hallo,
wie kann man es einstelen das Wilkommen und nach dem Windows wird vorbereitet beim Anemden bei jeden neuen Computer steht. Es funktioniert nur bei der alle ersten Anmeldung und dann nicht mehr.
Weißt es wie man es einstellen kann?
Das was ich meine ist in den Bildern.
VG maxi
Hallo, wie kann man es einstelen das Wilkommen und nach dem Windows wird vorbereitet beim Anemden bei jeden neuen Computer steht. Es funktioniert nur bei der alle ersten Anmeldung und dann nicht mehr. Weißt es wie man es einstellen kann? Das was ich meine ist in den Bildern.VG maxi Read More
Word Template is populating data however it is not on place as required
Good morning all!
My word template is populating data however it is not on place as required(with the power automate flow which is running automatically).
I made a flow to populate data on the template from SharePoint list or submitted with the power app.
Good morning all! My word template is populating data however it is not on place as required(with the power automate flow which is running automatically).I made a flow to populate data on the template from SharePoint list or submitted with the power app. Read More