Category: News
Service disabled during troubleshooting leading to login failure
I believe I accidentally disabled a crucial service while attempting to troubleshoot, leading to the login failure. Despite trying to restore a point from recovery mode, I encountered an unexpected error. Is it possible to switch the login setting to manual in the UEFI? Any other suggestions would be greatly appreciated. Thank you for your assistance.
– Dave
I believe I accidentally disabled a crucial service while attempting to troubleshoot, leading to the login failure. Despite trying to restore a point from recovery mode, I encountered an unexpected error. Is it possible to switch the login setting to manual in the UEFI? Any other suggestions would be greatly appreciated. Thank you for your assistance.- Dave Read More
“Display PNG Icon as Desktop Background with ‘Show Desktops'”
Hello,
I’m experiencing an unusual display issue where, upon clicking or hovering over the “show desktops” button in the taskbar, the background displays the icon of a PNG file type, as shown in the screenshot below. Normally, PNGs are associated with XnView, but I’m uncertain if this is the cause of the problem. This peculiar issue has persisted for as long as I can remember, despite my computer being relatively new (around 6 months old) and running Windows 11.
Any suggestions on how to resolve this would be greatly appreciated. Thank you for your assistance!
Hello, I’m experiencing an unusual display issue where, upon clicking or hovering over the “show desktops” button in the taskbar, the background displays the icon of a PNG file type, as shown in the screenshot below. Normally, PNGs are associated with XnView, but I’m uncertain if this is the cause of the problem. This peculiar issue has persisted for as long as I can remember, despite my computer being relatively new (around 6 months old) and running Windows 11. Any suggestions on how to resolve this would be greatly appreciated. Thank you for your assistance! Read More
Understanding the Difference Between Home and This PC: A Guide to Choosing the Right Option
With the most recent Win11 updates, what exactly is the purpose behind the fresh Home hub in File Explorer? How can it enhance my user experience compared to the traditional This PC view? For adding custom locations, I rely on Winaero Tweaker to tailor This PC to my needs.
Additionally, why is every item grouped under “Desktop” in the left-hand pane?
This is where I currently stand…
With the most recent Win11 updates, what exactly is the purpose behind the fresh Home hub in File Explorer? How can it enhance my user experience compared to the traditional This PC view? For adding custom locations, I rely on Winaero Tweaker to tailor This PC to my needs. Additionally, why is every item grouped under “Desktop” in the left-hand pane? This is where I currently stand… Read More
Error: Teams Feedback doubled / Question: Amplify Integration into Newsfeeds
Hello everyone,
I am currently aiding a customer using Amplify in their environment. We have come across two questions/issues that I would like to share:
(Error) Doubled Feedback in Analytics:
For Teams posts, reactions seem to be doubled in analytics. For instance, a post will have 13 thumbs and 2 hearts – in analytics, this will read as 30 positive feedbacks. This seems to happen consistently across several Teams posts. Has anyone encountered this before?
(Question) Integrating Amplify content into SharePoint Newsflows
My customer is using SharePoint page details (such as “news type”) to determine to which feeds a post will play out. Amplify does not allow altering site details when creating a SharePoint post. Thus, posts need to be edited after posting to ensture the flow is triggered.
Is there some way around this? Are there other way to solve this?
Appreciate any thoughts :).
Hello everyone, I am currently aiding a customer using Amplify in their environment. We have come across two questions/issues that I would like to share: (Error) Doubled Feedback in Analytics:For Teams posts, reactions seem to be doubled in analytics. For instance, a post will have 13 thumbs and 2 hearts – in analytics, this will read as 30 positive feedbacks. This seems to happen consistently across several Teams posts. Has anyone encountered this before? (Question) Integrating Amplify content into SharePoint NewsflowsMy customer is using SharePoint page details (such as “news type”) to determine to which feeds a post will play out. Amplify does not allow altering site details when creating a SharePoint post. Thus, posts need to be edited after posting to ensture the flow is triggered.Is there some way around this? Are there other way to solve this? Appreciate any thoughts :). Read More
WAC – Server not addable from AD
Hi,
i installed actual WAC public preview with my domain account (local admin) on a Server 2025 (26257).
When i start WAC and i want to add window Server i can´t search Active Directory, because it says:
“We can’t search Active Directory because the Windows Admin Center computer isn’t joined to an Active Directory domain. It’s also possible that your account doesn’t have permission to read from Active Directory.“
Can you help, because server is domain joined. SPN is also set on AD Computer Account with http/admincenter.domain.internal.
Hi,i installed actual WAC public preview with my domain account (local admin) on a Server 2025 (26257). When i start WAC and i want to add window Server i can´t search Active Directory, because it says:”We can’t search Active Directory because the Windows Admin Center computer isn’t joined to an Active Directory domain. It’s also possible that your account doesn’t have permission to read from Active Directory.”Can you help, because server is domain joined. SPN is also set on AD Computer Account with http/admincenter.domain.internal. Read More
Possible to recover deleted files from external hard drive on Windows 11 PC?
I recently deleted a few important files from my external hard drive while connecting to my Windows 11 PC. These files are crucial for my work, and I need to recover them as soon as possible. I’ve heard there are various methods to recover deleted files, but I’m not sure which one would be the best and most reliable for my situation.
I’ve tried checking the Recycle Bin, but the files are not there. I’m considering using software like the built in Windows File Recovery but I would love to hear from those who have successfully recovered deleted files from external hard drive on Windows 11. Any step-by-step instructions or tips would be greatly appreciated.
I recently deleted a few important files from my external hard drive while connecting to my Windows 11 PC. These files are crucial for my work, and I need to recover them as soon as possible. I’ve heard there are various methods to recover deleted files, but I’m not sure which one would be the best and most reliable for my situation. I’ve tried checking the Recycle Bin, but the files are not there. I’m considering using software like the built in Windows File Recovery but I would love to hear from those who have successfully recovered deleted files from external hard drive on Windows 11. Any step-by-step instructions or tips would be greatly appreciated. Read More
Identify your savings potential in Azure
A guide to use Cost Management tools and services to optimize your cloud spending and efficiency.
Introduction
Are you spending more than you need to in the cloud? Do you want to learn how to monitor, analyze, and optimize your Azure costs? If so, this document is for you. In this document, we will introduce you to some of the key features and capabilities of Azure Cost Management, Azure Advisor, and the Cost Optimization workbook, and show you how to use them to find and implement cost optimization opportunities. You will learn how to use Cost analysis to understand your cost drivers and trends, and how to investigate the root causes of cost changes or spikes. You will also learn how to use Azure Advisor to implement cost optimization best practices and recommendations, and how to use the Cost Optimization workbook to analyze and optimize your usage and costs across your environment. Additionally, you will learn how to perform an architectural review to align your solutions with the Well-Architected Framework, and how to stay updated with the latest cost optimization news and resources. By using these tools and services, you can reduce your cloud spending and improve your cost efficiency, while aligning your costs with your business needs and goals.
Identify your cost drivers and trends with Cost analysis
The first step to optimize your Azure costs is to understand where and how you spend your money in the cloud. Cost analysis, part of Microsoft Cost Management, is a powerful tool that shows you a detailed breakdown of your costs by various dimensions, such as service, resource, resource group, subscription, location, tag, and more[1]. You can use Cost analysis to view your costs in different levels of detail, such as daily, monthly, or custom, and in different chart types, such as bar, line, pie, or table. You can also use filters, grouping, and sorting to customize your view and focus on the data that is relevant to you. Cost analysis also provides you with a forecast of your costs based on your current usage, and allows you to export your data to Excel or CSV for further analysis or reporting[2].
Figure 1 Cost analysis Accumulated costs view
To use Cost analysis, you need to select a scope that defines the level of detail you want to see. The scope can be an entire billing account, a management group, a subscription, or a resource group. Depending on your organizational structure and access level, you can choose the scope that best suits your needs. For example, if you are a cloud administrator or a finance manager, you might want to see the costs across the entire billing account or management group. If you are a product owner or a developer, you might want to see the costs for a specific subscription or resource group. You can also switch between scopes easily to compare costs across different levels, and use filtering to refine the scope to resources which have a particular tag name and tag value.
Walk through a cost analysis scenario
Let’s assume you are a cloud administrator who is responsible for managing the costs of your assets in Azure. You have successfully migrated several applications to the cloud, and you are seeing an increase in costs from month to month due to the popularity and ease of deployment of your services. However, you are also facing some challenges in evaluating why the costs for certain services are increasing, and if they are running cost-optimized. You want to use Cost analysis to gain some insights into your cost drivers and trends, and to identify potential savings opportunities. Here are the steps you can follow:
Select the entire billing account as your scope, to see the overall view of your costs across all your subscriptions.
Choose the Accumulated costs view to see the total costs for the current month, and the forecast for the next month. You see that your forecast is higher than your budget, and you want to find out why.
Switch to the Daily costs view to see the costs per day and notice a spike in costs on a certain date. You want to drill down to find the root cause of the spike.
Group by service name to see the breakdown of your costs by service. You see that the service that caused the spike is virtual machines.
Click on the virtual machines bar to filter by that service. You see that the costs for virtual machines are still high after the spike, and you want to find out which resources are contributing to the high costs.
Group by resource to see the breakdown of your costs by resource. You see that there are several virtual machines that have high costs, and you want to find out more details about them.
Click on one of the virtual machines to filter by that resource. You see that the virtual machine has a high cost due to a reserved instance purchase. You realize that someone purchased a reserved instance for a year and paid monthly, which resulted in a spike in costs. You also see that the virtual machine is running on a premium SKU, which might not be necessary for your workload. You decide to investigate further and see if you can optimize the costs of this virtual machine and other similar ones.
The following table shows an example of how you can use Cost analysis to drill down to the root cause of a cost spike:
View
Scope
Filter
Group by
Chart type
Insight
Accumulated costs
Billing account
None
None
Bar
Forecast is higher than budget
Daily costs
Billing account
None
None
Line
Spike in costs on a certain date
Daily costs
Billing account
None
Service name
Bar
Virtual Machines is the service that caused the spike
Daily costs
Billing account
Service name: Virtual machines
Resource
Bar
Several virtual machines have high costs
Daily costs
Billing account
Service name: Virtual machines, Resource: vm1
None
Line
vm1 has a high cost due to a reserved instance purchase and a premium SKU
Implement cost optimization best practices with Azure Advisor
The next step to optimize your Azure costs is to implement best practices and recommendations that can help you reduce unnecessary spending and improve your efficiency. Azure Advisor is a free service that provides personalized and actionable guidance across five well-architected pillars: Cost, Security, Reliability, Operational Excellence, and Performance[3]. Each pillar is important and influences the others[4]. For example, choosing the right service level and availability options can affect your costs and reliability. Enabling security features and monitoring can affect your performance and operational excellence. Azure Advisor analyzes your usage and configuration data, and provides you with recommendations that can help you optimize your resources and services based on Microsoft best practices.
To use Azure Advisor, you need to select a scope that defines the level of detail you want to see. The scope can be an entire subscription or a resource group. You can also apply filters to see recommendations for specific categories, impacts, or resources. Azure Advisor also provides you with an Advisor score, which is an aggregate across all five pillars and shows your progression over time[5]. By implementing the recommendations, you can increase your score and improve your alignment with the well-architected framework. You can also download or share your recommendations, or create tasks and alerts to track your progress and follow up on the actions.
Figure 2 Azure Advisor Score
Cost recommendations
One of the pillars that Azure Advisor covers is Cost. The Cost pillar provides insights on where you can save money and improve your cost efficiency[6]. Some of the cost recommendations that Azure Advisor provides are:
Recommendation
Description
Potential savings
Right-size or shut down underutilized virtual machines
Azure Advisor identifies virtual machines that have low CPU or network utilization, and suggests resizing or deallocating them to save costs.
Up to 40% per virtual machine
Buy reserved instances or savings plans for compute
Azure Advisor identifies virtual machines that are running on pay-as-you-go pricing, and suggests buying reserved instances or savings plans to save up to 72% on your compute costs.
Up to 72% per virtual machine
Delete or reconfigure idle virtual network gateways
Azure Advisor identifies virtual network gateways that have low or no traffic, and suggests deleting or reconfiguring them to save costs.
Up to 100% per virtual network gateway
Remove unused or unattached disk storage
Azure Advisor identifies disk storage that is not attached to any virtual machine, or that has not been accessed for a long time, and suggests deleting it to save costs.
Up to 100% per disk
Remove orphaned resources
Azure Advisor identifies resources that are not associated with any resource group, such as public IP addresses, load balancers, or network security groups, and suggests deleting them to save costs.
Up to 100% per resource
These are some of the cost recommendations that Azure Advisor provides, but not all. You can find an ever-expanding list of currently covered services and recommendations here: Cost recommendations – Azure Advisor | Microsoft Learn. However, most likely you will already find useful information and savings opportunities right away by using Azure Advisor. You can also easily introduce the service to other people who might only care about a single solution instead of your entire cloud landscape. Based on the level of their role-based access, they will only be able to see the subscriptions or resource groups that they have access. You also do not need to deploy any kind of tools or agents, because Azure Advisor is a built-in service that is available for free.
Analyze and optimize your usage and costs with the Cost Optimization workbook
The final step to optimize your Azure costs is to analyze and optimize your usage and costs across your environment, and to identify and implement savings opportunities. The Cost Optimization workbook, part of Azure Advisor Workbooks, is a comprehensive tool that provides a holistic view of your usage and costs, and helps you find and address inefficiencies and waste[7]. The workbook integrates with Azure Advisor to provide you with recommendations and actions to optimize your costs.
Figure 3 Cost Optimization Workbook
To use the Cost Optimization workbook, you need to select a scope that defines the level of detail you want to see. The scope can be an entire billing account, a management group, a subscription, or a resource group. You can also apply filters to see the data for specific time periods, services, locations, tags, or resource types. The workbook provides you with several tabs that show different aspects of your usage and costs, such as:
Overview: This tab shows a summary of your usage and costs, your cost optimization score, your top cost drivers, your cost trends and forecasts, and your cost optimization opportunities.
Rate optimization: This tab shows how you can optimize your costs by choosing the right pricing options, such as reserved instances, savings plans, spot instances, Azure Hybrid Benefit, and pay-as-you-go.
Usage optimization: This tab shows how you can optimize your costs by reducing or eliminating unused or underutilized resources, such as idle virtual machines, unattached disks, orphaned resources, and overprovisioned resources.
The Cost Optimization workbook should be your primary tool for having detailed insights and actions for rate optimization and usage optimization across your landscape. The workbook covers many services and scenarios that are not part of Azure Advisor recommendations, such as upgrading storage accounts to benefit from lifecycle management, optimizing SQL databases and elastic pools, optimizing App Service plans and functions, and more. You can also customize the workbook to suit your needs, by adding or removing tabs, charts, tables, filters, and parameters. The workbook is also a free service that is available for all Azure customers.
Perform an architectural review to align with the well-architected framework
The final step to identify your savings potential in Azure is to review your architecture and design choices. Architecture and design choices are the decisions that you make when you plan, build, and deploy your solutions in Azure. They include aspects such as the service selection, the configuration, the scalability, the availability, the performance, the security, and the governance of your solutions[8]. These choices have a significant impact on your costs, as they determine how you use and consume the resources and services in Azure. For example, if you choose a service that has a higher SLA or a more advanced feature set than what you need, you might be paying more than necessary. Or if you choose a service that does not fit your requirements or expectations, you might end up with poor performance, reliability, or security issues, which can also increase your costs. Therefore, it is essential that you review your architecture and design choices regularly and align them with the best practices and the latest offerings in Azure. To review your architecture and design choices, you can use the Well-Architected Framework in Azure[9]. The Well-Architected Framework is a set of principles, guidance, and tools that help you design and implement high-quality solutions in Azure. It is based on the five well-architected pillars that we mentioned before: Cost, Security, Reliability, Operational Excellence, and Performance. For each pillar, the framework provides a set of best practices, questions, and considerations that help you evaluate your current state, identify gaps and risks, and plan improvements.
Figure 4 Azure Well-Architected Framework
You can also use the Well-Architected Review tool in Azure to assess your solutions against the best practices and get a score and a report with recommended actions. The tool also helps you track your progress and compare your results over time. The Well-Architected Review is a workload-driven tool, which means that you can focus on a specific solution or application instead of the entire environment. This allows you to prioritize your efforts and resources based on the importance and impact of each solution. The Well-Architected Review is also a cross-functional tool, which means that you can involve different stakeholders and roles in the assessment process, such as the product owner, the developer, the architect, or the administrator. This helps you get a holistic and comprehensive view of your solutions and align your objectives and expectations. The Well-Architected Review does not aim to replace a human-driven architecture review session, but rather to complement and enhance it. You can use the tool as a starting point, a reference, or a validation for your architecture and design choices. You can find more information on how to get started with the Well-Architected Framework and the Well-Architected Review here: Assessments | Azure Well-Architected Review (microsoft.com).
The Well-Architected Framework and the Well-Architected Review are not the only resources that you can use to review your architecture and design choices. Microsoft also offers a wide range of workshops, assessments, and services to help you with your cloud journey. You can leverage the expertise and experience of Microsoft certified partners and Microsoft itself to get guidance, support, and feedback on your solutions. You can also get in touch with your Microsoft representative to learn more about the offerings and opportunities that are available for you. You do not have to walk this road alone. Microsoft is here to help you succeed in the cloud.
Stay updated with the latest cost optimization news and resources
The final tip to optimize your Azure costs is to stay updated with the latest cost optimization news and resources. Azure provides a variety of channels and sources that can help you keep up with the latest developments and best practices in cost optimization. Some of the channels and sources are:
Microsoft Cost Management blog: This is the official blog for Microsoft Cost Management, where you can find announcements, updates, tips, and tricks on how to optimize your Microsoft Cloud costs. You can subscribe to the blog to receive notifications when new posts are published[10].
Microsoft Cost Management YouTube channel: This is the official YouTube channel for Microsoft Cost Management, where you can find videos, demos, and webinars on how to use the cost management tools and services. You can subscribe to the channel to receive notifications when new videos are uploaded.
Microsoft Cost Management documentation: This is the official documentation for Microsoft Cost Management, where you can find detailed information and guidance on how to use the cost management tools and services[11]. You can also provide feedback and suggestions on the documentation.
FinOps blog: This is the official blog for Microsoft’s FinOps news and advice.
By staying updated with the latest cost optimization news and resources, you can learn new ways and best practices to optimize your Azure costs, and also get support and feedback from the Microsoft Cost Management team and the community.
Summary
In this document, we have shown you how to optimize your Azure costs with cost management tools and services. We have explained how to use Cost Analysis to identify your cost drivers and trends, and how to drill down to find the root causes of cost fluctuations or spikes. We have also explained how to use Azure Advisor to implement cost optimization best practices and recommendations, and how to use the Cost Optimization workbook to analyze and optimize your usage and costs across your environment. Additionally, we have explained how to perform an architectural review to align your solutions with the well-architected framework, and how to stay updated with the latest cost optimization news and resources. By using these tools and services, you can benefit from:
Reducing your cloud spending and improving your cost efficiency
Aligning your costs with your business goals and requirements
Implementing Microsoft best practices and well-architected principles
Monitoring and managing your costs across your complex and dynamic environment
Identifying and addressing inefficiencies and waste
Improving your operational processes and practices
We hope you find this document useful and informative, and we encourage you to try out these tools and services to optimize your Azure costs. If you have any suggestions or feedback, please let us know in the comments. Happy cloud computing!
References
[1] Get started with Cost Management reporting – Azure – Microsoft Cost Management | Microsoft Learn
[2] Tutorial – Create and manage exported data from Cost Management – Microsoft Cost Management | Microsoft Learn
[3] Introduction to Azure Advisor – Azure Advisor | Microsoft Learn
[4] Microsoft Azure Well-Architected Framework – Microsoft Azure Well-Architected Framework | Microsoft Learn
[5] Optimize Azure workloads by using Advisor score – Azure Advisor | Microsoft Learn
[6] Cost recommendations – Azure Advisor | Microsoft Learn
[7] Use and customize the Cost optimization workbook – Cloud Computing | Microsoft Learn
[8] Cloud rationalization – Cloud Adoption Framework | Microsoft Learn
[9] Azure Well-Architected Framework – Microsoft Azure Well-Architected Framework | Microsoft Learn
[10] Cost Management | Microsoft Azure Blog | Microsoft Azure
[11] Get started with Cost Management reporting – Azure – Microsoft Cost Management | Microsoft Learn
Microsoft Tech Community – Latest Blogs –Read More
VerifyEqual within a time interval
Hello, I have been assigned a series of tests to be completed on several floating point variables. The assignment requires me to check whether the Expected value is the same as the Actual value. However, it may take a few milliseconds for the Actual value to reach the same status as the Expected value, and the verifyEqual function does not seem to consider this scenario.
I’d like to know if there is some sort of workaround for this situation. Basically, if A is the Actual value and E the Expected value, I’d like to modify (somehow) the verifyEqual function so that it returns a passing test if A == E with a time delay of approx. 3 milliseconds.
Thank you for your cooperation.Hello, I have been assigned a series of tests to be completed on several floating point variables. The assignment requires me to check whether the Expected value is the same as the Actual value. However, it may take a few milliseconds for the Actual value to reach the same status as the Expected value, and the verifyEqual function does not seem to consider this scenario.
I’d like to know if there is some sort of workaround for this situation. Basically, if A is the Actual value and E the Expected value, I’d like to modify (somehow) the verifyEqual function so that it returns a passing test if A == E with a time delay of approx. 3 milliseconds.
Thank you for your cooperation. Hello, I have been assigned a series of tests to be completed on several floating point variables. The assignment requires me to check whether the Expected value is the same as the Actual value. However, it may take a few milliseconds for the Actual value to reach the same status as the Expected value, and the verifyEqual function does not seem to consider this scenario.
I’d like to know if there is some sort of workaround for this situation. Basically, if A is the Actual value and E the Expected value, I’d like to modify (somehow) the verifyEqual function so that it returns a passing test if A == E with a time delay of approx. 3 milliseconds.
Thank you for your cooperation. matlab function, testcase, guide, solve, time MATLAB Answers — New Questions
Adjust the fitting for non-unique values data (alternative to the fuction smoothing spline, createFit.f)
Good morning everyone,
I am trying to extract the fracture aperture from a tomography image. I have written the code for the extraction, and everything works using the fitting smoothing spline (createFit function attached) for clu_sli_12.mat and I_12.mat, but not on clu_sli_1400.mat and I_1400.mat in which we have non-unique data (presented directly in the code below). The variable clu_sli_1400 represents the point cloud used as reference for selecting data in the tomography slice (variable I_1400). We tried using other functions in matlab, without success. Can anybody help suggesting a specific function for fitting this data?
thanks in advance for any help!!!!!!!!
clear;
close all;
clc;
warning off;
load(‘I_1400.mat’)
load(‘clu_sli_1400.mat’)
voxel_size=70.69*10^-3;
%% Iteration on the slices
mean_widths = [];
std_widths = [];
min_widths = [];
max_widths = [];
areas = [];
% for ii = 12 %we have to iterate to ii = 12 and ii = 1400 (the last one not working properly on the fitting)
% fitting data
X = clu_sli(:,1);
Y = clu_sli(:,2);
% Create model fitting
[fitresult, gof] = createFit(X, Y);
% Calcolare i valori della curva di fitting
vv = ppval(fitresult.p, X);
% Calcolare la prima derivata della curva di fitting
d1 = ppval(fnder(fitresult.p, 1), X);
% Calcolare la normale alla curva di fitting
epsilon = 1e-10; % Evita la divisione per zero
nn = 1 ./ (d1 + epsilon);
% Calcolare gli angoli delle normali
theta = atan(-1 ./ d1); % Angolo della normale (in radianti)
% Calcolare le componenti della normale
normal_x = cos(theta); % Componente x della normale
normal_y = sin(theta); % Componente y della normale
% Calcolare l’ampiezza della crepa e visualizzare i segmenti
span = 50;
largh = zeros(size(clu_sli, 1), 1);
% Creare una figura con due subplot
figure;
% Primo subplot: Visualizzare la slice con i pallini rossi
subplot(1, 2, 1);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
xlabel(‘X’);
ylabel(‘Y’);
% Secondo subplot: Visualizzare la slice con i segmenti verdi
subplot(1, 2, 2);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
plot(X, vv, ‘b’, ‘LineWidth’, 2);
quiver(X, vv, normal_x, normal_y, 0.5, ‘k’, ‘LineWidth’, 1);
intensity_profiles = cell(size(clu_sli, 1), 1);
vet_in = zeros(size(clu_sli, 1), 2);
vet_fin = zeros(size(clu_sli, 1), 2);
for kk = 1:size(clu_sli, 1)
c = round(X(kk));
r = round(vv(kk));
% Genera i pixel lungo la normale
x_profile = round(c + (-span:span) * normal_x(kk));
y_profile = round(r + (-span:span) * normal_y(kk));
% Assicurarsi che i pixel siano all’interno dell’immagine
valid_idx = x_profile > 0 & x_profile <= size(I, 2) & y_profile > 0 & y_profile <= size(I, 1);
x_profile = x_profile(valid_idx);
y_profile = y_profile(valid_idx);
% Estrarre i valori del profilo dall’immagine
profilo = I(sub2ind(size(I), y_profile, x_profile));
intensity_profiles{kk} = profilo;
% Calcolare l’ampiezza della crepa
largh(kk) = conv_crepa(profilo);
% Calcolare i punti del segmento di larghezza
half_width = largh(kk) / 2;
segment_x = [c – half_width * normal_x(kk), c + half_width * normal_x(kk)];
segment_y = [r – half_width * normal_y(kk), r + half_width * normal_y(kk)];
vet_in(kk,1) = c – half_width * normal_x(kk);
vet_fin(kk,1) = c + half_width * normal_x(kk);
vet_in(kk,2) = r – half_width * normal_y(kk);
vet_fin(kk,2) = r + half_width * normal_y(kk);
% Visualizzare il segmento di larghezza
plot(segment_x, segment_y, ‘g’, ‘LineWidth’, 2);
end
hold off;
% Calcolare la media, la deviazione standard, il minimo e il massimo della larghezza della crepa
mean_width = mean(largh, ‘omitnan’);
std_width = std(largh, ‘omitnan’);
min_width = min(largh, [], ‘omitnan’);
max_width = max(largh, [], ‘omitnan’);
mean_widths = [mean_widths; mean_width];
std_widths = [std_widths; std_width];
min_widths = [min_widths; min_width];
max_widths = [max_widths; max_width];
% Calcolo dell’area all’interno delle curve usando trapz
% Creazione del poligono per calcolare l’area
all_x = [vet_in(:,1); flip(vet_fin(:,1))];
all_y = [vet_in(:,2); flip(vet_fin(:,2))];
% Rimuovi i NaN
valid_idx = ~isnan(all_x) & ~isnan(all_y);
all_x = all_x(valid_idx);
all_y = all_y(valid_idx);
% Assicurarsi che i punti formino un poligono chiuso
if length(all_x) > 1 && (all_x(1) ~= all_x(end) || all_y(1) ~= all_y(end))
all_x(end+1) = all_x(1);
all_y(end+1) = all_y(1);
end
% Calcolo dell’area del poligono usando trapz
area = trapz(all_x, all_y);
areas = [areas; area];
title(‘Area Between Curves per Slice’);
%% calcoli in mm
areas_mm = areas.* voxel_size^2
std_mm=std_widths.*voxel_size
mean_mm=mean_widths.*voxel_size
min_mm=min_widths.*voxel_size
max_mm=max_widths.*voxel_sizeGood morning everyone,
I am trying to extract the fracture aperture from a tomography image. I have written the code for the extraction, and everything works using the fitting smoothing spline (createFit function attached) for clu_sli_12.mat and I_12.mat, but not on clu_sli_1400.mat and I_1400.mat in which we have non-unique data (presented directly in the code below). The variable clu_sli_1400 represents the point cloud used as reference for selecting data in the tomography slice (variable I_1400). We tried using other functions in matlab, without success. Can anybody help suggesting a specific function for fitting this data?
thanks in advance for any help!!!!!!!!
clear;
close all;
clc;
warning off;
load(‘I_1400.mat’)
load(‘clu_sli_1400.mat’)
voxel_size=70.69*10^-3;
%% Iteration on the slices
mean_widths = [];
std_widths = [];
min_widths = [];
max_widths = [];
areas = [];
% for ii = 12 %we have to iterate to ii = 12 and ii = 1400 (the last one not working properly on the fitting)
% fitting data
X = clu_sli(:,1);
Y = clu_sli(:,2);
% Create model fitting
[fitresult, gof] = createFit(X, Y);
% Calcolare i valori della curva di fitting
vv = ppval(fitresult.p, X);
% Calcolare la prima derivata della curva di fitting
d1 = ppval(fnder(fitresult.p, 1), X);
% Calcolare la normale alla curva di fitting
epsilon = 1e-10; % Evita la divisione per zero
nn = 1 ./ (d1 + epsilon);
% Calcolare gli angoli delle normali
theta = atan(-1 ./ d1); % Angolo della normale (in radianti)
% Calcolare le componenti della normale
normal_x = cos(theta); % Componente x della normale
normal_y = sin(theta); % Componente y della normale
% Calcolare l’ampiezza della crepa e visualizzare i segmenti
span = 50;
largh = zeros(size(clu_sli, 1), 1);
% Creare una figura con due subplot
figure;
% Primo subplot: Visualizzare la slice con i pallini rossi
subplot(1, 2, 1);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
xlabel(‘X’);
ylabel(‘Y’);
% Secondo subplot: Visualizzare la slice con i segmenti verdi
subplot(1, 2, 2);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
plot(X, vv, ‘b’, ‘LineWidth’, 2);
quiver(X, vv, normal_x, normal_y, 0.5, ‘k’, ‘LineWidth’, 1);
intensity_profiles = cell(size(clu_sli, 1), 1);
vet_in = zeros(size(clu_sli, 1), 2);
vet_fin = zeros(size(clu_sli, 1), 2);
for kk = 1:size(clu_sli, 1)
c = round(X(kk));
r = round(vv(kk));
% Genera i pixel lungo la normale
x_profile = round(c + (-span:span) * normal_x(kk));
y_profile = round(r + (-span:span) * normal_y(kk));
% Assicurarsi che i pixel siano all’interno dell’immagine
valid_idx = x_profile > 0 & x_profile <= size(I, 2) & y_profile > 0 & y_profile <= size(I, 1);
x_profile = x_profile(valid_idx);
y_profile = y_profile(valid_idx);
% Estrarre i valori del profilo dall’immagine
profilo = I(sub2ind(size(I), y_profile, x_profile));
intensity_profiles{kk} = profilo;
% Calcolare l’ampiezza della crepa
largh(kk) = conv_crepa(profilo);
% Calcolare i punti del segmento di larghezza
half_width = largh(kk) / 2;
segment_x = [c – half_width * normal_x(kk), c + half_width * normal_x(kk)];
segment_y = [r – half_width * normal_y(kk), r + half_width * normal_y(kk)];
vet_in(kk,1) = c – half_width * normal_x(kk);
vet_fin(kk,1) = c + half_width * normal_x(kk);
vet_in(kk,2) = r – half_width * normal_y(kk);
vet_fin(kk,2) = r + half_width * normal_y(kk);
% Visualizzare il segmento di larghezza
plot(segment_x, segment_y, ‘g’, ‘LineWidth’, 2);
end
hold off;
% Calcolare la media, la deviazione standard, il minimo e il massimo della larghezza della crepa
mean_width = mean(largh, ‘omitnan’);
std_width = std(largh, ‘omitnan’);
min_width = min(largh, [], ‘omitnan’);
max_width = max(largh, [], ‘omitnan’);
mean_widths = [mean_widths; mean_width];
std_widths = [std_widths; std_width];
min_widths = [min_widths; min_width];
max_widths = [max_widths; max_width];
% Calcolo dell’area all’interno delle curve usando trapz
% Creazione del poligono per calcolare l’area
all_x = [vet_in(:,1); flip(vet_fin(:,1))];
all_y = [vet_in(:,2); flip(vet_fin(:,2))];
% Rimuovi i NaN
valid_idx = ~isnan(all_x) & ~isnan(all_y);
all_x = all_x(valid_idx);
all_y = all_y(valid_idx);
% Assicurarsi che i punti formino un poligono chiuso
if length(all_x) > 1 && (all_x(1) ~= all_x(end) || all_y(1) ~= all_y(end))
all_x(end+1) = all_x(1);
all_y(end+1) = all_y(1);
end
% Calcolo dell’area del poligono usando trapz
area = trapz(all_x, all_y);
areas = [areas; area];
title(‘Area Between Curves per Slice’);
%% calcoli in mm
areas_mm = areas.* voxel_size^2
std_mm=std_widths.*voxel_size
mean_mm=mean_widths.*voxel_size
min_mm=min_widths.*voxel_size
max_mm=max_widths.*voxel_size Good morning everyone,
I am trying to extract the fracture aperture from a tomography image. I have written the code for the extraction, and everything works using the fitting smoothing spline (createFit function attached) for clu_sli_12.mat and I_12.mat, but not on clu_sli_1400.mat and I_1400.mat in which we have non-unique data (presented directly in the code below). The variable clu_sli_1400 represents the point cloud used as reference for selecting data in the tomography slice (variable I_1400). We tried using other functions in matlab, without success. Can anybody help suggesting a specific function for fitting this data?
thanks in advance for any help!!!!!!!!
clear;
close all;
clc;
warning off;
load(‘I_1400.mat’)
load(‘clu_sli_1400.mat’)
voxel_size=70.69*10^-3;
%% Iteration on the slices
mean_widths = [];
std_widths = [];
min_widths = [];
max_widths = [];
areas = [];
% for ii = 12 %we have to iterate to ii = 12 and ii = 1400 (the last one not working properly on the fitting)
% fitting data
X = clu_sli(:,1);
Y = clu_sli(:,2);
% Create model fitting
[fitresult, gof] = createFit(X, Y);
% Calcolare i valori della curva di fitting
vv = ppval(fitresult.p, X);
% Calcolare la prima derivata della curva di fitting
d1 = ppval(fnder(fitresult.p, 1), X);
% Calcolare la normale alla curva di fitting
epsilon = 1e-10; % Evita la divisione per zero
nn = 1 ./ (d1 + epsilon);
% Calcolare gli angoli delle normali
theta = atan(-1 ./ d1); % Angolo della normale (in radianti)
% Calcolare le componenti della normale
normal_x = cos(theta); % Componente x della normale
normal_y = sin(theta); % Componente y della normale
% Calcolare l’ampiezza della crepa e visualizzare i segmenti
span = 50;
largh = zeros(size(clu_sli, 1), 1);
% Creare una figura con due subplot
figure;
% Primo subplot: Visualizzare la slice con i pallini rossi
subplot(1, 2, 1);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
xlabel(‘X’);
ylabel(‘Y’);
% Secondo subplot: Visualizzare la slice con i segmenti verdi
subplot(1, 2, 2);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
plot(X, vv, ‘b’, ‘LineWidth’, 2);
quiver(X, vv, normal_x, normal_y, 0.5, ‘k’, ‘LineWidth’, 1);
intensity_profiles = cell(size(clu_sli, 1), 1);
vet_in = zeros(size(clu_sli, 1), 2);
vet_fin = zeros(size(clu_sli, 1), 2);
for kk = 1:size(clu_sli, 1)
c = round(X(kk));
r = round(vv(kk));
% Genera i pixel lungo la normale
x_profile = round(c + (-span:span) * normal_x(kk));
y_profile = round(r + (-span:span) * normal_y(kk));
% Assicurarsi che i pixel siano all’interno dell’immagine
valid_idx = x_profile > 0 & x_profile <= size(I, 2) & y_profile > 0 & y_profile <= size(I, 1);
x_profile = x_profile(valid_idx);
y_profile = y_profile(valid_idx);
% Estrarre i valori del profilo dall’immagine
profilo = I(sub2ind(size(I), y_profile, x_profile));
intensity_profiles{kk} = profilo;
% Calcolare l’ampiezza della crepa
largh(kk) = conv_crepa(profilo);
% Calcolare i punti del segmento di larghezza
half_width = largh(kk) / 2;
segment_x = [c – half_width * normal_x(kk), c + half_width * normal_x(kk)];
segment_y = [r – half_width * normal_y(kk), r + half_width * normal_y(kk)];
vet_in(kk,1) = c – half_width * normal_x(kk);
vet_fin(kk,1) = c + half_width * normal_x(kk);
vet_in(kk,2) = r – half_width * normal_y(kk);
vet_fin(kk,2) = r + half_width * normal_y(kk);
% Visualizzare il segmento di larghezza
plot(segment_x, segment_y, ‘g’, ‘LineWidth’, 2);
end
hold off;
% Calcolare la media, la deviazione standard, il minimo e il massimo della larghezza della crepa
mean_width = mean(largh, ‘omitnan’);
std_width = std(largh, ‘omitnan’);
min_width = min(largh, [], ‘omitnan’);
max_width = max(largh, [], ‘omitnan’);
mean_widths = [mean_widths; mean_width];
std_widths = [std_widths; std_width];
min_widths = [min_widths; min_width];
max_widths = [max_widths; max_width];
% Calcolo dell’area all’interno delle curve usando trapz
% Creazione del poligono per calcolare l’area
all_x = [vet_in(:,1); flip(vet_fin(:,1))];
all_y = [vet_in(:,2); flip(vet_fin(:,2))];
% Rimuovi i NaN
valid_idx = ~isnan(all_x) & ~isnan(all_y);
all_x = all_x(valid_idx);
all_y = all_y(valid_idx);
% Assicurarsi che i punti formino un poligono chiuso
if length(all_x) > 1 && (all_x(1) ~= all_x(end) || all_y(1) ~= all_y(end))
all_x(end+1) = all_x(1);
all_y(end+1) = all_y(1);
end
% Calcolo dell’area del poligono usando trapz
area = trapz(all_x, all_y);
areas = [areas; area];
title(‘Area Between Curves per Slice’);
%% calcoli in mm
areas_mm = areas.* voxel_size^2
std_mm=std_widths.*voxel_size
mean_mm=mean_widths.*voxel_size
min_mm=min_widths.*voxel_size
max_mm=max_widths.*voxel_size curve fitting, non-unique data, createfit MATLAB Answers — New Questions
A simple allocation of array places to zero does not work in MATLAB R2020B
I have a numeric array KSE
I have identified a number of locations where there are peaks,
locations =
Columns 1 through 10
147 827 3772 4762 5192 5618 6048 6481 6915 7350
Columns 11 through 20
7781 8206 8637 9070 9502 9938 10367 10793 11225 11657
Columns 21 through 26
12922 13876 20315 23377 24431 25492
I have identified in that array a number of locations where there are short lived transients, a number of which I wish to remove.
Those unwanted transients are identified by
ii =
1 2 3 21 22 23 24 25 26
The command
KSE(locations(ii)-50:locations(ii)+50)=0
is meant to replace 50 array elements on either side of the transient location with a zero.
It works well at the first location but not in the remaining 8 locations!
Is this a bug or am I doing some sort of stupid coding mistake?
Any soultions would be appreciated!I have a numeric array KSE
I have identified a number of locations where there are peaks,
locations =
Columns 1 through 10
147 827 3772 4762 5192 5618 6048 6481 6915 7350
Columns 11 through 20
7781 8206 8637 9070 9502 9938 10367 10793 11225 11657
Columns 21 through 26
12922 13876 20315 23377 24431 25492
I have identified in that array a number of locations where there are short lived transients, a number of which I wish to remove.
Those unwanted transients are identified by
ii =
1 2 3 21 22 23 24 25 26
The command
KSE(locations(ii)-50:locations(ii)+50)=0
is meant to replace 50 array elements on either side of the transient location with a zero.
It works well at the first location but not in the remaining 8 locations!
Is this a bug or am I doing some sort of stupid coding mistake?
Any soultions would be appreciated! I have a numeric array KSE
I have identified a number of locations where there are peaks,
locations =
Columns 1 through 10
147 827 3772 4762 5192 5618 6048 6481 6915 7350
Columns 11 through 20
7781 8206 8637 9070 9502 9938 10367 10793 11225 11657
Columns 21 through 26
12922 13876 20315 23377 24431 25492
I have identified in that array a number of locations where there are short lived transients, a number of which I wish to remove.
Those unwanted transients are identified by
ii =
1 2 3 21 22 23 24 25 26
The command
KSE(locations(ii)-50:locations(ii)+50)=0
is meant to replace 50 array elements on either side of the transient location with a zero.
It works well at the first location but not in the remaining 8 locations!
Is this a bug or am I doing some sort of stupid coding mistake?
Any soultions would be appreciated! setting array elements to zero MATLAB Answers — New Questions
I want to add two histograms with error bars to a piece of code I already have that is generating two plots
I have a piece of code that is currently calculating stress/strain and force/extension.
It groups them into catagories based on the temperature and time they were sintered for.
I would like to add histograsm that can also show the modulus of elasticity and the ultimate tensile strength for these groups. The modulus of elasticity should be for say a range from ~0.05 to 0.15 extension, or similar. The error bars should show +/- the stdev for the data sets
would also like to make it so that the legend expressly states the sintering cycle.
For example ‘conventional sintering’ two-stage sintering’, ‘sintered at x°C for x hours’ etc
below is the code
clear
close all
Nsamples = 14;
G=ones(1,2*Nsamples);
G(1:12)=1;
G([2:1:4 10:1:11])=2;
G(5:1:9)=3;
G(13:14)=4;
%%
load(‘E:DICsintering_dataOXmcdata.mat’)
% G(15)=5;
% G(16)=6;
% G(13:14)=5;
% M={‘x’,’+’,’*’,’s’,’d’}; % a marker for each group
C={‘r’,’b’,’m’,’g’,’m’,’y’}; % and a color
L = 90; % coupon gauge section (mm)
A = 18; % coupon cross-sectional area (mm^2)
figure(1);
hold on
figure(2);
hold on
for k = 1:Nsamples
file_name = [‘Sample’ num2str(k) ‘.csv’];
T = readtable(file_name,’VariableNamingRule’,’preserve’);
[test(k).disp,test(k).force,test(k).eyy] = post_fun(T);
ig=G(k); % get group id for kth file
figure(1)
% h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Color’,C{ig});
figure(2)
% g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Color’,C{ig});
leg_string{k} = [‘Sintering schedule ‘ num2str(ig)];
end
%
%%
figure(1)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Displacement (mm)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Force (kN)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Force / extension curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(h([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%%
figure(2)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Strain (%)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Stress (MPa)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Stress / strain curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(g([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%
plot(OXmcdata(:,1),OXmcdata(:,2),’DisplayName’,’Farhandi et al (2021)’,’LineWidth’,3,’Color’,’k’,’LineStyle’,’–‘);
%
xlim([0 3E-1]);
ylim([0 350]);
%%
function [displ,force,eyy] = post_fun(T)
displ=T{:,4};
force=T{:,end};
eyy =T{:,10};
ix=all(isfinite([displ force eyy]),2) & all([displ force eyy]>0,2);
displ=displ(ix);
force=force(ix);
eyy=eyy(ix);
[~,imax] = max(force);
displ(imax+1:end) = [];
force(imax+1:end) = [];
eyy(imax+1:end) = [];
end
Hopefully you can help.
Thanks
AlexI have a piece of code that is currently calculating stress/strain and force/extension.
It groups them into catagories based on the temperature and time they were sintered for.
I would like to add histograsm that can also show the modulus of elasticity and the ultimate tensile strength for these groups. The modulus of elasticity should be for say a range from ~0.05 to 0.15 extension, or similar. The error bars should show +/- the stdev for the data sets
would also like to make it so that the legend expressly states the sintering cycle.
For example ‘conventional sintering’ two-stage sintering’, ‘sintered at x°C for x hours’ etc
below is the code
clear
close all
Nsamples = 14;
G=ones(1,2*Nsamples);
G(1:12)=1;
G([2:1:4 10:1:11])=2;
G(5:1:9)=3;
G(13:14)=4;
%%
load(‘E:DICsintering_dataOXmcdata.mat’)
% G(15)=5;
% G(16)=6;
% G(13:14)=5;
% M={‘x’,’+’,’*’,’s’,’d’}; % a marker for each group
C={‘r’,’b’,’m’,’g’,’m’,’y’}; % and a color
L = 90; % coupon gauge section (mm)
A = 18; % coupon cross-sectional area (mm^2)
figure(1);
hold on
figure(2);
hold on
for k = 1:Nsamples
file_name = [‘Sample’ num2str(k) ‘.csv’];
T = readtable(file_name,’VariableNamingRule’,’preserve’);
[test(k).disp,test(k).force,test(k).eyy] = post_fun(T);
ig=G(k); % get group id for kth file
figure(1)
% h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Color’,C{ig});
figure(2)
% g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Color’,C{ig});
leg_string{k} = [‘Sintering schedule ‘ num2str(ig)];
end
%
%%
figure(1)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Displacement (mm)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Force (kN)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Force / extension curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(h([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%%
figure(2)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Strain (%)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Stress (MPa)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Stress / strain curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(g([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%
plot(OXmcdata(:,1),OXmcdata(:,2),’DisplayName’,’Farhandi et al (2021)’,’LineWidth’,3,’Color’,’k’,’LineStyle’,’–‘);
%
xlim([0 3E-1]);
ylim([0 350]);
%%
function [displ,force,eyy] = post_fun(T)
displ=T{:,4};
force=T{:,end};
eyy =T{:,10};
ix=all(isfinite([displ force eyy]),2) & all([displ force eyy]>0,2);
displ=displ(ix);
force=force(ix);
eyy=eyy(ix);
[~,imax] = max(force);
displ(imax+1:end) = [];
force(imax+1:end) = [];
eyy(imax+1:end) = [];
end
Hopefully you can help.
Thanks
Alex I have a piece of code that is currently calculating stress/strain and force/extension.
It groups them into catagories based on the temperature and time they were sintered for.
I would like to add histograsm that can also show the modulus of elasticity and the ultimate tensile strength for these groups. The modulus of elasticity should be for say a range from ~0.05 to 0.15 extension, or similar. The error bars should show +/- the stdev for the data sets
would also like to make it so that the legend expressly states the sintering cycle.
For example ‘conventional sintering’ two-stage sintering’, ‘sintered at x°C for x hours’ etc
below is the code
clear
close all
Nsamples = 14;
G=ones(1,2*Nsamples);
G(1:12)=1;
G([2:1:4 10:1:11])=2;
G(5:1:9)=3;
G(13:14)=4;
%%
load(‘E:DICsintering_dataOXmcdata.mat’)
% G(15)=5;
% G(16)=6;
% G(13:14)=5;
% M={‘x’,’+’,’*’,’s’,’d’}; % a marker for each group
C={‘r’,’b’,’m’,’g’,’m’,’y’}; % and a color
L = 90; % coupon gauge section (mm)
A = 18; % coupon cross-sectional area (mm^2)
figure(1);
hold on
figure(2);
hold on
for k = 1:Nsamples
file_name = [‘Sample’ num2str(k) ‘.csv’];
T = readtable(file_name,’VariableNamingRule’,’preserve’);
[test(k).disp,test(k).force,test(k).eyy] = post_fun(T);
ig=G(k); % get group id for kth file
figure(1)
% h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Color’,C{ig});
figure(2)
% g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Color’,C{ig});
leg_string{k} = [‘Sintering schedule ‘ num2str(ig)];
end
%
%%
figure(1)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Displacement (mm)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Force (kN)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Force / extension curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(h([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%%
figure(2)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Strain (%)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Stress (MPa)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Stress / strain curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(g([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%
plot(OXmcdata(:,1),OXmcdata(:,2),’DisplayName’,’Farhandi et al (2021)’,’LineWidth’,3,’Color’,’k’,’LineStyle’,’–‘);
%
xlim([0 3E-1]);
ylim([0 350]);
%%
function [displ,force,eyy] = post_fun(T)
displ=T{:,4};
force=T{:,end};
eyy =T{:,10};
ix=all(isfinite([displ force eyy]),2) & all([displ force eyy]>0,2);
displ=displ(ix);
force=force(ix);
eyy=eyy(ix);
[~,imax] = max(force);
displ(imax+1:end) = [];
force(imax+1:end) = [];
eyy(imax+1:end) = [];
end
Hopefully you can help.
Thanks
Alex histogram, bar, error, errorbars MATLAB Answers — New Questions
Save as option greyed out
The Save as option on the new Outlook and OWA has been greyed out for a few weeks now, meaning I can’t save emails as .eml to include the attachments. Does anyone know why this is? It’s getting very frustrating.
The Save as option on the new Outlook and OWA has been greyed out for a few weeks now, meaning I can’t save emails as .eml to include the attachments. Does anyone know why this is? It’s getting very frustrating. Read More
Update not getting installed: Cumulative Update for Windows 11 Insider Preview (10.0.26120.1330) (KB
Hi team,
For my device the Cumulative Update for Windows 11 Insider Preview (10.0.26120.1330) (KB5040543) is not getting installed and getting error message Install error – 0x800f0993 while trying to install. Kindly get this fixed and assist to get it installed on my device.
Hi team, For my device the Cumulative Update for Windows 11 Insider Preview (10.0.26120.1330) (KB5040543) is not getting installed and getting error message Install error – 0x800f0993 while trying to install. Kindly get this fixed and assist to get it installed on my device. Read More
Error when adding users to MS Teams Channel
I work in the NHS as an admin for a country wide network.
We add users from accross the United Kingdom into Teams Channels we have created for cross-working.
I have come accross an issue where when trying to add a user to a Teams channel (Created in Manchester, I am the owner) I recieve an error saying 0 of 1 members were added, there was an error.
My colleague (also an owner) can’t add them either but when accessing MS Teams on their phone app can see that the individual is already added to the channel, but can’t see them in desktop.
The user cannot access the Teams channel and when either trying to switch accounts to Manchester University (where the channel is accessible for all other users) or following a link to the channel they receive an error stating their log in credentials are invalid and their account is locked.
I haved tried reaching out to our IT team and they are unable to assist, any ideas on what could be causing the issue?
Thanks
I work in the NHS as an admin for a country wide network.We add users from accross the United Kingdom into Teams Channels we have created for cross-working.I have come accross an issue where when trying to add a user to a Teams channel (Created in Manchester, I am the owner) I recieve an error saying 0 of 1 members were added, there was an error.My colleague (also an owner) can’t add them either but when accessing MS Teams on their phone app can see that the individual is already added to the channel, but can’t see them in desktop.The user cannot access the Teams channel and when either trying to switch accounts to Manchester University (where the channel is accessible for all other users) or following a link to the channel they receive an error stating their log in credentials are invalid and their account is locked.I haved tried reaching out to our IT team and they are unable to assist, any ideas on what could be causing the issue?Thanks Read More
Extracting data across sheets based on variables in sheet 1
Hello all, I am trying to find a way to extract data in column 1, into another sheet to be viewed in a list there, but based on variables in column 3. This is for work so I cant share the actual example, but I have thrown together a simple example to show it in excel. Based on my example attached, I am trying to extract the tasks that are “not done” into the other dashboard sheet to be able to use the sheet as a quick overview without having to go through the table
I have tried to write an XLOOKUP formula to do this but I can’t seem to get it working, any help would be greatly appreciated!!
Hello all, I am trying to find a way to extract data in column 1, into another sheet to be viewed in a list there, but based on variables in column 3. This is for work so I cant share the actual example, but I have thrown together a simple example to show it in excel. Based on my example attached, I am trying to extract the tasks that are “not done” into the other dashboard sheet to be able to use the sheet as a quick overview without having to go through the table I have tried to write an XLOOKUP formula to do this but I can’t seem to get it working, any help would be greatly appreciated!! Read More
User Forms with Dependent Drop-down Selections
Hi all,
I have two doubts I would like to share to the wider community for help. I am trying to enable multiple dependent drop-down forms with multiple selections (combining some VBA code) to collect some data. Nonetheless, I am facing two issues when doing so.
I have a drop-down in which you can select from 1 to 9 options. This should trigger a second drop-down based on the concatenated sub-categories made in those selections on the next column (e.g.: If you selected “fish” and “vegetables”; in the next column you should have all fishes and all vegetables inside the dropdown [mackerel, salmon, cucumber, spinach]). This, which can be intuitive, has been a nightmare on the backend:I had to go to a programming language (R in my case) to create all the different 511 possible combinations of items from the selections, putting all titles alphabetically ordered and in named_ranges style.I pasted that creation to Excel, the 511 different named ranges and automatically created a formula for crafting 511 named ranges taking into account the different lengths.Finally, I created on the main table a helper column ordering the first selection alphabetically (with yet again another VBA formula) so that I could match with =INDIRECT(“helper_column_cell”) the different possible concatentations. A long journey given the fact I did not see a way to seamlessly join different named ranges…A second issue has to do with the multiple selection. I achieved having the dropdown with the right data depending on the first 1 to 9 combinations input; enabling me to select multiple items from the resulting list, concatenating them with commas and not allowing repetitions. Nonetheless, each input requires reopening the drop-down again, and I would like that to be done in one shot. I thought about a user form, but it looks as adapting the options to the 511 possible combinations is dreamland. Below you see the code I do have for now:Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDataMapping As Range
Dim Oldvalue As String
Dim Newvalue As String
Dim arr() As String
Dim Output As String
Dim i As Integer
‘ Set the range for the multiple drop-down (columns O and R in this case)
Set rngDataMapping = Intersect(Me.Range(“O:O, R:R, S:S”), Target)
If Not rngDataMapping Is Nothing Then
Application.EnableEvents = False
On Error GoTo Exitsub
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then GoTo Exitsub Else
If Target.Value = “” Then GoTo Exitsub Else
Application.Undo
Oldvalue = Target.Value
Application.Undo
Newvalue = Target.Value
‘ Check if the new value already exists
If InStr(1, Oldvalue, Newvalue) = 0 Then
If Oldvalue = “” Then
Target.Value = Newvalue
Else
arr = Split(Oldvalue, “, “)
Output = “”
For i = LBound(arr) To UBound(arr)
If arr(i) <> Newvalue Then
If Output = “” Then
Output = arr(i)
Else
Output = Output & “, ” & arr(i)
End If
End If
Next i
If Output = “” Then
Output = Newvalue
Else
Output = Newvalue & “, ” & Output
End If
Target.Value = Output
End If
End If
End If
Exitsub:
Application.EnableEvents = True
Exit Sub
End Sub
Do you have any recommendation on better and more efficient solutions to Problem 1? Is there any way to sort out the issue on problem 2 to allow the users to do multiple selections without the drop-down collapsing with any new input? I would really appreciate your mastery and comments!
Hi all, I have two doubts I would like to share to the wider community for help. I am trying to enable multiple dependent drop-down forms with multiple selections (combining some VBA code) to collect some data. Nonetheless, I am facing two issues when doing so. I have a drop-down in which you can select from 1 to 9 options. This should trigger a second drop-down based on the concatenated sub-categories made in those selections on the next column (e.g.: If you selected “fish” and “vegetables”; in the next column you should have all fishes and all vegetables inside the dropdown [mackerel, salmon, cucumber, spinach]). This, which can be intuitive, has been a nightmare on the backend:I had to go to a programming language (R in my case) to create all the different 511 possible combinations of items from the selections, putting all titles alphabetically ordered and in named_ranges style.I pasted that creation to Excel, the 511 different named ranges and automatically created a formula for crafting 511 named ranges taking into account the different lengths.Finally, I created on the main table a helper column ordering the first selection alphabetically (with yet again another VBA formula) so that I could match with =INDIRECT(“helper_column_cell”) the different possible concatentations. A long journey given the fact I did not see a way to seamlessly join different named ranges…A second issue has to do with the multiple selection. I achieved having the dropdown with the right data depending on the first 1 to 9 combinations input; enabling me to select multiple items from the resulting list, concatenating them with commas and not allowing repetitions. Nonetheless, each input requires reopening the drop-down again, and I would like that to be done in one shot. I thought about a user form, but it looks as adapting the options to the 511 possible combinations is dreamland. Below you see the code I do have for now:Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDataMapping As Range
Dim Oldvalue As String
Dim Newvalue As String
Dim arr() As String
Dim Output As String
Dim i As Integer
‘ Set the range for the multiple drop-down (columns O and R in this case)
Set rngDataMapping = Intersect(Me.Range(“O:O, R:R, S:S”), Target)
If Not rngDataMapping Is Nothing Then
Application.EnableEvents = False
On Error GoTo Exitsub
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then GoTo Exitsub Else
If Target.Value = “” Then GoTo Exitsub Else
Application.Undo
Oldvalue = Target.Value
Application.Undo
Newvalue = Target.Value
‘ Check if the new value already exists
If InStr(1, Oldvalue, Newvalue) = 0 Then
If Oldvalue = “” Then
Target.Value = Newvalue
Else
arr = Split(Oldvalue, “, “)
Output = “”
For i = LBound(arr) To UBound(arr)
If arr(i) <> Newvalue Then
If Output = “” Then
Output = arr(i)
Else
Output = Output & “, ” & arr(i)
End If
End If
Next i
If Output = “” Then
Output = Newvalue
Else
Output = Newvalue & “, ” & Output
End If
Target.Value = Output
End If
End If
End If
Exitsub:
Application.EnableEvents = True
Exit Sub
End SubDo you have any recommendation on better and more efficient solutions to Problem 1? Is there any way to sort out the issue on problem 2 to allow the users to do multiple selections without the drop-down collapsing with any new input? I would really appreciate your mastery and comments! Read More
The Best Spotify Music Downloader for Saving Songs as MP3 for Windows 11?
I found out the music downloaded from Spotify is in OGG format, which is not compatible with many devices and media players. This limitation has been quite frustrating as it restricts my ability to enjoy my Spotify playlist on different devices such as my Windows 11 laptop and car.
Recently, I stumbled upon some Spotify music downloader tools that claim to save Spotify tracks as MP3. However, with so many options available, it’s challenging to determine which one is the best in terms of performance, quality, and ease of use.
If you have used any such tools, please share your insights on their features, user-friendliness, and overall effectiveness. Your feedback will be invaluable in helping me and others find the best solution for enjoying Spotify music seamlessly across multiple devices.
I found out the music downloaded from Spotify is in OGG format, which is not compatible with many devices and media players. This limitation has been quite frustrating as it restricts my ability to enjoy my Spotify playlist on different devices such as my Windows 11 laptop and car. Recently, I stumbled upon some Spotify music downloader tools that claim to save Spotify tracks as MP3. However, with so many options available, it’s challenging to determine which one is the best in terms of performance, quality, and ease of use. If you have used any such tools, please share your insights on their features, user-friendliness, and overall effectiveness. Your feedback will be invaluable in helping me and others find the best solution for enjoying Spotify music seamlessly across multiple devices. Read More
servicePrincipals?$expand=appRoleAssignedTo incomplete result
For an inventory script, I use servicePrincipals?$expand=appRoleAssignedTo to get all serviceprinciples including “approleassignedTo” info.
To make an inventory of the approle assignments, I loop through all apps (~2250) and for each app, I loop through approles, and foreach approle I loop through appRoleAssignedTo data.
In my environment this results in ~3000 approle assignments.
When I analyze the result, I estimate 5% of role assignments are missing.
I do see all roles, just not all roleassignments. When I look up a missing assignments in the Entra portal I do see them.
The missing role assignment aren’t special, they are assigned to normal Entra ID groups like other assigned approles.
When I rerun the script, the same assignments are missing each time.
When I don’t use $expand query parameter, but query the data directly using ‘servicePrincipals/{id}/appRoleAssignedTo’, I do get all assignments.
Did I run into a bug?
For an inventory script, I use servicePrincipals?$expand=appRoleAssignedTo to get all serviceprinciples including “approleassignedTo” info.To make an inventory of the approle assignments, I loop through all apps (~2250) and for each app, I loop through approles, and foreach approle I loop through appRoleAssignedTo data.In my environment this results in ~3000 approle assignments. When I analyze the result, I estimate 5% of role assignments are missing.I do see all roles, just not all roleassignments. When I look up a missing assignments in the Entra portal I do see them.The missing role assignment aren’t special, they are assigned to normal Entra ID groups like other assigned approles. When I rerun the script, the same assignments are missing each time. When I don’t use $expand query parameter, but query the data directly using ‘servicePrincipals/{id}/appRoleAssignedTo’, I do get all assignments. Did I run into a bug? Read More
Searching for the nearest point on a grid using dsearchn
I am trying to compare field data with classified sattellite imagery.
What I am aiming for is to find the nearest pixel in the sattellite image to the location of the field data.
The coordinates of the pixels are in X & Y represented by blue circles below, spacing is 30m x 30m.
The coordinates of the field data is in TransectDataStats.Easting & .Northing represented by "x’s" below.
The dots are the "closest point" as determined by the matlab function dsearchn.
Most of the results look ok but there are some werid ones highlighted in red below that don’t seem right. Some there appears to be a closer point than the one selected and one that doesn’t seem to have a field point anywhere near it.
Questions
Am I using this function correctly?
Can anyone explain why the oddball "nearest points"?
What could be done to fix this?
Is there an alternative function or method to acheive the result I am aiming for?
NearestPoint = dsearchn([X(:),Y(:)],[TransectDataStats.Easting,TransectDataStats.Northing])
figure
plot(X(:),Y(:),’o’)
hold on
plot(X(NearestPoint),Y(NearestPoint),’.’)
plot(TransectDataStats.Easting,TransectDataStats.Northing,’x’)
axis equal
size(X)
ans =
2895 921
size(TransectDataStats.Easting)
ans =
654 1I am trying to compare field data with classified sattellite imagery.
What I am aiming for is to find the nearest pixel in the sattellite image to the location of the field data.
The coordinates of the pixels are in X & Y represented by blue circles below, spacing is 30m x 30m.
The coordinates of the field data is in TransectDataStats.Easting & .Northing represented by "x’s" below.
The dots are the "closest point" as determined by the matlab function dsearchn.
Most of the results look ok but there are some werid ones highlighted in red below that don’t seem right. Some there appears to be a closer point than the one selected and one that doesn’t seem to have a field point anywhere near it.
Questions
Am I using this function correctly?
Can anyone explain why the oddball "nearest points"?
What could be done to fix this?
Is there an alternative function or method to acheive the result I am aiming for?
NearestPoint = dsearchn([X(:),Y(:)],[TransectDataStats.Easting,TransectDataStats.Northing])
figure
plot(X(:),Y(:),’o’)
hold on
plot(X(NearestPoint),Y(NearestPoint),’.’)
plot(TransectDataStats.Easting,TransectDataStats.Northing,’x’)
axis equal
size(X)
ans =
2895 921
size(TransectDataStats.Easting)
ans =
654 1 I am trying to compare field data with classified sattellite imagery.
What I am aiming for is to find the nearest pixel in the sattellite image to the location of the field data.
The coordinates of the pixels are in X & Y represented by blue circles below, spacing is 30m x 30m.
The coordinates of the field data is in TransectDataStats.Easting & .Northing represented by "x’s" below.
The dots are the "closest point" as determined by the matlab function dsearchn.
Most of the results look ok but there are some werid ones highlighted in red below that don’t seem right. Some there appears to be a closer point than the one selected and one that doesn’t seem to have a field point anywhere near it.
Questions
Am I using this function correctly?
Can anyone explain why the oddball "nearest points"?
What could be done to fix this?
Is there an alternative function or method to acheive the result I am aiming for?
NearestPoint = dsearchn([X(:),Y(:)],[TransectDataStats.Easting,TransectDataStats.Northing])
figure
plot(X(:),Y(:),’o’)
hold on
plot(X(NearestPoint),Y(NearestPoint),’.’)
plot(TransectDataStats.Easting,TransectDataStats.Northing,’x’)
axis equal
size(X)
ans =
2895 921
size(TransectDataStats.Easting)
ans =
654 1 dsearchn, satellite imagery, closest pixel, image processing MATLAB Answers — New Questions
How can I find the coefficients of the 2D interpolated function?
My function is . I used following code to interpolation. How can I find the coefficients of the interpolated function ?
Eta = load(‘Eta.txt’);
t = 0:5:(8.25*60); % time
x = [0,3750,7500,8000]; % distance
[X,T] = meshgrid(x,t);
% interpolation
[xq,tq] = meshgrid(0:2:8000,0:(8.25*60)) ;
Eta_intp = interp2(X,T,eta,xq,tq,’spline’);My function is . I used following code to interpolation. How can I find the coefficients of the interpolated function ?
Eta = load(‘Eta.txt’);
t = 0:5:(8.25*60); % time
x = [0,3750,7500,8000]; % distance
[X,T] = meshgrid(x,t);
% interpolation
[xq,tq] = meshgrid(0:2:8000,0:(8.25*60)) ;
Eta_intp = interp2(X,T,eta,xq,tq,’spline’); My function is . I used following code to interpolation. How can I find the coefficients of the interpolated function ?
Eta = load(‘Eta.txt’);
t = 0:5:(8.25*60); % time
x = [0,3750,7500,8000]; % distance
[X,T] = meshgrid(x,t);
% interpolation
[xq,tq] = meshgrid(0:2:8000,0:(8.25*60)) ;
Eta_intp = interp2(X,T,eta,xq,tq,’spline’); 2d interpolation MATLAB Answers — New Questions