Category: News
Enhancing Azure Files resilience and performance
Azure Files provides the best-in-class fully managed file share solution in the cloud. We are excited to showcase several new capabilities, some already launched and others upcoming, all aimed at enhancing your application reliability and performance, when using Azure Files.
Snapshot support for NFS File Shares
You can now take point-in-time snapshots of Azure File shares using NFS. This enables users to roll back their entire file share to a previous point in time or restore specific files that were accidentally deleted or corrupted. Customers can now perform share-level snapshot management via the Azure portal, REST API, Azure PowerShell, and Azure CLI. This feature is now available in all Azure public cloud regions. Get started with snapshots here.
Soft Delete Support for NFS File Shares
Soft delete which is currently available on SMB file shares will light up for NFS File Shares (soon to be in preview). This will enable you to easily recover data that may be mistakenly deleted by an application or due to user error. Soft delete for file shares is enabled at the storage account level and will apply to all file shares (incl. SMB and NFS) within a storage account. Soft delete is enabled by default for new storage accounts and can be disabled or enabled at any time. Soft delete is not automatically enabled for existing storage accounts. Keep an eye on the what’s new page for the upcoming announcement.
Geo-redundancy for large file shares
Geo-redundancy is now supported for large file shares using SMB. Previously, Azure Files provided 100 TiB standard SMB shares with both locally redundant storage (LRS) and zone-redundant storage (ZRS). However, geo-redundant file shares had a 5 TiB capacity limit and were also limited on IO operations per second (IOPS) and throughput. Now, geo-redundant standard SMB file shares support up to 100 TiB capacity with higher IOPS and throughput limits. Geo-redundancy is vital for meeting various compliance and regulatory requirements, as it allows for asynchronous replication to a secondary region and the ability to initiate a failover if the primary region becomes unavailable. This advancement ensures a more robust and compliant data storage solution for Azure Files users. To get started, please read the documentation.
Vaulted Backups for Azure Files
You can now protect business-critical data stored in Azure Files from data loss with backup vaults for Azure Files. A vault is a logical entity that stores the backups and recovery points created over time. You can now define a schedule and retention policy in Azure Backup to manage the lifecycle and automate off-site backups.
Key benefits of vaulted backups:
An off-site copy of data that can be used to recover if source data is compromised.
Protection against accidental or malicious deletion of specific containers or the entire source storage account.
Long-term retention of backup data for up to 10 years to meet compliance requirements.
Vaulted backups feature for Azure Files is currently in public preview. Read the public preview announcement and click here to get started.
Metadata Caching for Premium SMB File Shares
Azure Files users running metadata-heavy workloads will now be able to achieve lower latency for file workloads running on Windows/Linux clients. Workloads will also experience consistent latency making metadata-intensive workloads more predictable and deterministic. This will assist customers with running workloads that are heavy in Metadata IO, which include:
WebApp Services: Frequently accessed files for CMSLMS services such as MoodleWordPress.
IndexingBatch Jobs: Large scale processing using Azure Kubernetes or Azure Batch.
Virtual Desktop Infrastructure: Azure Virtual DesktopCitrix users with home directories or VDI applications with general purpose file system needs.
How to get started: Read the full announcement here. Please sign up here and provide your details.
Faster server provisioning and disaster recovery for Azure File Sync servers
With Azure File Sync you can now provision new server endpoints and recover from sync server failures at a significantly faster pace. This enhancement is particularly beneficial for Azure File Sync topologies with cloud endpoints associated with Azure File Shares containing more than 10 million files and folders, although it will positively impact all sizes.
This feature allows customers faster access to data when they add the first server endpoint to their sync topology, expand their existing topology with an additional server endpoint, or when recovering from a disaster. It will be available in a limited public preview with the release of the Azure File Sync v18 agent. This update is designed to provide a more efficient experience for all Azure File Sync users. Please sign up here for public preview.
Increased max file size support to 8 TiB
Previously Azure Files supported a max file size of 4 TiB, support for up to 8 TiB max file size is now in preview. To participate in the preview, email us and provide your subscription id to get access.
Share Your Feedback
Your feedback is invaluable to us as it shapes and refines Azure Files. Please take a moment to share your feedback with us.
Microsoft Tech Community – Latest Blogs –Read More
How do I close an open instrument handle following an error?
I’m using MATLAB 2018a on Windows 10 Enterprise.
I’m writing code to talk to and read from instruments that are on a LAN interface.
I use commands similar to:
instrOfInterest_handle = visa(‘agilent’, sprintf(‘TCIP0::%s::instr0::INSTR, IpAddressStruct.instrOfInterest)
to find the instrument handle, and then commands similar to:
fopen(instrOfInterest_handle);
to open communication with the instrument.
I normally close the communication with a command similar to
fclose(instrOfInterest_handle);
However, since I’m writing / developing the code, sometimes I make mistakes and the program I’m developing halts in an error state, before running the command to close the communcations.
When that happens, I’m unable to re-open the communication channel to the instrument. Instead, I get an error similar to:
Warning: : Unsuccessful open: The specified configuration:
TCPIP0::IpAddressOfInterest::inst0::INSTR is not available
Use INSTRHWINFO for a list of available configurations. Use INSTRFIND to determine if other instrument objects are connected to the requested instrument.
If I was getting an error similar to this when trying to write to a file, I’d run the
fclose(‘all’);
command. However, there doesn’t appear to be anything similar when writing to instruments.
The only way I’ve figured out to be able to re-open the communications channel to the instrument is to kill off MATLAB and then restart it.
I figure there has to be a better way; I just don’t know what that better way is.I’m using MATLAB 2018a on Windows 10 Enterprise.
I’m writing code to talk to and read from instruments that are on a LAN interface.
I use commands similar to:
instrOfInterest_handle = visa(‘agilent’, sprintf(‘TCIP0::%s::instr0::INSTR, IpAddressStruct.instrOfInterest)
to find the instrument handle, and then commands similar to:
fopen(instrOfInterest_handle);
to open communication with the instrument.
I normally close the communication with a command similar to
fclose(instrOfInterest_handle);
However, since I’m writing / developing the code, sometimes I make mistakes and the program I’m developing halts in an error state, before running the command to close the communcations.
When that happens, I’m unable to re-open the communication channel to the instrument. Instead, I get an error similar to:
Warning: : Unsuccessful open: The specified configuration:
TCPIP0::IpAddressOfInterest::inst0::INSTR is not available
Use INSTRHWINFO for a list of available configurations. Use INSTRFIND to determine if other instrument objects are connected to the requested instrument.
If I was getting an error similar to this when trying to write to a file, I’d run the
fclose(‘all’);
command. However, there doesn’t appear to be anything similar when writing to instruments.
The only way I’ve figured out to be able to re-open the communications channel to the instrument is to kill off MATLAB and then restart it.
I figure there has to be a better way; I just don’t know what that better way is. I’m using MATLAB 2018a on Windows 10 Enterprise.
I’m writing code to talk to and read from instruments that are on a LAN interface.
I use commands similar to:
instrOfInterest_handle = visa(‘agilent’, sprintf(‘TCIP0::%s::instr0::INSTR, IpAddressStruct.instrOfInterest)
to find the instrument handle, and then commands similar to:
fopen(instrOfInterest_handle);
to open communication with the instrument.
I normally close the communication with a command similar to
fclose(instrOfInterest_handle);
However, since I’m writing / developing the code, sometimes I make mistakes and the program I’m developing halts in an error state, before running the command to close the communcations.
When that happens, I’m unable to re-open the communication channel to the instrument. Instead, I get an error similar to:
Warning: : Unsuccessful open: The specified configuration:
TCPIP0::IpAddressOfInterest::inst0::INSTR is not available
Use INSTRHWINFO for a list of available configurations. Use INSTRFIND to determine if other instrument objects are connected to the requested instrument.
If I was getting an error similar to this when trying to write to a file, I’d run the
fclose(‘all’);
command. However, there doesn’t appear to be anything similar when writing to instruments.
The only way I’ve figured out to be able to re-open the communications channel to the instrument is to kill off MATLAB and then restart it.
I figure there has to be a better way; I just don’t know what that better way is. fclose, instruments MATLAB Answers — New Questions
extracting values from an image with color legend
howdy folks,
I want to extract numerical values from this figure. each circle is a fuel rod, that has a "power peaking factor" I would like to obtain a numerical value for that.howdy folks,
I want to extract numerical values from this figure. each circle is a fuel rod, that has a "power peaking factor" I would like to obtain a numerical value for that. howdy folks,
I want to extract numerical values from this figure. each circle is a fuel rod, that has a "power peaking factor" I would like to obtain a numerical value for that. extracting numerical values from figures, image-processing, colors to numbers MATLAB Answers — New Questions
Unable to delete files following a reduction in OneDrive space
Hello everyone, I’m explaining my problem: I work as a teacher in a public school and our Ministry of National Education has partnered with Microsoft to provide a Microsoft school account for each teacher, an account that entitles you to an Office Pro license and a 2TB OneDrive space. I took advantage of this space to save my professional and personal files which took up almost half of this space, 1TB.
Last week and for an unknown reason, the OneDrive space was reduced to 100GB instead of 2TB so I found myself with a OneDrive space saturated at 1090% and so I no longer have the possibility to delete, add or modify files! When I try to delete a file the following message appears on the screen “this site has exceeded the maximum storage limit for files to free up space delete unnecessary files and empty the trash” the problem is that the trash is empty and I can no longer delete files because of this message that appears on the screen! And on my computer when I delete a file in the OneDrive folder it immediately re-downloads so I can neither delete files directly on the OneDrive site nor delete them from the OneDrive folder on my computer! I have dissociated OneDrive from my computer and I have completely uninstalled OneDrive and despite all this I cannot delete files on the OneDrive site and the trash is still empty! The IT manager in my school doesn’t understand anything and doesn’t know what to do. Can you help me please?
Hello everyone, I’m explaining my problem: I work as a teacher in a public school and our Ministry of National Education has partnered with Microsoft to provide a Microsoft school account for each teacher, an account that entitles you to an Office Pro license and a 2TB OneDrive space. I took advantage of this space to save my professional and personal files which took up almost half of this space, 1TB.Last week and for an unknown reason, the OneDrive space was reduced to 100GB instead of 2TB so I found myself with a OneDrive space saturated at 1090% and so I no longer have the possibility to delete, add or modify files! When I try to delete a file the following message appears on the screen “this site has exceeded the maximum storage limit for files to free up space delete unnecessary files and empty the trash” the problem is that the trash is empty and I can no longer delete files because of this message that appears on the screen! And on my computer when I delete a file in the OneDrive folder it immediately re-downloads so I can neither delete files directly on the OneDrive site nor delete them from the OneDrive folder on my computer! I have dissociated OneDrive from my computer and I have completely uninstalled OneDrive and despite all this I cannot delete files on the OneDrive site and the trash is still empty! The IT manager in my school doesn’t understand anything and doesn’t know what to do. Can you help me please? Read More
Loosing access to the migrated videos – Help!
Is this happening to anyone else? My team migrated our videos via Global Help Desk but we are getting this issue now where the videos are not displayed and if you click on them you cannot see them either. This happened before but fixed by itself, how can I find the right team to help us?
Is this happening to anyone else? My team migrated our videos via Global Help Desk but we are getting this issue now where the videos are not displayed and if you click on them you cannot see them either. This happened before but fixed by itself, how can I find the right team to help us?
JSON formatting preload all items
Is there a way for SharePoint to load all items? I have a contact list of less than 200 and using the JSON formatting from this github
List-Formatting/view-samples/content-navigator at master · pnp/List-Formatting · GitHub
My contact list has Subject Area, Contact Person (email, phone#, job title, etc.), Notes, and General mailbox information.
Basically, I followed the above sample JSON and created 2 views:
#1 – only displays the Subject Areas
#2 – displays the rest of the contact details
On a page, I added 2 web parts to call each list view. It works well but only up to a certain item. Once I scrolled down on webpart #1, clicking an item no longer updates the information on webpart #2. Even after increasing the item limit on each view.
Is there a way for SharePoint to load all items? I have a contact list of less than 200 and using the JSON formatting from this githubList-Formatting/view-samples/content-navigator at master · pnp/List-Formatting · GitHubMy contact list has Subject Area, Contact Person (email, phone#, job title, etc.), Notes, and General mailbox information. Basically, I followed the above sample JSON and created 2 views:#1 – only displays the Subject Areas#2 – displays the rest of the contact detailsOn a page, I added 2 web parts to call each list view. It works well but only up to a certain item. Once I scrolled down on webpart #1, clicking an item no longer updates the information on webpart #2. Even after increasing the item limit on each view. Read More
Video – Demo of Community Training Platform (Learning Management System)
Empowering Non-Profit Organizations Through Community Training Platform
Organizations are increasingly turning to innovative solutions to enhance their impact and reach. One such solution is the adoption of Community Training platform.
Community Training offers a unique opportunity for non-profits to train volunteers, staff, and the communities they serve, in a scalable and efficient manner.
The Need for Training in Non-Profits
Non-profit organizations often operate in environments that require a diverse set of skills and knowledge. From fundraising and management to field-specific expertise, the need for continuous learning and development is critical. However, traditional training methods can be costly and time-consuming, making them less feasible for non-profits with limited resources.
Community Training Platforms: A Game-Changer
Community training platform is an online environment where learning materials can be created, shared, and accessed by anyone with an internet connection. These platforms support a variety of content formats, including text, images, and videos, making them versatile tools for education and training.
Benefits for Non-Profit Organizations
Cost-Effective: By reducing the need for physical training materials and venues, non-profits can save on overhead costs.
Accessible: Training can be accessed by anyone, anywhere, as long as they have internet access, breaking down geographical barriers.
Customizable: Content can be tailored to meet the specific needs of the organization and the communities they serve.
Trackable: Progress and completion of training modules can be monitored, providing valuable data on the effectiveness of the training.
Community training platform represent a significant opportunity for non-profit organizations to enhance their training capabilities. By leveraging this platform, non-profits can ensure that their teams are well-equipped with the knowledge and skills necessary to achieve their mission. With the added flexibility and accessibility, community training platforms are set to become a staple in the non-profit sector.
Note: A video demonstration of a community training platform in action offers you a visual and practical example of how these platforms can be utilized.
Helpful links
Interactive Demo
Pricing
Steps to setup Community Training Platform
Microsoft Tech Community – Latest Blogs –Read More
Partner Blog | New Copilot+ PCs bring partner opportunity
Our guest contributor for today’s blog is Mark Linton, Vice President, Device Partner Sales at Microsoft.
Today on our Microsoft campus we introduced the world to an entirely new category of Windows PCs designed for AI, Copilot+ PCs. Our device partners joined us at the launch event to showcase their latest PC designs. After years partnering together on the design and engineering of this amazing portfolio, I am incredibly proud of the innovation on display today. The new scenarios, experiences and solutions for customers enabled by this new AI generation of computing will be transformative, as are the partner opportunities created for our ecosystem around the world.
Copilot+ PCs are the fastest, most intelligent Windows PCs ever built. With powerful new silicon capable of an incredible 40+ NPU TOPS (trillion operations per second), they offer efficient AI workload processing at the edge. Today, we featured designs powered with Snapdragon X Elite and Snapdragon X Plus processors. We’re thrilled to begin this journey with Qualcomm Technologies, Inc. on their latest processors for the Windows platform — and we’re excited for the innovation coming from our partners at AMD and Intel over the coming months.
These Copilot+ PCs are a game-changer, and we’re leading the industry with the scale only the Microsoft ecosystem can provide. The partner opportunities created by this technology shift are significant.
With Copilot+ PCs, device partners can build next generation hardware equipped with on board capability, enabling customers to benefit from AI software, tools and experiences running at the edge, as well as in the cloud. Here is the device portfolio our partners announced today:
Continue reading here
Microsoft Tech Community – Latest Blogs –Read More
How To Control Azure OpenAI Models
The first step is to choose the correct model and configure its parameters appropriately. Depending on your use case, you need to determine which model can deliver the best quality. This requires knowledge of the available models and their capabilities. Once you have selected the right model, focus on the parameters. For instance, setting the temperature to 0 will prevent the model from generating creative responses. Another important parameter is the max_token parameter which is crucial for optimizing latency performance. For retrieval-augmented generation use cases, it can be set a value between 500 to 800 tokens as a best practice. This parameter also affects the number of API calls you can make per minute, so finding the optimal value is essential. Additionally, the stop_sequence parameter allows you to define when the model should stop. You need to review and adjust other parameters as needed to ensure they meet the requirements of your use case.
After selecting the correct model and configuring its parameters appropriately, the next step is prompt engineering. What is prompt engineering? Prompt engineering is the process of improving the quality of prompts through various techniques. It is essential to understand prompt engineering techniques thoroughly and how to refine your prompts iteratively to achieve the best results.
The quality of the input prompts we send to Azure OpenAI models directly influences the quality of the responses we receive. Prompts are the text inputs that define our expectations, and the output generated by the model depends on the prompt. Outputs can include completions, conversations, or embeddings, depending on the Azure OpenAI model used. Azure OpenAI models use natural language instructions and examples in the prompt to identify the task. The model then completes the task by predicting the most probable next text. This technique is known as “in-context” learning, which operates without altering the actual weights of the model.
Let’s explore the best practices:
There are zero-shot, one-shot, and few-shot learning techniques:
Zero-shot: Predicting with no sample provided.
One-shot: Predicting with one sample provided.
Few-shot: Predicting with a few samples provided.
When using the few-shot learning technique, the models are not retrained in the traditional machine learning sense. Instead, they calculate predictions based on the context included in the prompt. There is no change in the model’s weights; the examples are learned on the spot.
2. Place instructions at the beginning of the prompt, and use ### or “”” (any special characters) to separate the instructions from the context.
3. Be specific, descriptive, and detailed about the desired context, outcome, length, format, style, etc. For instance, you have to use responsible ai instructions in your meta prompt.
4. Break complex tasks into simpler subtasks.
5. Instead of merely stating what not to do, clearly specify what to do.
6. Prompt the model to explain its reasoning before providing an answer (chain of thoughts).
7. Expand the model’s knowledge by integrating other tools.
After executing these two steps, evaluate whether you are satisfied with the outputs and accuracy. If not, consider whether your use case involves Retrieval-Augmented Generation (RAG). Specifically, ask yourself if you need to use your data to answer questions or generate content. If the answer is yes, then you need to implement the RAG pattern. RAG is a feature that enables you to harness the power of Large Language Models (LLMs) with your enterprise data. With RAG, you can use Azure OpenAI (AOAI) to generate text, summarize information, and chat in the context of your customer’s knowledge base, effectively grounding the data. This technique allows the same LLM model to function as a reasoning engine over new data, enabling in-context learning. By providing the context in your prompt and instructing AOAI to answer based solely on the given context, you ensure more accurate and relevant responses.
Lets assume that you’ve tried all three steps: selected the correct model, set the appropriate parameters, and applied proper prompt engineering techniques and also checked if your use case is suitable for RAG. However, if you still struggle with accuracy, it may be necessary to modify the behavior of the LLM through supervised fine-tuning (SFT). In these situations, you will need an SFT dataset, which is a collection of prompts and their corresponding responses. These datasets can be manually curated by users or generated by other LLMs. Your fine-tuned Azure OpenAI models will be available exclusively for your use, ensuring tailored performance to meet your specific requirements.
Furthermore, you may also consider using RAG with your fine-tuned model. Combining RAG with a fine-tuned model can help you achieve higher accuracy and better performance tailored to your specific needs.
In light of this, when presented with a GenAI utilization scenario, it becomes imperative to methodically contemplate each sequential step as part of a structured cognitive process. This approach aims to identify and implement the most effective solution with a focus on achieving optimal performance metrics.
Microsoft Tech Community – Latest Blogs –Read More
Numerical Simulation of a Damped, Driven Nonlinear Wave System with Spatially Extended Initial Conditions
The equation is:
We consider spatially extended initial conditions of the form:
where is the distance of the grid and is the amplitude of the initial condition
We also assume zero initial velocity:
I am trying to create the following plots but as you can see my code doesn;t give these results. Any sugestions?
% Parameters
K = 99;
L = 200;
beta = 1;
delta = 0.05;
omega_d = 1;
h = L / (K + 1);
Omega_d_squared = h^2 * omega_d^2;
hat_delta = h * delta;
% Discrete Laplacian
laplacian = @(U) [U(2) – 2*U(1) + U(1); U(3:end) – 2*U(2:end-1) + U(1:end-2); U(end) – 2*U(end) + U(end-1)];
% Differential Equation
equation = @(t, U_flat) [U_flat(K+1:end); laplacian(U_flat(1:K)) – hat_delta * U_flat(K+1:end) + Omega_d_squared * (U_flat(1:K) – beta * U_flat(1:K).^2)];
% Initial Conditions Function
initial_conditions = @(a) [a * sin(pi * (1:K)’ * h / L); zeros(K, 1)];
% Time Span
t_span = [0 3000];
t_eval = linspace(0, 3000, 600);
% Solver options
options = odeset(‘RelTol’,1e-4, ‘AbsTol’,1e-6);
% Amplitudes to test
amplitudes = [2, 1.95, 1.9, 1.85, 1.82];
% Create Subplots
figure;
for i = 1:length(amplitudes)
a = amplitudes(i);
U0 = initial_conditions(a);
[t, U_flat] = ode15s(@(t, U_flat) equation(t, U_flat), t_eval, U0, options);
U = U_flat(:, 1:K);
subplot(3, 2, i);
plot(t, U(:, round(K/2)), ‘DisplayName’, [‘a=’ num2str(a)]);
title([‘a=’ num2str(a)]);
xlabel(‘t’);
ylabel(‘U_n’);
legend;
% Zoom-in subplot
ax = axes(‘Position’, [.15 + mod(i-1,2)*.45 .65 – floor((i-1)/2)*.35 .2 .2]);
plot(ax, 1:K, U(end, :), ‘bo-‘);
title(ax, [‘t=’ num2str(t_span(end))]);
xlabel(ax, ‘x_n’);
ylabel(ax, ‘U_n’);
end
% Hide unused subplot
subplot(3, 2, 6); % Placeholder for unused subplot
axis off; % Turn off the axis for the unused subplot
% Adjust layout
sgtitle(‘Dynamics for initial condition and various amplitude values’);
% Hide unused subplot
subplot(3, 2, 6); % Placeholder for unused subplot
axis off; % Turn off the axis for the unused subplot
% Adjust layout
sgtitle(‘Dynamics for initial condition and various amplitude values’);The equation is:
We consider spatially extended initial conditions of the form:
where is the distance of the grid and is the amplitude of the initial condition
We also assume zero initial velocity:
I am trying to create the following plots but as you can see my code doesn;t give these results. Any sugestions?
% Parameters
K = 99;
L = 200;
beta = 1;
delta = 0.05;
omega_d = 1;
h = L / (K + 1);
Omega_d_squared = h^2 * omega_d^2;
hat_delta = h * delta;
% Discrete Laplacian
laplacian = @(U) [U(2) – 2*U(1) + U(1); U(3:end) – 2*U(2:end-1) + U(1:end-2); U(end) – 2*U(end) + U(end-1)];
% Differential Equation
equation = @(t, U_flat) [U_flat(K+1:end); laplacian(U_flat(1:K)) – hat_delta * U_flat(K+1:end) + Omega_d_squared * (U_flat(1:K) – beta * U_flat(1:K).^2)];
% Initial Conditions Function
initial_conditions = @(a) [a * sin(pi * (1:K)’ * h / L); zeros(K, 1)];
% Time Span
t_span = [0 3000];
t_eval = linspace(0, 3000, 600);
% Solver options
options = odeset(‘RelTol’,1e-4, ‘AbsTol’,1e-6);
% Amplitudes to test
amplitudes = [2, 1.95, 1.9, 1.85, 1.82];
% Create Subplots
figure;
for i = 1:length(amplitudes)
a = amplitudes(i);
U0 = initial_conditions(a);
[t, U_flat] = ode15s(@(t, U_flat) equation(t, U_flat), t_eval, U0, options);
U = U_flat(:, 1:K);
subplot(3, 2, i);
plot(t, U(:, round(K/2)), ‘DisplayName’, [‘a=’ num2str(a)]);
title([‘a=’ num2str(a)]);
xlabel(‘t’);
ylabel(‘U_n’);
legend;
% Zoom-in subplot
ax = axes(‘Position’, [.15 + mod(i-1,2)*.45 .65 – floor((i-1)/2)*.35 .2 .2]);
plot(ax, 1:K, U(end, :), ‘bo-‘);
title(ax, [‘t=’ num2str(t_span(end))]);
xlabel(ax, ‘x_n’);
ylabel(ax, ‘U_n’);
end
% Hide unused subplot
subplot(3, 2, 6); % Placeholder for unused subplot
axis off; % Turn off the axis for the unused subplot
% Adjust layout
sgtitle(‘Dynamics for initial condition and various amplitude values’);
% Hide unused subplot
subplot(3, 2, 6); % Placeholder for unused subplot
axis off; % Turn off the axis for the unused subplot
% Adjust layout
sgtitle(‘Dynamics for initial condition and various amplitude values’); The equation is:
We consider spatially extended initial conditions of the form:
where is the distance of the grid and is the amplitude of the initial condition
We also assume zero initial velocity:
I am trying to create the following plots but as you can see my code doesn;t give these results. Any sugestions?
% Parameters
K = 99;
L = 200;
beta = 1;
delta = 0.05;
omega_d = 1;
h = L / (K + 1);
Omega_d_squared = h^2 * omega_d^2;
hat_delta = h * delta;
% Discrete Laplacian
laplacian = @(U) [U(2) – 2*U(1) + U(1); U(3:end) – 2*U(2:end-1) + U(1:end-2); U(end) – 2*U(end) + U(end-1)];
% Differential Equation
equation = @(t, U_flat) [U_flat(K+1:end); laplacian(U_flat(1:K)) – hat_delta * U_flat(K+1:end) + Omega_d_squared * (U_flat(1:K) – beta * U_flat(1:K).^2)];
% Initial Conditions Function
initial_conditions = @(a) [a * sin(pi * (1:K)’ * h / L); zeros(K, 1)];
% Time Span
t_span = [0 3000];
t_eval = linspace(0, 3000, 600);
% Solver options
options = odeset(‘RelTol’,1e-4, ‘AbsTol’,1e-6);
% Amplitudes to test
amplitudes = [2, 1.95, 1.9, 1.85, 1.82];
% Create Subplots
figure;
for i = 1:length(amplitudes)
a = amplitudes(i);
U0 = initial_conditions(a);
[t, U_flat] = ode15s(@(t, U_flat) equation(t, U_flat), t_eval, U0, options);
U = U_flat(:, 1:K);
subplot(3, 2, i);
plot(t, U(:, round(K/2)), ‘DisplayName’, [‘a=’ num2str(a)]);
title([‘a=’ num2str(a)]);
xlabel(‘t’);
ylabel(‘U_n’);
legend;
% Zoom-in subplot
ax = axes(‘Position’, [.15 + mod(i-1,2)*.45 .65 – floor((i-1)/2)*.35 .2 .2]);
plot(ax, 1:K, U(end, :), ‘bo-‘);
title(ax, [‘t=’ num2str(t_span(end))]);
xlabel(ax, ‘x_n’);
ylabel(ax, ‘U_n’);
end
% Hide unused subplot
subplot(3, 2, 6); % Placeholder for unused subplot
axis off; % Turn off the axis for the unused subplot
% Adjust layout
sgtitle(‘Dynamics for initial condition and various amplitude values’);
% Hide unused subplot
subplot(3, 2, 6); % Placeholder for unused subplot
axis off; % Turn off the axis for the unused subplot
% Adjust layout
sgtitle(‘Dynamics for initial condition and various amplitude values’); plot, plotting, differential equations, subplot, equation MATLAB Answers — New Questions
How do you apply a rotating (in time) 2d gaussian function to a round plate with a center hole, my script does not seem to rotate the function?
clear all
close all
model=createpde(‘thermal’,’transient’)
geo=multicylinder([1/2,4/2],0.04,"Void",[1,0])
model.Geometry = geo;
pdegplot(model,’FaceLabels’,’on’,’CellLabels’,’on’);grid on
generateMesh(model,’Hmax’,0.1)
pdeplot3d(model)
thermalProperties(model,’ThermalConductivity’,2.1,…
‘MassDensity’,1050,…
‘SpecificHeat’,822)
a = linspace(-2,2,200);
b = linspace(-2,2,200);
time = linspace(0,100,1);
[x,y] = meshgrid(a,b)
state.time = meshgrid(time)
location.x = x;
location.y = y;
thermalIC(model,22)
thermalBC(model,’Face’,1,’Temperature’,22)
thermalBC(model,’Face’,2,’HeatFlux’,@externalHeatFlux)
pdeplot3d(model)
t=0:1:180
state.time = t;
modelresults = solve(model,t)
figure
for n=1:numel(modelresults.SolutionTimes)
pdeplot3d(model.mesh,"ColorMapData",modelresults.Temperature(:,n))
drawnow
pause(0.2)
end
function flux=externalHeatFlux(location,state)
t = state.time
A = 1;
x0 = 0;
y0 = 0;
sx = 0.5;
sy = 2;
for index=1:length(t)
ang = index-1;
flux(:,:,index) = imrotate(A*exp(-(((location.x-x0).^2/(2*sx^2)) +…
((location.y-y0).^2/(2*sy^2)))).*exp(-t(index)),ang,’crop’)
end
endclear all
close all
model=createpde(‘thermal’,’transient’)
geo=multicylinder([1/2,4/2],0.04,"Void",[1,0])
model.Geometry = geo;
pdegplot(model,’FaceLabels’,’on’,’CellLabels’,’on’);grid on
generateMesh(model,’Hmax’,0.1)
pdeplot3d(model)
thermalProperties(model,’ThermalConductivity’,2.1,…
‘MassDensity’,1050,…
‘SpecificHeat’,822)
a = linspace(-2,2,200);
b = linspace(-2,2,200);
time = linspace(0,100,1);
[x,y] = meshgrid(a,b)
state.time = meshgrid(time)
location.x = x;
location.y = y;
thermalIC(model,22)
thermalBC(model,’Face’,1,’Temperature’,22)
thermalBC(model,’Face’,2,’HeatFlux’,@externalHeatFlux)
pdeplot3d(model)
t=0:1:180
state.time = t;
modelresults = solve(model,t)
figure
for n=1:numel(modelresults.SolutionTimes)
pdeplot3d(model.mesh,"ColorMapData",modelresults.Temperature(:,n))
drawnow
pause(0.2)
end
function flux=externalHeatFlux(location,state)
t = state.time
A = 1;
x0 = 0;
y0 = 0;
sx = 0.5;
sy = 2;
for index=1:length(t)
ang = index-1;
flux(:,:,index) = imrotate(A*exp(-(((location.x-x0).^2/(2*sx^2)) +…
((location.y-y0).^2/(2*sy^2)))).*exp(-t(index)),ang,’crop’)
end
end clear all
close all
model=createpde(‘thermal’,’transient’)
geo=multicylinder([1/2,4/2],0.04,"Void",[1,0])
model.Geometry = geo;
pdegplot(model,’FaceLabels’,’on’,’CellLabels’,’on’);grid on
generateMesh(model,’Hmax’,0.1)
pdeplot3d(model)
thermalProperties(model,’ThermalConductivity’,2.1,…
‘MassDensity’,1050,…
‘SpecificHeat’,822)
a = linspace(-2,2,200);
b = linspace(-2,2,200);
time = linspace(0,100,1);
[x,y] = meshgrid(a,b)
state.time = meshgrid(time)
location.x = x;
location.y = y;
thermalIC(model,22)
thermalBC(model,’Face’,1,’Temperature’,22)
thermalBC(model,’Face’,2,’HeatFlux’,@externalHeatFlux)
pdeplot3d(model)
t=0:1:180
state.time = t;
modelresults = solve(model,t)
figure
for n=1:numel(modelresults.SolutionTimes)
pdeplot3d(model.mesh,"ColorMapData",modelresults.Temperature(:,n))
drawnow
pause(0.2)
end
function flux=externalHeatFlux(location,state)
t = state.time
A = 1;
x0 = 0;
y0 = 0;
sx = 0.5;
sy = 2;
for index=1:length(t)
ang = index-1;
flux(:,:,index) = imrotate(A*exp(-(((location.x-x0).^2/(2*sx^2)) +…
((location.y-y0).^2/(2*sy^2)))).*exp(-t(index)),ang,’crop’)
end
end time dependent heat flux, rotating heat flux MATLAB Answers — New Questions
How to read the .inp file generated in gmsh for extracting the Nodal coordinates and element connectivity of the mesh.
I have a 2D structured mesh of a 2D domain, as shown, generated by gmsh, an open source meshing software. After generating the mesh, I exported the file as .inp file, which I have attached.
From the line no. 373 to 596, are the element nodal connectivity. which I have to extract
From line no. 4 to 272, are the (x,y) coordinate of each node. which also have to be extracted.
kindly help me on extracting these info and placing them in an array variables.I have a 2D structured mesh of a 2D domain, as shown, generated by gmsh, an open source meshing software. After generating the mesh, I exported the file as .inp file, which I have attached.
From the line no. 373 to 596, are the element nodal connectivity. which I have to extract
From line no. 4 to 272, are the (x,y) coordinate of each node. which also have to be extracted.
kindly help me on extracting these info and placing them in an array variables. I have a 2D structured mesh of a 2D domain, as shown, generated by gmsh, an open source meshing software. After generating the mesh, I exported the file as .inp file, which I have attached.
From the line no. 373 to 596, are the element nodal connectivity. which I have to extract
From line no. 4 to 272, are the (x,y) coordinate of each node. which also have to be extracted.
kindly help me on extracting these info and placing them in an array variables. file handling, matrix, finite element method, mathematics, meshing, machine learning, arrays MATLAB Answers — New Questions
Microsoft 365 Updates Monthly Channel
We are currently experiencing challenges with updating our devices via Intune using Microsoft 365 Apps for Windows 10 and later. Initially, our update channel was set to “Monthly Channel.” However, upon attempting manual updates by users, the system would unexpectedly roll back to version 2311. In response to this issue, we reverted the update channel back to the “Current Channel” in alignment with Microsoft’s recommendations.
Subsequently, some users who remain on version 2311 are encountering difficulties updating to the April 2024 or May 2024 versions. Despite attempting manual updates, the system erroneously indicates that the software is up to date.
We urgently seek clarification on the following matters:
Why are users on version 2311 unable to update to the latest versions for April 2024 or May 2024?
Why does the system incorrectly report that users are up to date when attempting manual updates in the Monthly Channel, leading to rollbacks to older versions?
We are currently experiencing challenges with updating our devices via Intune using Microsoft 365 Apps for Windows 10 and later. Initially, our update channel was set to “Monthly Channel.” However, upon attempting manual updates by users, the system would unexpectedly roll back to version 2311. In response to this issue, we reverted the update channel back to the “Current Channel” in alignment with Microsoft’s recommendations. Subsequently, some users who remain on version 2311 are encountering difficulties updating to the April 2024 or May 2024 versions. Despite attempting manual updates, the system erroneously indicates that the software is up to date. We urgently seek clarification on the following matters: Why are users on version 2311 unable to update to the latest versions for April 2024 or May 2024?Why does the system incorrectly report that users are up to date when attempting manual updates in the Monthly Channel, leading to rollbacks to older versions? Read More
Enable OME encryption button in Outlook
Hello
Please i need your help on this issue.
I would like to enable Enable OME encryption button in Outlook,
Have followed several TIDs and guides from Microsoft and others on enabling the OME encryption button in Outlook 365.
We just need the “Encrypt” button in the new email window.
Hello Please i need your help on this issue. I would like to enable Enable OME encryption button in Outlook, Have followed several TIDs and guides from Microsoft and others on enabling the OME encryption button in Outlook 365. We just need the “Encrypt” button in the new email window. Read More
How can I convert base64 encoded data URL to a PNG image?
I have image data in the form of base64 encoded data URLs, like this:
‘data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABdwAAAK8CAYAAAD1…’
I need to convert these to either some common image format, such as PNG, or JPEG, or directly to a matrix describing the image.
Matlab provides "webread" to read data from web services, but this does not support the "data:" protocol.
Is there a way to use Matlab to read data URLs?I have image data in the form of base64 encoded data URLs, like this:
‘data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABdwAAAK8CAYAAAD1…’
I need to convert these to either some common image format, such as PNG, or JPEG, or directly to a matrix describing the image.
Matlab provides "webread" to read data from web services, but this does not support the "data:" protocol.
Is there a way to use Matlab to read data URLs? I have image data in the form of base64 encoded data URLs, like this:
‘data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABdwAAAK8CAYAAAD1…’
I need to convert these to either some common image format, such as PNG, or JPEG, or directly to a matrix describing the image.
Matlab provides "webread" to read data from web services, but this does not support the "data:" protocol.
Is there a way to use Matlab to read data URLs? data url, base64, image import MATLAB Answers — New Questions
Trigger event for graphic handle object?
The function notify seems to be designed for user-define class. Is it possible to make it works on MATLAB graphic handle objects such as uibutton. This code
fig = uifigure;
btn = uibutton(fig);
addlistener(btn, ‘PropertyAdded’, @(varargin) disp(‘trigger’));
notify(fig, ‘PropertyAdded’)
returns the following error:
Returns error
Error using matlab.ui.Figure/notify
Cannot notify listeners of event ‘PropertyAdded’ in class ‘dynamicprops’.The function notify seems to be designed for user-define class. Is it possible to make it works on MATLAB graphic handle objects such as uibutton. This code
fig = uifigure;
btn = uibutton(fig);
addlistener(btn, ‘PropertyAdded’, @(varargin) disp(‘trigger’));
notify(fig, ‘PropertyAdded’)
returns the following error:
Returns error
Error using matlab.ui.Figure/notify
Cannot notify listeners of event ‘PropertyAdded’ in class ‘dynamicprops’. The function notify seems to be designed for user-define class. Is it possible to make it works on MATLAB graphic handle objects such as uibutton. This code
fig = uifigure;
btn = uibutton(fig);
addlistener(btn, ‘PropertyAdded’, @(varargin) disp(‘trigger’));
notify(fig, ‘PropertyAdded’)
returns the following error:
Returns error
Error using matlab.ui.Figure/notify
Cannot notify listeners of event ‘PropertyAdded’ in class ‘dynamicprops’. events, addlistener, notify MATLAB Answers — New Questions
How can I develop a matlab code which analyses and checks how thick the cracks of a wheel surface are?
Recently I have done a measurement for a wheel to find out how overused it is by using the confocal sensor and the data recorder to check how deep the cracks on the surface are by the light distance.
The measured data looks like this e. g.:
With the green diagram you can see how long the distance of the measured light = how deep the cracks on the surface are. The red and the yellow ones are the high and low voltage level.
Now the challenge is that I need to find out how thin/thick the cracks are using this data. Is there anyway I can use matlab to solve this problem?
I have already written a matlab code that checks how many cracks are there by adding a threshold or a mm light distance. But still have not found out a way yet how to find out how long/thick the cracks on the surface are…
Thanks a lot in advance for the help!
% Create PNRF reader OLE Automation server
FromDisk = actxserver(‘Perception.Loaders.pNRF’);
% Use the open file dialog to select a recording file
[FileName,PathName] = uigetfile(‘*.pNRF’,’U:SP90000_12_12_23′);
if isequal(FileName,0)
error(‘Benutzer hat die Auswahl abgebrochen.’);
end
MyRecordingName = fullfile(PathName, FileName);
% Laden der Aufzeichnung
MyData = FromDisk.LoadRecording(MyRecordingName); % Zugriff auf den ersten Recorder
% Initialize channel arrays
channelNames = {}; % Initialisiert als leere Zelle
channel = {}; % Initialisiert als leere Zelle
% Loop through all recorders and channels to get the names of all channels
indexer = 0;
for r = 1: MyData.Recorders.Count
% Get an interface to each recorder
MyRecorder = MyData.Recorders.Item(r);
% Get the channel collection from the recorder
myChannels = MyRecorder.Channels;
% Loop through each channel in the recorder
for i = 1:myChannels.Count
myChannel = myChannels.Item(i);
channelNames{end+1} = string(myChannel.Name);
channel{end+1} = myChannel;
end
end
% Show a modal selection list with all the channels so the operator can select a channel
[indx, tf] = listdlg(‘ListString’,channelNames);
if ~tf
error(‘Kein Kanal ausgewählt.’);
end
myChannel = channel{indx};
SelectedChannelName = myChannel.Name;
% Now we get the DataSrc (data source) interface from the selected channel
ItfData = myChannel.DataSource(3);
% Check if we have synchronous or asynchronous data by using the TimeInfo property
myTimeInfo = ItfData.TimeInfo;
isAsyncData = ~strcmp(myTimeInfo, ‘DataSourceTimeInfo_Implicit’);
% Get the sweeps collection from the datasource interface
MySweeps = ItfData.Sweeps;
% Get the start and end time of the recorded data of the first channel
dStartTime = MySweeps.StartTime;
dEndTime = MySweeps.EndTime;
% Get the data segments collection between the start and end time
SegmentsOfData = ItfData.Data(dStartTime, dEndTime); % Now the actual data is read.
% Take the first data segment
myFirstSegment = SegmentsOfData.Item(1);
% Check the number of samples
NumberOfSamples = myFirstSegment.NumberOfSamples;
if NumberOfSamples > 500000
NumberOfSamples = 500000;
end
% Show the data in a diagram
figure1 = figure(‘NumberTitle’,’off’,’Name’, SelectedChannelName);
% axes1 = axes(‘Parent’,figure1,’Position’,[0.2 0.05 0.6 0.9]);
%set(figure1, ‘Position’, [100 100 1200 800]);
if isAsyncData
[WaveformDateWithTimes, Times] = myFirstSegment.WaveformWithTimes(5, 1, NumberOfSamples, 1);
plot(Times, WaveformDateWithTimes);
title(‘Not-Equidistant data points’);
else
WaveformData = myFirstSegment.Waveform(5, 1, NumberOfSamples, 1);
tEnd = myFirstSegment.StartTime + (NumberOfSamples – 1) * myFirstSegment.SampleInterval;
t = myFirstSegment.StartTime: myFirstSegment.SampleInterval : tEnd;
plot(t, WaveformData);
title(‘Equidistant data points’);
end
legend(SelectedChannelName);
xlabel([‘Time (‘,ItfData.XUnit ,’)’]);
ylabel([SelectedChannelName, ‘ (‘, ItfData.YUnit ,’)’]);
% Create a Textbox to display data values from the information sheet
% myDataValues = MyData.DataValues;
% cInfo = ”;
% for i = 1:myDataValues.Count
% myDataValue = myDataValues.Item(i);
% cInfo = sprintf(‘%s%s: %s %sn’, cInfo, myDataValue.Name, myDataValue.Value, myDataValue.Units);
% end
% annotation(figure1, ‘textbox’, [0.66 0.05 0.32 0.9], ‘String’, cInfo, ‘FitBoxToText’, ‘on’);
% Schätze die Bildschirmgröße ab und positioniere das Fenster
screenSize = get(0, ‘ScreenSize’); % Dies gibt [left bottom width height]
figureWidth = 1200;
figureHeight = 800;
figureLeft = (screenSize(3) – figureWidth) / 2; % Zentriert horizontal
figureBottom = (screenSize(4) – figureHeight) / 2; % Zentriert vertikal
set(figure1, ‘Position’, [figureLeft figureBottom figureWidth figureHeight]);
% Ersetzen oder fügen Sie nach der Plot-Erstellung hinzu
if isAsyncData
[WaveformDateWithTimes, Times] = myFirstSegment.WaveformWithTimes(5, 1, NumberOfSamples, 1);
plot(Times, WaveformDateWithTimes);
WaveformData = WaveformDateWithTimes; % Verwendung der asynchronen Daten für die Statistik
else
WaveformData = myFirstSegment.Waveform(5, 1, NumberOfSamples, 1);
tEnd = myFirstSegment.StartTime + (NumberOfSamples – 1) * myFirstSegment.SampleInterval;
t = myFirstSegment.StartTime: myFirstSegment.SampleInterval : tEnd;
plot(t, WaveformData);
end
% Statistikberechnungen
averageValue = mean(WaveformData);
minValue = min(WaveformData);
maxValue = max(WaveformData);
numberOfPositiveValues = sum(WaveformData > 0);
% Anzahl der Werte größer als 0.25 mm
numberOfValuesAboveThreshold = sum(WaveformData > 0.25);
% Anzeige der berechneten Werte
disp([‘Durchschnittswert: ‘, num2str(averageValue)]);
disp([‘Minimaler Wert: ‘, num2str(minValue)]);
disp([‘Maximaler Wert: ‘, num2str(maxValue)]);
disp([‘Anzahl positiver Werte: ‘, num2str(numberOfPositiveValues)]);
disp([‘Anzahl der Werte über 0.1 mm: ‘, num2str(numberOfValuesAboveThreshold)]);Recently I have done a measurement for a wheel to find out how overused it is by using the confocal sensor and the data recorder to check how deep the cracks on the surface are by the light distance.
The measured data looks like this e. g.:
With the green diagram you can see how long the distance of the measured light = how deep the cracks on the surface are. The red and the yellow ones are the high and low voltage level.
Now the challenge is that I need to find out how thin/thick the cracks are using this data. Is there anyway I can use matlab to solve this problem?
I have already written a matlab code that checks how many cracks are there by adding a threshold or a mm light distance. But still have not found out a way yet how to find out how long/thick the cracks on the surface are…
Thanks a lot in advance for the help!
% Create PNRF reader OLE Automation server
FromDisk = actxserver(‘Perception.Loaders.pNRF’);
% Use the open file dialog to select a recording file
[FileName,PathName] = uigetfile(‘*.pNRF’,’U:SP90000_12_12_23′);
if isequal(FileName,0)
error(‘Benutzer hat die Auswahl abgebrochen.’);
end
MyRecordingName = fullfile(PathName, FileName);
% Laden der Aufzeichnung
MyData = FromDisk.LoadRecording(MyRecordingName); % Zugriff auf den ersten Recorder
% Initialize channel arrays
channelNames = {}; % Initialisiert als leere Zelle
channel = {}; % Initialisiert als leere Zelle
% Loop through all recorders and channels to get the names of all channels
indexer = 0;
for r = 1: MyData.Recorders.Count
% Get an interface to each recorder
MyRecorder = MyData.Recorders.Item(r);
% Get the channel collection from the recorder
myChannels = MyRecorder.Channels;
% Loop through each channel in the recorder
for i = 1:myChannels.Count
myChannel = myChannels.Item(i);
channelNames{end+1} = string(myChannel.Name);
channel{end+1} = myChannel;
end
end
% Show a modal selection list with all the channels so the operator can select a channel
[indx, tf] = listdlg(‘ListString’,channelNames);
if ~tf
error(‘Kein Kanal ausgewählt.’);
end
myChannel = channel{indx};
SelectedChannelName = myChannel.Name;
% Now we get the DataSrc (data source) interface from the selected channel
ItfData = myChannel.DataSource(3);
% Check if we have synchronous or asynchronous data by using the TimeInfo property
myTimeInfo = ItfData.TimeInfo;
isAsyncData = ~strcmp(myTimeInfo, ‘DataSourceTimeInfo_Implicit’);
% Get the sweeps collection from the datasource interface
MySweeps = ItfData.Sweeps;
% Get the start and end time of the recorded data of the first channel
dStartTime = MySweeps.StartTime;
dEndTime = MySweeps.EndTime;
% Get the data segments collection between the start and end time
SegmentsOfData = ItfData.Data(dStartTime, dEndTime); % Now the actual data is read.
% Take the first data segment
myFirstSegment = SegmentsOfData.Item(1);
% Check the number of samples
NumberOfSamples = myFirstSegment.NumberOfSamples;
if NumberOfSamples > 500000
NumberOfSamples = 500000;
end
% Show the data in a diagram
figure1 = figure(‘NumberTitle’,’off’,’Name’, SelectedChannelName);
% axes1 = axes(‘Parent’,figure1,’Position’,[0.2 0.05 0.6 0.9]);
%set(figure1, ‘Position’, [100 100 1200 800]);
if isAsyncData
[WaveformDateWithTimes, Times] = myFirstSegment.WaveformWithTimes(5, 1, NumberOfSamples, 1);
plot(Times, WaveformDateWithTimes);
title(‘Not-Equidistant data points’);
else
WaveformData = myFirstSegment.Waveform(5, 1, NumberOfSamples, 1);
tEnd = myFirstSegment.StartTime + (NumberOfSamples – 1) * myFirstSegment.SampleInterval;
t = myFirstSegment.StartTime: myFirstSegment.SampleInterval : tEnd;
plot(t, WaveformData);
title(‘Equidistant data points’);
end
legend(SelectedChannelName);
xlabel([‘Time (‘,ItfData.XUnit ,’)’]);
ylabel([SelectedChannelName, ‘ (‘, ItfData.YUnit ,’)’]);
% Create a Textbox to display data values from the information sheet
% myDataValues = MyData.DataValues;
% cInfo = ”;
% for i = 1:myDataValues.Count
% myDataValue = myDataValues.Item(i);
% cInfo = sprintf(‘%s%s: %s %sn’, cInfo, myDataValue.Name, myDataValue.Value, myDataValue.Units);
% end
% annotation(figure1, ‘textbox’, [0.66 0.05 0.32 0.9], ‘String’, cInfo, ‘FitBoxToText’, ‘on’);
% Schätze die Bildschirmgröße ab und positioniere das Fenster
screenSize = get(0, ‘ScreenSize’); % Dies gibt [left bottom width height]
figureWidth = 1200;
figureHeight = 800;
figureLeft = (screenSize(3) – figureWidth) / 2; % Zentriert horizontal
figureBottom = (screenSize(4) – figureHeight) / 2; % Zentriert vertikal
set(figure1, ‘Position’, [figureLeft figureBottom figureWidth figureHeight]);
% Ersetzen oder fügen Sie nach der Plot-Erstellung hinzu
if isAsyncData
[WaveformDateWithTimes, Times] = myFirstSegment.WaveformWithTimes(5, 1, NumberOfSamples, 1);
plot(Times, WaveformDateWithTimes);
WaveformData = WaveformDateWithTimes; % Verwendung der asynchronen Daten für die Statistik
else
WaveformData = myFirstSegment.Waveform(5, 1, NumberOfSamples, 1);
tEnd = myFirstSegment.StartTime + (NumberOfSamples – 1) * myFirstSegment.SampleInterval;
t = myFirstSegment.StartTime: myFirstSegment.SampleInterval : tEnd;
plot(t, WaveformData);
end
% Statistikberechnungen
averageValue = mean(WaveformData);
minValue = min(WaveformData);
maxValue = max(WaveformData);
numberOfPositiveValues = sum(WaveformData > 0);
% Anzahl der Werte größer als 0.25 mm
numberOfValuesAboveThreshold = sum(WaveformData > 0.25);
% Anzeige der berechneten Werte
disp([‘Durchschnittswert: ‘, num2str(averageValue)]);
disp([‘Minimaler Wert: ‘, num2str(minValue)]);
disp([‘Maximaler Wert: ‘, num2str(maxValue)]);
disp([‘Anzahl positiver Werte: ‘, num2str(numberOfPositiveValues)]);
disp([‘Anzahl der Werte über 0.1 mm: ‘, num2str(numberOfValuesAboveThreshold)]); Recently I have done a measurement for a wheel to find out how overused it is by using the confocal sensor and the data recorder to check how deep the cracks on the surface are by the light distance.
The measured data looks like this e. g.:
With the green diagram you can see how long the distance of the measured light = how deep the cracks on the surface are. The red and the yellow ones are the high and low voltage level.
Now the challenge is that I need to find out how thin/thick the cracks are using this data. Is there anyway I can use matlab to solve this problem?
I have already written a matlab code that checks how many cracks are there by adding a threshold or a mm light distance. But still have not found out a way yet how to find out how long/thick the cracks on the surface are…
Thanks a lot in advance for the help!
% Create PNRF reader OLE Automation server
FromDisk = actxserver(‘Perception.Loaders.pNRF’);
% Use the open file dialog to select a recording file
[FileName,PathName] = uigetfile(‘*.pNRF’,’U:SP90000_12_12_23′);
if isequal(FileName,0)
error(‘Benutzer hat die Auswahl abgebrochen.’);
end
MyRecordingName = fullfile(PathName, FileName);
% Laden der Aufzeichnung
MyData = FromDisk.LoadRecording(MyRecordingName); % Zugriff auf den ersten Recorder
% Initialize channel arrays
channelNames = {}; % Initialisiert als leere Zelle
channel = {}; % Initialisiert als leere Zelle
% Loop through all recorders and channels to get the names of all channels
indexer = 0;
for r = 1: MyData.Recorders.Count
% Get an interface to each recorder
MyRecorder = MyData.Recorders.Item(r);
% Get the channel collection from the recorder
myChannels = MyRecorder.Channels;
% Loop through each channel in the recorder
for i = 1:myChannels.Count
myChannel = myChannels.Item(i);
channelNames{end+1} = string(myChannel.Name);
channel{end+1} = myChannel;
end
end
% Show a modal selection list with all the channels so the operator can select a channel
[indx, tf] = listdlg(‘ListString’,channelNames);
if ~tf
error(‘Kein Kanal ausgewählt.’);
end
myChannel = channel{indx};
SelectedChannelName = myChannel.Name;
% Now we get the DataSrc (data source) interface from the selected channel
ItfData = myChannel.DataSource(3);
% Check if we have synchronous or asynchronous data by using the TimeInfo property
myTimeInfo = ItfData.TimeInfo;
isAsyncData = ~strcmp(myTimeInfo, ‘DataSourceTimeInfo_Implicit’);
% Get the sweeps collection from the datasource interface
MySweeps = ItfData.Sweeps;
% Get the start and end time of the recorded data of the first channel
dStartTime = MySweeps.StartTime;
dEndTime = MySweeps.EndTime;
% Get the data segments collection between the start and end time
SegmentsOfData = ItfData.Data(dStartTime, dEndTime); % Now the actual data is read.
% Take the first data segment
myFirstSegment = SegmentsOfData.Item(1);
% Check the number of samples
NumberOfSamples = myFirstSegment.NumberOfSamples;
if NumberOfSamples > 500000
NumberOfSamples = 500000;
end
% Show the data in a diagram
figure1 = figure(‘NumberTitle’,’off’,’Name’, SelectedChannelName);
% axes1 = axes(‘Parent’,figure1,’Position’,[0.2 0.05 0.6 0.9]);
%set(figure1, ‘Position’, [100 100 1200 800]);
if isAsyncData
[WaveformDateWithTimes, Times] = myFirstSegment.WaveformWithTimes(5, 1, NumberOfSamples, 1);
plot(Times, WaveformDateWithTimes);
title(‘Not-Equidistant data points’);
else
WaveformData = myFirstSegment.Waveform(5, 1, NumberOfSamples, 1);
tEnd = myFirstSegment.StartTime + (NumberOfSamples – 1) * myFirstSegment.SampleInterval;
t = myFirstSegment.StartTime: myFirstSegment.SampleInterval : tEnd;
plot(t, WaveformData);
title(‘Equidistant data points’);
end
legend(SelectedChannelName);
xlabel([‘Time (‘,ItfData.XUnit ,’)’]);
ylabel([SelectedChannelName, ‘ (‘, ItfData.YUnit ,’)’]);
% Create a Textbox to display data values from the information sheet
% myDataValues = MyData.DataValues;
% cInfo = ”;
% for i = 1:myDataValues.Count
% myDataValue = myDataValues.Item(i);
% cInfo = sprintf(‘%s%s: %s %sn’, cInfo, myDataValue.Name, myDataValue.Value, myDataValue.Units);
% end
% annotation(figure1, ‘textbox’, [0.66 0.05 0.32 0.9], ‘String’, cInfo, ‘FitBoxToText’, ‘on’);
% Schätze die Bildschirmgröße ab und positioniere das Fenster
screenSize = get(0, ‘ScreenSize’); % Dies gibt [left bottom width height]
figureWidth = 1200;
figureHeight = 800;
figureLeft = (screenSize(3) – figureWidth) / 2; % Zentriert horizontal
figureBottom = (screenSize(4) – figureHeight) / 2; % Zentriert vertikal
set(figure1, ‘Position’, [figureLeft figureBottom figureWidth figureHeight]);
% Ersetzen oder fügen Sie nach der Plot-Erstellung hinzu
if isAsyncData
[WaveformDateWithTimes, Times] = myFirstSegment.WaveformWithTimes(5, 1, NumberOfSamples, 1);
plot(Times, WaveformDateWithTimes);
WaveformData = WaveformDateWithTimes; % Verwendung der asynchronen Daten für die Statistik
else
WaveformData = myFirstSegment.Waveform(5, 1, NumberOfSamples, 1);
tEnd = myFirstSegment.StartTime + (NumberOfSamples – 1) * myFirstSegment.SampleInterval;
t = myFirstSegment.StartTime: myFirstSegment.SampleInterval : tEnd;
plot(t, WaveformData);
end
% Statistikberechnungen
averageValue = mean(WaveformData);
minValue = min(WaveformData);
maxValue = max(WaveformData);
numberOfPositiveValues = sum(WaveformData > 0);
% Anzahl der Werte größer als 0.25 mm
numberOfValuesAboveThreshold = sum(WaveformData > 0.25);
% Anzeige der berechneten Werte
disp([‘Durchschnittswert: ‘, num2str(averageValue)]);
disp([‘Minimaler Wert: ‘, num2str(minValue)]);
disp([‘Maximaler Wert: ‘, num2str(maxValue)]);
disp([‘Anzahl positiver Werte: ‘, num2str(numberOfPositiveValues)]);
disp([‘Anzahl der Werte über 0.1 mm: ‘, num2str(numberOfValuesAboveThreshold)]); cracks, confocal, sensor, thickness, thick, thin, matlab, code MATLAB Answers — New Questions
Which rules was active?
I use many rules. The rules are stored in ascending order by name. The rules are not logically independent (although I tried to make them independent, but I can’t guarantee this beyond the 500th rule)! It would often be nice to know which rule was active for an incoming eMail? Is there any tracking facility to test my rules in test mode while they are running?
Thanks in advance for your help!
Best regards. LőrIst
I use many rules. The rules are stored in ascending order by name. The rules are not logically independent (although I tried to make them independent, but I can’t guarantee this beyond the 500th rule)! It would often be nice to know which rule was active for an incoming eMail? Is there any tracking facility to test my rules in test mode while they are running?Thanks in advance for your help!Best regards. LőrIst Read More
Can you make your calendar Public on Bookings?
I notice all the calendars on my Bookings Page are just listed as “busy” but I would like to make them actually list what event my employees have. How can I do this or have them enable this?
I notice all the calendars on my Bookings Page are just listed as “busy” but I would like to make them actually list what event my employees have. How can I do this or have them enable this? Read More
New Regular expression (Regex) functions in Excel
Hi, Microsoft, 365 Insiders!
Calling all Excel enthusiasts! We’re excited to introduce three new functions that use Regular Expressions to help parse text more easily: REGEXTEST, REGEXEXTRACT, and REGEXREPLACE.
Jake Armstrong, Product Manager on the Excel team, takes a look at and shares insights on each powerful function in our latest blog: New Regular expression (Regex) functions in Excel
Thanks,
Perry
Perry Sjogren
Microsoft 365 Insider Social Media Manager
Become a Microsoft 365 Insider and gain exclusive access to new features and help shape the future of Microsoft 365. Join Now: Windows | Mac | iOS | Android
Hi, Microsoft, 365 Insiders!
Calling all Excel enthusiasts! We’re excited to introduce three new functions that use Regular Expressions to help parse text more easily: REGEXTEST, REGEXEXTRACT, and REGEXREPLACE.
Jake Armstrong, Product Manager on the Excel team, takes a look at and shares insights on each powerful function in our latest blog: New Regular expression (Regex) functions in Excel
Thanks,
Perry
Perry Sjogren
Microsoft 365 Insider Social Media Manager
Become a Microsoft 365 Insider and gain exclusive access to new features and help shape the future of Microsoft 365. Join Now: Windows | Mac | iOS | Android Read More