Month: October 2024
Azure Backup and DR: Cross-Region Restore – Exploring Solutions
Azure Backup and DR: Cross-Region Restore – Exploring Solutions
When building a Disaster Recovery (DR) plan, customers often face challenges that require creative solutions, especially when capacity issues limit available options in Azure paired regions. In this article, we explore a real-world scenario and evaluate possible solutions for addressing Cross-Region Restore needs using Azure Backup.
Use Case
A customer wants to implement a DR plan based on the following requirements:
Host applications in a specific “XYZ” region.
For critical applications, establish a passive node in another region.
For less critical applications, utilize Cross-Region Restore functionality for VMs using Azure Backup.
Issue
The customer is facing capacity constraints in the paired Azure region associated with “XYZ.” Consequently, they are exploring options to build DR in an alternate region outside the paired one.
Challenge
The key question is: Is there a way to redirect Azure Backup’s Cross-Region Restore functionality to a region outside the default paired region? Or are there other solutions to restore a VM in a non-paired region?
Solution 1: Using Azure Site Recovery (ASR)
Based on Azure Backup documentation, VMs can only be restored to the original or its paired region. This creates a challenge if the paired region lacks the necessary capacity.
In this case, Azure Site Recovery (ASR) could be an alternative solution. For more information on Azure Site Recovery, refer to these resources:
About Azure Site Recovery | Microsoft Learn
Support Matrix for Azure VM Disaster Recovery with ASR | Microsoft Learn
However, the issue with this solution is that ASR is ideal for Azure Virtual Machines. The customer’s scenario involves SQL and PostgreSQL environments that require application-level consistency. ASR may not ensure the consistency needed for such databases, leading the customer to seek alternative solutions.
Solution 2: Leveraging Third-Party Solutions
Since Solution 1 does not fully meet the customer’s needs, an alternative approach is to use third-party backup solutions that allow copying backup data to a region of choice. Notable options include:
Veeam
Rubrik
For more detailed insights, check out Veeam vs. Rubrik: Why Veeam is the Better Choice.
Solution 3: Azure’s Upcoming Feature for Region Flexibility
If the customer prefers to avoid third-party solutions, there is good news. Although Azure Backup currently restricts Cross-Region Restore to paired regions, the Azure Product Group (PG) is actively working on a new feature that will allow customers to replicate backup data between any two regions of their choice. This feature is expected to enter preview by Q1 CY2025.
In the meantime, as a workaround, customers can use AzCopy to manually transfer backup data between regions. However, it’s important to note that this method is not supported for all workloads.
For more details, refer to:
When to use AzCopy versus Azure PowerShell or Azure CLI | Microsoft Community Hub
Microsoft Tech Community – Latest Blogs –Read More
Printing the entire array row in Matlab
I want to print all the rows on the same line of array a and b. How would i be able to do that?
a = [12,3,4,5];
b= [4,5,12,3];
fprintf(‘a: %dnb: %d’,a, b)
Output:
a: 12
b: 3a: 4
b: 5a: 4
b: 5a: 12
b: 3
Expected output
a: [12,3,4,5]
b: [4,5,12,3]I want to print all the rows on the same line of array a and b. How would i be able to do that?
a = [12,3,4,5];
b= [4,5,12,3];
fprintf(‘a: %dnb: %d’,a, b)
Output:
a: 12
b: 3a: 4
b: 5a: 4
b: 5a: 12
b: 3
Expected output
a: [12,3,4,5]
b: [4,5,12,3] I want to print all the rows on the same line of array a and b. How would i be able to do that?
a = [12,3,4,5];
b= [4,5,12,3];
fprintf(‘a: %dnb: %d’,a, b)
Output:
a: 12
b: 3a: 4
b: 5a: 4
b: 5a: 12
b: 3
Expected output
a: [12,3,4,5]
b: [4,5,12,3] arrays, array, vector, fprintf MATLAB Answers — New Questions
MATLAB Function takes [4×1] signal as parameter, but in debug shows as [3×1]. Workaround/fix?
The context here is I am using a MATLAB function which takes a parameter y (x_est) which is shown to be a [4×1] signal above. When ‘make model’ is clicked it gives the error below:
On inspection of the diagnostic report:
This shows that the [4×1] signal (which is initialised as [4×1] by an integrator block) is being interpreted as [3×1]. I am clueless as to why.The context here is I am using a MATLAB function which takes a parameter y (x_est) which is shown to be a [4×1] signal above. When ‘make model’ is clicked it gives the error below:
On inspection of the diagnostic report:
This shows that the [4×1] signal (which is initialised as [4×1] by an integrator block) is being interpreted as [3×1]. I am clueless as to why. The context here is I am using a MATLAB function which takes a parameter y (x_est) which is shown to be a [4×1] signal above. When ‘make model’ is clicked it gives the error below:
On inspection of the diagnostic report:
This shows that the [4×1] signal (which is initialised as [4×1] by an integrator block) is being interpreted as [3×1]. I am clueless as to why. simulink, matlab function MATLAB Answers — New Questions
Unable to set up C++ compiler
Hello,
I’ve been trying for so long to set up the required addons to run my code in MATLAB GPU. I had to install and configure various addons for the same, one such is C++ compiler. I installed MinGW64 and placed it in varous locations in my computer and run the coder.checkGpuInstall(full). Matlab isn’t recognising MinGW 64 at all. I’ve also tried changing the directory address.
Someone please help me with it…Hello,
I’ve been trying for so long to set up the required addons to run my code in MATLAB GPU. I had to install and configure various addons for the same, one such is C++ compiler. I installed MinGW64 and placed it in varous locations in my computer and run the coder.checkGpuInstall(full). Matlab isn’t recognising MinGW 64 at all. I’ve also tried changing the directory address.
Someone please help me with it… Hello,
I’ve been trying for so long to set up the required addons to run my code in MATLAB GPU. I had to install and configure various addons for the same, one such is C++ compiler. I installed MinGW64 and placed it in varous locations in my computer and run the coder.checkGpuInstall(full). Matlab isn’t recognising MinGW 64 at all. I’ve also tried changing the directory address.
Someone please help me with it… c++, mingw, gpu MATLAB Answers — New Questions
AVD on Android
Hi, I have been using AVD for a while now. I want to implement the access of AVD from android phone. I downloaded the app and subscribed to the workspace in the device and I was able to use the AVD from the phone. However, when I try to join the teams meeting, the app behaviour is not stable and the remote session keeps getting disconnected, teams speaker not working etc. Any solutions?
Hi, I have been using AVD for a while now. I want to implement the access of AVD from android phone. I downloaded the app and subscribed to the workspace in the device and I was able to use the AVD from the phone. However, when I try to join the teams meeting, the app behaviour is not stable and the remote session keeps getting disconnected, teams speaker not working etc. Any solutions? Read More
Office 365 for IT Pros October 2024 Update
Monthly Update #112 for Office 365 for IT Pros eBook
The Office 365 for IT Pros eBook team is delighted to announce that files are available for download for the October 2024 update of:
Office 365 for IT Pros (2025 edition) in PDF and EPUB formats.
Automating Microsoft 365 with PowerShell in PDF and EPUB formats.
Subscribers can download the updates files using the link in the receipt emailed to them after their original purchase or from the library in their Gumroad.com account. We no longer make a Kindle version of the Office 365 for IT Pros eBook available through Amazon. It proved too difficult to release updates to readers through the convoluted Amazon process. The Automating Microsoft 365 with PowerShell book is available through Amazon in Kindle and paperback versions. The paperback is our first attempt at delivering a printed book and the response has been interesting. It seems clear that people still like to have text on paper for reference books.
See our change log for information about the changes in the October 2024 update and our FAQ for details about how to download updates.
Notable September Changes in the Ecosystem
To ensure that the book content is updated and remains current, we spend a lot of time tracking change within the Microsoft 365 ecosystem. Three issues that we discussed during September are:
The role of OneDrive for Business within Microsoft 365 and why it’s practically impossible to disable the app. Why does this matter? It’s all about where people store information. No really important files should be in OneDrive for Business because of the issues around access and visibility when people leave an organization. Another concern is how governance and compliance works when essential data is scattered across individual users’ OneDrive accounts instead of being organized in SharePoint Online. Much the same governance issue occurs when people discuss topics in Teams chat and never move the result of the conversation to a team channel.
Managing user profile photos across Microsoft 365 has been a mess for a long time. Microsoft has started to build a new foundation for this task by creating Graph APIs to replace the Exchange Online cmdlets used to add photos to accounts. Now they have a photo settings policy to control who can update their account photo. However, the new policy isn’t very granular and has other issues. Let’s hope that Microsoft develops the policy further to give tenants more flexibility.
A big change to the Teams client UI is coming as Microsoft continues to tweak the interface in ways that sometimes people can’t understand. One of the things that’s happening in Teams is to hide inactive channels automatically. This would be fine if users had control over how Teams hides channels, but Microsoft hasn’t described how Teams identifies inactive channels. In addition, when channels are hidden, Teams suppresses notifications, which means that people might miss important messages from channels used for corporate news (which are often marked as inactive because people don’t tend to post in these channels).
Other stuff is happening too – and all the time- but these are three of the current topics that arose in September that I suspect we’ll hear more about in the future.
On to Update #113
There’s no rest for the wicked and the Office 365 for IT Pros team is already working (or so all the writers tell me) on the Halloween update (#113), which we anticipate releasing on November 1. No doubt lots will happen between this and then to add to the rich tapestry of constant change inside the Microsoft 365 ecosystem.
shared matlab-engine python connections occationally fail with an Unable to connect to MATLAB session error
On a RHEL7 platform, we are running a shared (synchronous) MATLAB session as a systemd service. We are also running 3 python systemd services that connect to the shared matlab engine using matlab_eng = matlab.engine.connect_matlab("OUR_SESSION_NAME_HERE"). After successfully connecting to the shared matlab-engine, the python service will do some MATLAB processing, then do a matlab_eng.quit() to disconnect from the shared matlab-engine. I have 4 questions that I hope somebody could answer. See below.
Regards Debbie
Is matlab_eng.quit() the correct way to disconnect from the shared matlab-engine?
Can you confirm that each of the 3 python systemd services will have it’s own MATLAB workspace?
After our python services have run awhile, we start seeing trouble connecting to the shared matlab-engine. The stack trace looks similar to as shown below. Why would these connection errors only occationally occur and how can we fix this? We have assumed that each of our python processes can use the shared matlab-engine concurrently, is this not correct?
As a follow-up to question 3, why is _future.result showing up in the trace? We started a synchronous matlab-engine, the documentation mentions future results only with respect to asynchronous matlab-engines.
<class ‘matlab.engine.EngineError’>
Unable to connect to MATLAB session ‘OUR_SESSION_NAME_HERE’.
matlab_eng = matlab.engine.connect_matlab(‘OUR_SESSION_NAME_HERE’)
!! File "/usr/lib/python2.7/site-packages/matlab/engine/__init__.py", line 182, in connect_matlab
eng = future.result()
!! File "/usr/lib/python2.7/site-packages/matlab/engine/futureresult.py", line 67, in result
return self.__future.result(timeout)
!! File "/usr/lib/python2.7/site-packages/matlab/engine/matlabfuture.py", line 87, in result
handle = pythonengine.getMATLAB(self._future)On a RHEL7 platform, we are running a shared (synchronous) MATLAB session as a systemd service. We are also running 3 python systemd services that connect to the shared matlab engine using matlab_eng = matlab.engine.connect_matlab("OUR_SESSION_NAME_HERE"). After successfully connecting to the shared matlab-engine, the python service will do some MATLAB processing, then do a matlab_eng.quit() to disconnect from the shared matlab-engine. I have 4 questions that I hope somebody could answer. See below.
Regards Debbie
Is matlab_eng.quit() the correct way to disconnect from the shared matlab-engine?
Can you confirm that each of the 3 python systemd services will have it’s own MATLAB workspace?
After our python services have run awhile, we start seeing trouble connecting to the shared matlab-engine. The stack trace looks similar to as shown below. Why would these connection errors only occationally occur and how can we fix this? We have assumed that each of our python processes can use the shared matlab-engine concurrently, is this not correct?
As a follow-up to question 3, why is _future.result showing up in the trace? We started a synchronous matlab-engine, the documentation mentions future results only with respect to asynchronous matlab-engines.
<class ‘matlab.engine.EngineError’>
Unable to connect to MATLAB session ‘OUR_SESSION_NAME_HERE’.
matlab_eng = matlab.engine.connect_matlab(‘OUR_SESSION_NAME_HERE’)
!! File "/usr/lib/python2.7/site-packages/matlab/engine/__init__.py", line 182, in connect_matlab
eng = future.result()
!! File "/usr/lib/python2.7/site-packages/matlab/engine/futureresult.py", line 67, in result
return self.__future.result(timeout)
!! File "/usr/lib/python2.7/site-packages/matlab/engine/matlabfuture.py", line 87, in result
handle = pythonengine.getMATLAB(self._future) On a RHEL7 platform, we are running a shared (synchronous) MATLAB session as a systemd service. We are also running 3 python systemd services that connect to the shared matlab engine using matlab_eng = matlab.engine.connect_matlab("OUR_SESSION_NAME_HERE"). After successfully connecting to the shared matlab-engine, the python service will do some MATLAB processing, then do a matlab_eng.quit() to disconnect from the shared matlab-engine. I have 4 questions that I hope somebody could answer. See below.
Regards Debbie
Is matlab_eng.quit() the correct way to disconnect from the shared matlab-engine?
Can you confirm that each of the 3 python systemd services will have it’s own MATLAB workspace?
After our python services have run awhile, we start seeing trouble connecting to the shared matlab-engine. The stack trace looks similar to as shown below. Why would these connection errors only occationally occur and how can we fix this? We have assumed that each of our python processes can use the shared matlab-engine concurrently, is this not correct?
As a follow-up to question 3, why is _future.result showing up in the trace? We started a synchronous matlab-engine, the documentation mentions future results only with respect to asynchronous matlab-engines.
<class ‘matlab.engine.EngineError’>
Unable to connect to MATLAB session ‘OUR_SESSION_NAME_HERE’.
matlab_eng = matlab.engine.connect_matlab(‘OUR_SESSION_NAME_HERE’)
!! File "/usr/lib/python2.7/site-packages/matlab/engine/__init__.py", line 182, in connect_matlab
eng = future.result()
!! File "/usr/lib/python2.7/site-packages/matlab/engine/futureresult.py", line 67, in result
return self.__future.result(timeout)
!! File "/usr/lib/python2.7/site-packages/matlab/engine/matlabfuture.py", line 87, in result
handle = pythonengine.getMATLAB(self._future) matlab-engine python MATLAB Answers — New Questions
Adding MAVLINK messages for an external groundstation to use in telemetry (RFD-900)
Is there a way to easily add values saved in a simulink code to the message list that external ground station programs can receive and use as telemetry.
I currently have a set of saved data points through a custom uORB message that are calculated in the simulink flight controller but I would like the freedom to also have these values be telemetered to programs like mission planner or Qground control. Ive explored some options about creating new mavlink messages but this process is incredibly cumbersome and way out my depth to successfully implement since it involves invidiaully editing more than 5 different files in the base firmware file structure. Is there a reliable way using simulink blocks to create these new messages to be included
The current setup is using a Pixhawk 6x with an RFD 900 for telemetry.Is there a way to easily add values saved in a simulink code to the message list that external ground station programs can receive and use as telemetry.
I currently have a set of saved data points through a custom uORB message that are calculated in the simulink flight controller but I would like the freedom to also have these values be telemetered to programs like mission planner or Qground control. Ive explored some options about creating new mavlink messages but this process is incredibly cumbersome and way out my depth to successfully implement since it involves invidiaully editing more than 5 different files in the base firmware file structure. Is there a reliable way using simulink blocks to create these new messages to be included
The current setup is using a Pixhawk 6x with an RFD 900 for telemetry. Is there a way to easily add values saved in a simulink code to the message list that external ground station programs can receive and use as telemetry.
I currently have a set of saved data points through a custom uORB message that are calculated in the simulink flight controller but I would like the freedom to also have these values be telemetered to programs like mission planner or Qground control. Ive explored some options about creating new mavlink messages but this process is incredibly cumbersome and way out my depth to successfully implement since it involves invidiaully editing more than 5 different files in the base firmware file structure. Is there a reliable way using simulink blocks to create these new messages to be included
The current setup is using a Pixhawk 6x with an RFD 900 for telemetry. mavlink, telemetry, rfd900, uorb, messages MATLAB Answers — New Questions
Question about making simulink block for opencv_contrib
Hello Everyone,
I have a problem that I need to use opencv_contrib for aruco marker detection in simulink, but opencv importer doesn’t seem to be able to make a simulink block for opencv_contrib.
I would like to know if there are any successful imports using opencv importer for opencv_contrib, and if not are there any other ways to use opencv_contrib in simulink. Although I can use opencv functions in matlab using the mex interface.Hello Everyone,
I have a problem that I need to use opencv_contrib for aruco marker detection in simulink, but opencv importer doesn’t seem to be able to make a simulink block for opencv_contrib.
I would like to know if there are any successful imports using opencv importer for opencv_contrib, and if not are there any other ways to use opencv_contrib in simulink. Although I can use opencv functions in matlab using the mex interface. Hello Everyone,
I have a problem that I need to use opencv_contrib for aruco marker detection in simulink, but opencv importer doesn’t seem to be able to make a simulink block for opencv_contrib.
I would like to know if there are any successful imports using opencv importer for opencv_contrib, and if not are there any other ways to use opencv_contrib in simulink. Although I can use opencv functions in matlab using the mex interface. opencv, aruco, simulink MATLAB Answers — New Questions
Excel importing text file link
Importing a text file into excel. I need the excel file to be linked to the original text file. But it is not linking. help please.
Importing a text file into excel. I need the excel file to be linked to the original text file. But it is not linking. help please. Read More
Windows 11: An Assessment
I’ve experienced a year of frustration with this software, and unfortunately, the issues have not improved. There have been numerous complaints that I could mention, but one major problem occurred when it unexpectedly reset itself, causing me to lose all my apps. I’ve decided to hold off until Windows 12 is released. In the meantime, I’ll be reverting back to Windows 10.
I’ve experienced a year of frustration with this software, and unfortunately, the issues have not improved. There have been numerous complaints that I could mention, but one major problem occurred when it unexpectedly reset itself, causing me to lose all my apps. I’ve decided to hold off until Windows 12 is released. In the meantime, I’ll be reverting back to Windows 10. Read More
Can the Recycle Bin be Placed on the Taskbar?
Is it possible for me to relocate the Recycle Bin from my desktop to my Taskbar? If so, how can I do it?
Is it possible for me to relocate the Recycle Bin from my desktop to my Taskbar? If so, how can I do it? Read More
“Is it safe to deactivate processor performance boost mode?”
After noticing that my laptop was running at dangerously high temperatures, I took steps to address the issue by undervolting my CPU by about 60. In my search for additional solutions, I came across a helpful video that provided some effective strategies. However, I am now concerned about the safety of disabling certain features, particularly regarding performance trade-offs. I am prepared to experiment with settings, but I want to ensure that I am not risking any significant damage.
One specific concern I have is whether disabling the overclock protection in my BIOS will have any negative repercussions on the changes I have made. Any insights or advice on these matters would be greatly appreciated. Thank you in advance for your help. ❤️
After noticing that my laptop was running at dangerously high temperatures, I took steps to address the issue by undervolting my CPU by about 60. In my search for additional solutions, I came across a helpful video that provided some effective strategies. However, I am now concerned about the safety of disabling certain features, particularly regarding performance trade-offs. I am prepared to experiment with settings, but I want to ensure that I am not risking any significant damage. One specific concern I have is whether disabling the overclock protection in my BIOS will have any negative repercussions on the changes I have made. Any insights or advice on these matters would be greatly appreciated. Thank you in advance for your help. ❤️ Read More
How Much Splitting Power is Excessive?
Currently, I am using a Great Wall E750 750W 80Plus Gold ATX 12V power supply in my system. I have only one SATA power cable available, which has three SATA connectors attached.
The first connector is connected to my fan control board located on the back of my motherboard. As for the other two connectors, I am using splitters to power my hard drives. To be more specific, I have connected two drives to one of the SATA connectors using splitter #1, and the other two drives are powered by the other SATA connector via splitter #2. Therefore, a total of five components are drawing power from this single SATA power cable. I want to confirm that I am not placing too much stress on this particular cable with my multiple devices.
However, there is a dilemma…
I misplaced all the cables during a previous relocation and cannot find them. I am hesitant to purchase a third-party cable that may not be compatible, as there are cautionary tales about using such cables. Although I have not encountered any issues so far, I am cautious about potentially causing unnecessary strain on my equipment.
Do you have any insights or suggestions for this situation?
Currently, I am using a Great Wall E750 750W 80Plus Gold ATX 12V power supply in my system. I have only one SATA power cable available, which has three SATA connectors attached. The first connector is connected to my fan control board located on the back of my motherboard. As for the other two connectors, I am using splitters to power my hard drives. To be more specific, I have connected two drives to one of the SATA connectors using splitter #1, and the other two drives are powered by the other SATA connector via splitter #2. Therefore, a total of five components are drawing power from this single SATA power cable. I want to confirm that I am not placing too much stress on this particular cable with my multiple devices. However, there is a dilemma… I misplaced all the cables during a previous relocation and cannot find them. I am hesitant to purchase a third-party cable that may not be compatible, as there are cautionary tales about using such cables. Although I have not encountered any issues so far, I am cautious about potentially causing unnecessary strain on my equipment. Do you have any insights or suggestions for this situation? Read More
Notification of Expiring Password
I received my first notification about the password expiration two days ago, stating that it would expire in two days. Today’s notification indicates that it expires today, so I must have received one yesterday as well. Strangely, I don’t actually have a password to log in. This notification does not appear in the expandable panel but is visible in the system notifications under “Window Logon Reminder.” I am considering turning it off, but I am puzzled as to why I am receiving this notification when I don’t have a password.
I received my first notification about the password expiration two days ago, stating that it would expire in two days. Today’s notification indicates that it expires today, so I must have received one yesterday as well. Strangely, I don’t actually have a password to log in. This notification does not appear in the expandable panel but is visible in the system notifications under “Window Logon Reminder.” I am considering turning it off, but I am puzzled as to why I am receiving this notification when I don’t have a password. Read More
How to Create a Shortcut to Launch a Program with Specific Affinity Settings for All 32 Cores
I have come across numerous instructions on how to accomplish this task, but unfortunately, none have proven to be effective.
My current objective is to initiate a game and configure it to utilize all available cores. This action is necessary because the game, specifically Assassin’s Creed Odyssey, encounters crashes when running on newer CPUs. However, I have noticed that manually setting the game to utilize all cores post-launch results in the cessation of these crashes.
As of now, I have managed to launch the game using a shortcut that contains the following code snippet in the target box:
“`cmd.exe /c start “” /Normal /affinity FFFFFFFF “G:GamesAssassin’s Creed – OdysseyACOdyssey.exe”“`
Previously, the game ran flawlessly on our old i7-4790K without any issues. The transition to my current setup, featuring an i9-14900K with 32 cores (CPU0 to CPU31), prompted me to input a series of thirty-two ‘1’s into a binary-to-hex converter, resulting in the hexadecimal value FFFFFFFF.
Despite successful experiments with adjusting the priority within the shortcut, I have encountered difficulties in modifying the processor affinity settings.
I have come across numerous instructions on how to accomplish this task, but unfortunately, none have proven to be effective. My current objective is to initiate a game and configure it to utilize all available cores. This action is necessary because the game, specifically Assassin’s Creed Odyssey, encounters crashes when running on newer CPUs. However, I have noticed that manually setting the game to utilize all cores post-launch results in the cessation of these crashes. As of now, I have managed to launch the game using a shortcut that contains the following code snippet in the target box: “`cmd.exe /c start “” /Normal /affinity FFFFFFFF “G:GamesAssassin’s Creed – OdysseyACOdyssey.exe”“` Previously, the game ran flawlessly on our old i7-4790K without any issues. The transition to my current setup, featuring an i9-14900K with 32 cores (CPU0 to CPU31), prompted me to input a series of thirty-two ‘1’s into a binary-to-hex converter, resulting in the hexadecimal value FFFFFFFF. Despite successful experiments with adjusting the priority within the shortcut, I have encountered difficulties in modifying the processor affinity settings. Read More
Add rows to a table Macro
I have macro that needs counts the rows of the filtered table and I have successfully counted the number of rows. I need help with the command or code to insert the rows into a table and I am having an issue because the worksheet has several tables above and below the table I need to add or delete the rows on.
Below is the code and I get an error stating (Subscript out of range)
TaskTable.ListRows.Add.Range.Value = ActionQuery.ListRows(Number_of_Rows).Range.Value
I have macro that needs counts the rows of the filtered table and I have successfully counted the number of rows. I need help with the command or code to insert the rows into a table and I am having an issue because the worksheet has several tables above and below the table I need to add or delete the rows on. Below is the code and I get an error stating (Subscript out of range)TaskTable.ListRows.Add.Range.Value = ActionQuery.ListRows(Number_of_Rows).Range.Value Read More
Triangle clustering of .stl file
Hello everyone,
I am asking help to the MATLAB community since my head is burning 🙁
So I have stored two matrices F(mx3) and N(ux3), where u is 3 times m. The first matrix F contains the triangles of an .stl file, namely it containes, in each row, the indices of the rows of matrix N where the X, Y, and Z coordinate are stored. So, for example, if F(1,:) = [1 2 3], it means that the coordinates of the vertices of the first triangle have to be found in rows 1,2, and 3 of matrix N.
Plotting the triangles we have this situation:
Now what i want to do is divide the triangles in different regions (in this case 3, but the number of regions should not be a user input).
I have been able to identify the triangles wich lies on the border writing a small algorithm that search, for each triangle, what are the adjacent triangles (looking for the common edges). All the triangles that only have 1 or 2 adjacent triangles are stored as "Border Triangles".
Here, unfortunately, is where i stop. I have thought to use some graph traversal methods to identify the regions but i am not familiar with this type of techniques.
Any suggestions?
I am not attaching any dataset since it will be to heavy and probably to much confusing.
Hoping to find an answer here 🙂
ThanksHello everyone,
I am asking help to the MATLAB community since my head is burning 🙁
So I have stored two matrices F(mx3) and N(ux3), where u is 3 times m. The first matrix F contains the triangles of an .stl file, namely it containes, in each row, the indices of the rows of matrix N where the X, Y, and Z coordinate are stored. So, for example, if F(1,:) = [1 2 3], it means that the coordinates of the vertices of the first triangle have to be found in rows 1,2, and 3 of matrix N.
Plotting the triangles we have this situation:
Now what i want to do is divide the triangles in different regions (in this case 3, but the number of regions should not be a user input).
I have been able to identify the triangles wich lies on the border writing a small algorithm that search, for each triangle, what are the adjacent triangles (looking for the common edges). All the triangles that only have 1 or 2 adjacent triangles are stored as "Border Triangles".
Here, unfortunately, is where i stop. I have thought to use some graph traversal methods to identify the regions but i am not familiar with this type of techniques.
Any suggestions?
I am not attaching any dataset since it will be to heavy and probably to much confusing.
Hoping to find an answer here 🙂
Thanks Hello everyone,
I am asking help to the MATLAB community since my head is burning 🙁
So I have stored two matrices F(mx3) and N(ux3), where u is 3 times m. The first matrix F contains the triangles of an .stl file, namely it containes, in each row, the indices of the rows of matrix N where the X, Y, and Z coordinate are stored. So, for example, if F(1,:) = [1 2 3], it means that the coordinates of the vertices of the first triangle have to be found in rows 1,2, and 3 of matrix N.
Plotting the triangles we have this situation:
Now what i want to do is divide the triangles in different regions (in this case 3, but the number of regions should not be a user input).
I have been able to identify the triangles wich lies on the border writing a small algorithm that search, for each triangle, what are the adjacent triangles (looking for the common edges). All the triangles that only have 1 or 2 adjacent triangles are stored as "Border Triangles".
Here, unfortunately, is where i stop. I have thought to use some graph traversal methods to identify the regions but i am not familiar with this type of techniques.
Any suggestions?
I am not attaching any dataset since it will be to heavy and probably to much confusing.
Hoping to find an answer here 🙂
Thanks triangles, clustering, stl, region identification, graph traversal, cluster MATLAB Answers — New Questions
how to create channel attention layer in matlab.
classdef ChannelAttentionLayer < nnet.layer.Layer
properties
% Reduction ratio used in the channel attention mechanism
ReductionRatio
end
properties (Learnable)
% Layer learnable parameters
Weights1
Bias1
Weights2
Bias2
end
methods
function layer = ChannelAttentionLayer(reduction_ratio, input_channels, name)
% Constructor for ChannelAttentionLayer
layer.Name = name;
layer.ReductionRatio = reduction_ratio;
% Calculate reduced channels based on reduction ratio
reduced_channels = max(1, round(input_channels / reduction_ratio));
% Initialize weights and biases
layer.Weights1 = randn([1, 1, input_channels, reduced_channels], ‘single’);
layer.Bias1 = zeros([1, 1, reduced_channels], ‘single’);
layer.Weights2 = randn([1, 1, reduced_channels, input_channels], ‘single’);
layer.Bias2 = zeros([1, 1, input_channels], ‘single’);
end
function Z = forward(layer, X)
% Forward pass for training mode
% Ensure X is a dlarray
X = dlarray(X);
% Get input size
[H, W, C] = size(X);
% Global Average Pooling (GAP)
avg_pool = mean(X, [1, 2]); % Mean over height and width
avg_pool = reshape(avg_pool, [1, 1, C]); % Reshape to [1, 1, Channels]
% Global Max Pooling (GMP)
max_pool = max(X, [], [1, 2]); % Max over height and width
max_pool = reshape(max_pool, [1, 1, C]); % Reshape to [1, 1, Channels]
% First fully connected layer applied to both avg and max pooled outputs
avg_out = fullyconnect(avg_pool, layer.Weights1, layer.Bias1, C, layer.ReductionRatio);
max_out = fullyconnect(max_pool, layer.Weights1, layer.Bias1, C, layer.ReductionRatio);
% Apply ReLU
avg_out = relu(avg_out);
max_out = relu(max_out);
% Second fully connected layer
avg_out = fullyconnect(avg_out, layer.Weights2, layer.Bias2, layer.ReductionRatio, C);
max_out = fullyconnect(max_out, layer.Weights2, layer.Bias2, layer.ReductionRatio, C);
% Combine average and max pooled outputs
Z = avg_out + max_out;
% Apply sigmoid to get attention weights
Z = sigmoid(Z);
% Reshape attention map and multiply with input
Z = reshape(Z, [1, 1, C]);
Z = X .* Z;
% Ensure Z is unformatted
Z = dlarray(Z);
end
function Z = predict(layer, X)
% Predict pass for inference mode
Z = forward(layer, X);
end
end
end
% Fully connected operation for 1×1 conv
function out = fullyconnect(input, weights, bias, input_channels, output_channels)
% Ensure the number of input channels matches the weights’ channels
[H, W, C_in] = size(input);
[~, ~, C, ~] = size(weights);
if C_in ~= C
error(‘Number of channels in input and weights do not match.’);
end
% Flatten input dimensions
input_reshaped = reshape(input, [], C_in); % Flatten spatial dimensions
% Perform matrix multiplication and add bias
weights_reshaped = reshape(weights, [C_in, output_channels]);
out = input_reshaped * weights_reshaped + reshape(bias, [1, output_channels]);
% Reshape back to original dimensions
out = reshape(out, [1, 1, output_channels]);
endclassdef ChannelAttentionLayer < nnet.layer.Layer
properties
% Reduction ratio used in the channel attention mechanism
ReductionRatio
end
properties (Learnable)
% Layer learnable parameters
Weights1
Bias1
Weights2
Bias2
end
methods
function layer = ChannelAttentionLayer(reduction_ratio, input_channels, name)
% Constructor for ChannelAttentionLayer
layer.Name = name;
layer.ReductionRatio = reduction_ratio;
% Calculate reduced channels based on reduction ratio
reduced_channels = max(1, round(input_channels / reduction_ratio));
% Initialize weights and biases
layer.Weights1 = randn([1, 1, input_channels, reduced_channels], ‘single’);
layer.Bias1 = zeros([1, 1, reduced_channels], ‘single’);
layer.Weights2 = randn([1, 1, reduced_channels, input_channels], ‘single’);
layer.Bias2 = zeros([1, 1, input_channels], ‘single’);
end
function Z = forward(layer, X)
% Forward pass for training mode
% Ensure X is a dlarray
X = dlarray(X);
% Get input size
[H, W, C] = size(X);
% Global Average Pooling (GAP)
avg_pool = mean(X, [1, 2]); % Mean over height and width
avg_pool = reshape(avg_pool, [1, 1, C]); % Reshape to [1, 1, Channels]
% Global Max Pooling (GMP)
max_pool = max(X, [], [1, 2]); % Max over height and width
max_pool = reshape(max_pool, [1, 1, C]); % Reshape to [1, 1, Channels]
% First fully connected layer applied to both avg and max pooled outputs
avg_out = fullyconnect(avg_pool, layer.Weights1, layer.Bias1, C, layer.ReductionRatio);
max_out = fullyconnect(max_pool, layer.Weights1, layer.Bias1, C, layer.ReductionRatio);
% Apply ReLU
avg_out = relu(avg_out);
max_out = relu(max_out);
% Second fully connected layer
avg_out = fullyconnect(avg_out, layer.Weights2, layer.Bias2, layer.ReductionRatio, C);
max_out = fullyconnect(max_out, layer.Weights2, layer.Bias2, layer.ReductionRatio, C);
% Combine average and max pooled outputs
Z = avg_out + max_out;
% Apply sigmoid to get attention weights
Z = sigmoid(Z);
% Reshape attention map and multiply with input
Z = reshape(Z, [1, 1, C]);
Z = X .* Z;
% Ensure Z is unformatted
Z = dlarray(Z);
end
function Z = predict(layer, X)
% Predict pass for inference mode
Z = forward(layer, X);
end
end
end
% Fully connected operation for 1×1 conv
function out = fullyconnect(input, weights, bias, input_channels, output_channels)
% Ensure the number of input channels matches the weights’ channels
[H, W, C_in] = size(input);
[~, ~, C, ~] = size(weights);
if C_in ~= C
error(‘Number of channels in input and weights do not match.’);
end
% Flatten input dimensions
input_reshaped = reshape(input, [], C_in); % Flatten spatial dimensions
% Perform matrix multiplication and add bias
weights_reshaped = reshape(weights, [C_in, output_channels]);
out = input_reshaped * weights_reshaped + reshape(bias, [1, output_channels]);
% Reshape back to original dimensions
out = reshape(out, [1, 1, output_channels]);
end classdef ChannelAttentionLayer < nnet.layer.Layer
properties
% Reduction ratio used in the channel attention mechanism
ReductionRatio
end
properties (Learnable)
% Layer learnable parameters
Weights1
Bias1
Weights2
Bias2
end
methods
function layer = ChannelAttentionLayer(reduction_ratio, input_channels, name)
% Constructor for ChannelAttentionLayer
layer.Name = name;
layer.ReductionRatio = reduction_ratio;
% Calculate reduced channels based on reduction ratio
reduced_channels = max(1, round(input_channels / reduction_ratio));
% Initialize weights and biases
layer.Weights1 = randn([1, 1, input_channels, reduced_channels], ‘single’);
layer.Bias1 = zeros([1, 1, reduced_channels], ‘single’);
layer.Weights2 = randn([1, 1, reduced_channels, input_channels], ‘single’);
layer.Bias2 = zeros([1, 1, input_channels], ‘single’);
end
function Z = forward(layer, X)
% Forward pass for training mode
% Ensure X is a dlarray
X = dlarray(X);
% Get input size
[H, W, C] = size(X);
% Global Average Pooling (GAP)
avg_pool = mean(X, [1, 2]); % Mean over height and width
avg_pool = reshape(avg_pool, [1, 1, C]); % Reshape to [1, 1, Channels]
% Global Max Pooling (GMP)
max_pool = max(X, [], [1, 2]); % Max over height and width
max_pool = reshape(max_pool, [1, 1, C]); % Reshape to [1, 1, Channels]
% First fully connected layer applied to both avg and max pooled outputs
avg_out = fullyconnect(avg_pool, layer.Weights1, layer.Bias1, C, layer.ReductionRatio);
max_out = fullyconnect(max_pool, layer.Weights1, layer.Bias1, C, layer.ReductionRatio);
% Apply ReLU
avg_out = relu(avg_out);
max_out = relu(max_out);
% Second fully connected layer
avg_out = fullyconnect(avg_out, layer.Weights2, layer.Bias2, layer.ReductionRatio, C);
max_out = fullyconnect(max_out, layer.Weights2, layer.Bias2, layer.ReductionRatio, C);
% Combine average and max pooled outputs
Z = avg_out + max_out;
% Apply sigmoid to get attention weights
Z = sigmoid(Z);
% Reshape attention map and multiply with input
Z = reshape(Z, [1, 1, C]);
Z = X .* Z;
% Ensure Z is unformatted
Z = dlarray(Z);
end
function Z = predict(layer, X)
% Predict pass for inference mode
Z = forward(layer, X);
end
end
end
% Fully connected operation for 1×1 conv
function out = fullyconnect(input, weights, bias, input_channels, output_channels)
% Ensure the number of input channels matches the weights’ channels
[H, W, C_in] = size(input);
[~, ~, C, ~] = size(weights);
if C_in ~= C
error(‘Number of channels in input and weights do not match.’);
end
% Flatten input dimensions
input_reshaped = reshape(input, [], C_in); % Flatten spatial dimensions
% Perform matrix multiplication and add bias
weights_reshaped = reshape(weights, [C_in, output_channels]);
out = input_reshaped * weights_reshaped + reshape(bias, [1, output_channels]);
% Reshape back to original dimensions
out = reshape(out, [1, 1, output_channels]);
end matlab MATLAB Answers — New Questions
Outlook: Adding Gmail Acct. Error: “We couldn’t log on to the incoming (POP/IMAP) server…
Running Office 365 Outlook on a Lenovo laptop and Windows 11.
Hey All,
I have successfully installed multiple Gmail accounts to Outlook on two different personal computers [Computer#1 (C#1) and Computer#2 (C#2)]. I am trying to install Gmail account #3 (GM#3) on my new computer (C#2) but failing. It is already installed on C#1. As a test, I just uninstalled and reinstalled on C#1 without a problem. Both computers are Lenovo laptops. I have tried the advanced options “set up my account manually”, including both Gmail the and IMAP options with the same result:
I get the Error Message: “We couldn’t log on to the incoming (POP/IMAP) server. Please check your email address and password to try again.”
Running Office 365 Outlook on a Lenovo laptop and Windows 11. Hey All, I have successfully installed multiple Gmail accounts to Outlook on two different personal computers [Computer#1 (C#1) and Computer#2 (C#2)]. I am trying to install Gmail account #3 (GM#3) on my new computer (C#2) but failing. It is already installed on C#1. As a test, I just uninstalled and reinstalled on C#1 without a problem. Both computers are Lenovo laptops. I have tried the advanced options “set up my account manually”, including both Gmail the and IMAP options with the same result: I get the Error Message: “We couldn’t log on to the incoming (POP/IMAP) server. Please check your email address and password to try again.”The troubleshooter says “Outlook desktop (MAPI) is disabled for this user’s mailbox.” (My little bit of research into gmail indicates that MAPI does not support MAPI.) Where I think the trouble started: In the process of installing GML#3 on C#2, I flubbed up. I had a Chrome window open under a GM#2 account and during the installation I opened a Chrome window logged into GM#3. I think (but am not positive) the Chrome’s Outlook verification procedure seemed to start in the GM#2 Chrome window and finish in the GM#3 chrome window, but it was not successful in Outlook. Most solutions I have found involve deleting the account from Outlook and starting over. However, the GM#3 account has not been installed in outlook so there is no account to delete. Each time I go to install GM#3, it searches for accounts and provides GM#3 as an email address for me to select. Either automatically or manually, it does not prompt me for a password and there is nowhere I can find to confirm the password is properly entered or change it. Because Outlook seems to be holding on to information about the account and password, I conclude it has some information on GM#3 in cache or somewhere in the system. I did a complete delete of all the local Outlook cache (the process I followed indicated this would not delete information that has already been moved to the server–appended to the end of this message). On C#2, I have also deleted all the email accounts and the Outlook profile and reinstalled them but it still seems to hold onto the GM#3 email address and I assume the password (since it never prompts me for the password). As near as I can tell the settings for the GM#3 account on the corresponding Google Chrome account are the same on C#1 and C#2 — but I have not checked every single one of them (checked “Labels” and “Forwarding and POP/IMAP” settings) Grateful for any solutions/clues/thoughts! Jim INSTRUCTIONS I FOLLOWED TO CLEAR THE LOCAL CACHE Exit Outlook and Skype for Business.From the Start menu, choose Run.In the Run window, type this path in the Open box “%LOCALAPPDATA%MicrosoftOutlook”Click OKFind the .ost file and rename or delete it (you may need to Show Hidden Files and Show Extensions to see the file)Remove the following files: any .xml files, any .nst filesOpen the RoamCache folder and delete all itemsOpen the HubAppFileCache folder and delete all itemsOpen the Offline Address Books folder and delete all itemsOpen the 16 folder and delete all itemsRestart Outlook Read More