Month: June 2024
How to connect the Raspberry pi GPIO blocks to simulink model to perform real time simulation ?
Raspberry piRaspberry pi Raspberry pi gpio blocks MATLAB Answers — New Questions
I’m getting an error in port width and dimensions.
<</matlabcentral/answers/uploaded_files/1710701/PXL_20240607_114519832.MV.jpg>><</matlabcentral/answers/uploaded_files/1710701/PXL_20240607_114519832.MV.jpg>> <</matlabcentral/answers/uploaded_files/1710701/PXL_20240607_114519832.MV.jpg>> error in port width and dimensions or orientation. MATLAB Answers — New Questions
MQTT connection error on 2021b – Unable to resolve the name com.mathworks.mqttclient.client.Client.
I’m facing this error while trying to create an mqtt connection:
>> myMQTT=mqtt(‘tcp://broker.hivemq.com’)
‘com.mathworks’ package and subpackages will be removed in a future release. There is no simple replacement for this.
Caused by:
Unable to resolve the name com.mathworks.mqttclient.client.Client.
I just downloaded the mqtt package from file -exchange (mqtt-download).
I’m using matlab 2021b:
—————————————————————————————————–
MATLAB Version: 9.11.0.2358333 (R2021b) Update 7
MATLAB License Number:
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
—————————————————————————————————–
MATLAB Version 9.11 (R2021b)
Database Toolbox Version 10.2 (R2021b)
Deep Learning Toolbox Version 14.3 (R2021b)
Image Acquisition Toolbox Version 6.5 (R2021b)
Image Processing Toolbox Version 11.4 (R2021b)
MATLAB Compiler Version 8.3 (R2021b)
MATLAB Compiler SDK Version 6.11 (R2021b)
MATLAB Report Generator Version 5.11 (R2021b)
Spreadsheet Link Version 3.4.6 (R2021b)
Statistics and Machine Learning Toolbox Version 12.2 (R2021b)I’m facing this error while trying to create an mqtt connection:
>> myMQTT=mqtt(‘tcp://broker.hivemq.com’)
‘com.mathworks’ package and subpackages will be removed in a future release. There is no simple replacement for this.
Caused by:
Unable to resolve the name com.mathworks.mqttclient.client.Client.
I just downloaded the mqtt package from file -exchange (mqtt-download).
I’m using matlab 2021b:
—————————————————————————————————–
MATLAB Version: 9.11.0.2358333 (R2021b) Update 7
MATLAB License Number:
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
—————————————————————————————————–
MATLAB Version 9.11 (R2021b)
Database Toolbox Version 10.2 (R2021b)
Deep Learning Toolbox Version 14.3 (R2021b)
Image Acquisition Toolbox Version 6.5 (R2021b)
Image Processing Toolbox Version 11.4 (R2021b)
MATLAB Compiler Version 8.3 (R2021b)
MATLAB Compiler SDK Version 6.11 (R2021b)
MATLAB Report Generator Version 5.11 (R2021b)
Spreadsheet Link Version 3.4.6 (R2021b)
Statistics and Machine Learning Toolbox Version 12.2 (R2021b) I’m facing this error while trying to create an mqtt connection:
>> myMQTT=mqtt(‘tcp://broker.hivemq.com’)
‘com.mathworks’ package and subpackages will be removed in a future release. There is no simple replacement for this.
Caused by:
Unable to resolve the name com.mathworks.mqttclient.client.Client.
I just downloaded the mqtt package from file -exchange (mqtt-download).
I’m using matlab 2021b:
—————————————————————————————————–
MATLAB Version: 9.11.0.2358333 (R2021b) Update 7
MATLAB License Number:
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
—————————————————————————————————–
MATLAB Version 9.11 (R2021b)
Database Toolbox Version 10.2 (R2021b)
Deep Learning Toolbox Version 14.3 (R2021b)
Image Acquisition Toolbox Version 6.5 (R2021b)
Image Processing Toolbox Version 11.4 (R2021b)
MATLAB Compiler Version 8.3 (R2021b)
MATLAB Compiler SDK Version 6.11 (R2021b)
MATLAB Report Generator Version 5.11 (R2021b)
Spreadsheet Link Version 3.4.6 (R2021b)
Statistics and Machine Learning Toolbox Version 12.2 (R2021b) mqtt, 2021b MATLAB Answers — New Questions
How can I custom toolbar/taskbar on Win 11?
I’m trying to restore a custom toolbar on my Windows 11 taskbar that directly links to a folder, as I find it very convenient for accessing frequently used programs. Previously, I could place these on the right side of the taskbar, but now I can only adjust the position of the main taskbar to the left or middle.
I’ve looked through numerous YouTube tutorials but haven’t found a solution yet.
If there’s no built-in way to do this in Windows 11, could someone recommend a widget or third-party program that might help? Thanks in advance!
I’m trying to restore a custom toolbar on my Windows 11 taskbar that directly links to a folder, as I find it very convenient for accessing frequently used programs. Previously, I could place these on the right side of the taskbar, but now I can only adjust the position of the main taskbar to the left or middle.I’ve looked through numerous YouTube tutorials but haven’t found a solution yet. If there’s no built-in way to do this in Windows 11, could someone recommend a widget or third-party program that might help? Thanks in advance! Read More
Windows 11 drains battery when laptop is shutdown – Fast Startup is disabled
Hello everyone! I’m using an MSI GL65 9SD laptop, and I’ve noticed an issue where it loses about 5% of battery every day, even when it’s turned off. I’ve already disabled fast startup, but the problem persists.
I came across a similar problem in another thread where the original poster suggested it might be related to the BIOS settings. I’ve gone ahead and disabled the C state for the CPU in the BIOS, but I’m still facing the same issue.
Could anyone suggest what else I should check in the BIOS to ensure that my laptop is fully shutting down and not just entering some sort of sleep or standby mode? Any advice would be greatly appreciated!
Hello everyone! I’m using an MSI GL65 9SD laptop, and I’ve noticed an issue where it loses about 5% of battery every day, even when it’s turned off. I’ve already disabled fast startup, but the problem persists. I came across a similar problem in another thread where the original poster suggested it might be related to the BIOS settings. I’ve gone ahead and disabled the C state for the CPU in the BIOS, but I’m still facing the same issue. Could anyone suggest what else I should check in the BIOS to ensure that my laptop is fully shutting down and not just entering some sort of sleep or standby mode? Any advice would be greatly appreciated! Read More
Lists: remove ability to export to Excel and other top buttons
So from my sharepoint list I need almost all buttons removed from the top part. I know the quick edit in advanced settings remove the “Cuadricula” option. But specially, I need to remove the ability to remove the Export to Excel button.
Is it possible?
So from my sharepoint list I need almost all buttons removed from the top part. I know the quick edit in advanced settings remove the “Cuadricula” option. But specially, I need to remove the ability to remove the Export to Excel button. Is it possible? Read More
Defender for Endpoint API vs Website
I use the Defender for Endpoint API to tag some devices. This generally works fine.
Now I have the following situation for some days now:
On the Website I have a specific dns name (device name) which appears two times on the website, but I only get it one time via the API.
What I did with the API:
Try to get the device with the guid provided in the web. One guid returns the object, the other returns 404-Not found
Read all Machines and try to find the dns / the guid – did not find the missing device.
As far as I know, you cannot restrict the permissions for the devices in API queries.
Any ideas?
I use the Defender for Endpoint API to tag some devices. This generally works fine.
Now I have the following situation for some days now:
On the Website I have a specific dns name (device name) which appears two times on the website, but I only get it one time via the API.
What I did with the API:
Try to get the device with the guid provided in the web. One guid returns the object, the other returns 404-Not found
Read all Machines and try to find the dns / the guid – did not find the missing device.
As far as I know, you cannot restrict the permissions for the devices in API queries.
Any ideas? Read More
Prompts collection
Basic prompts are visible in Copilot Lab and can also be used in apps.
Copilot in Windows and in Edge uses the same history. You can change the names of the prompts or delete prompts. You can also export or share them.
The history becomes quite confusing over time.
There are many interesting prompts here in the forum or on the WWW.
There are also many solutions for collecting and managing your own prompts (lists, loops, Excel etc.).
This raises the following questions for me:
Are adjustments to Copilot Lab planned in the direction that own prompts can be collected/managed?How do other users here in the forum do this or which tool do they use?
I would be very happy to receive answers and they would be appreciated.
Best regards
Andreas
Basic prompts are visible in Copilot Lab and can also be used in apps.Copilot in Windows and in Edge uses the same history. You can change the names of the prompts or delete prompts. You can also export or share them.The history becomes quite confusing over time.There are many interesting prompts here in the forum or on the WWW.There are also many solutions for collecting and managing your own prompts (lists, loops, Excel etc.). This raises the following questions for me:Are adjustments to Copilot Lab planned in the direction that own prompts can be collected/managed?How do other users here in the forum do this or which tool do they use?I would be very happy to receive answers and they would be appreciated.Best regardsAndreas Read More
Transfer to this device: option missing on Android
Hi,
I recently enrolled my new Xiaomi 14 (with Android 14) in my company via Microsoft Intune. Teams is working normally, except the “Transfer to this device” option is missing.
When I am in a meeting on Windows, I can join the same meeting with my mobile device, but the option to transfer and disconnect the Windows session is missing, I have to leave the meeting on my Windows device manually.
This worked on my old Google Pixel 5. I used to have this screen to select the transfer option, and my Windows session would automatically disconnect:
It still works the other way round though. Transferring form Android to Windows works seamlessly.
Any ideas?
Hi,I recently enrolled my new Xiaomi 14 (with Android 14) in my company via Microsoft Intune. Teams is working normally, except the “Transfer to this device” option is missing.When I am in a meeting on Windows, I can join the same meeting with my mobile device, but the option to transfer and disconnect the Windows session is missing, I have to leave the meeting on my Windows device manually. This worked on my old Google Pixel 5. I used to have this screen to select the transfer option, and my Windows session would automatically disconnect:It still works the other way round though. Transferring form Android to Windows works seamlessly.Any ideas? Read More
Can I download Youtube videos from my channel on Windows 11 computer?
Hi tech experts,
I hired someone who manages my own YouTube channels. Now, he left the job and refused to send the record videos to me. How can I download youtube videos from my own channel so I can make a local copy and do some editing. I tried some online youtube video downloader but did not work at all and keep asking me installing unknown apps.
Anyone knows how to do this?
Thanks
Hi tech experts, I hired someone who manages my own YouTube channels. Now, he left the job and refused to send the record videos to me. How can I download youtube videos from my own channel so I can make a local copy and do some editing. I tried some online youtube video downloader but did not work at all and keep asking me installing unknown apps. Anyone knows how to do this? Thanks Read More
Introduction to Graph Databases: Azure Cosmos DB for Apache Gremlin
Previously we introduced Getting started with Azure Cosmos Database (A Deep Dive) blog which is an end-to-end introduction of Azure Cosmos DB. In this blog we are going to talk about one of the Azure Cosmos Database API known as Apache Gremlin.
Graph databases are a powerful way to model and query complex relationships in your data. Let’s dive into working with Azure Cosmos DB for Apache Gremlin, which provides a graph database service.
What’s covered in this blog
Need for a Graph database
Challenge: Mapping Relationships and Insights
What is Apache Gremlin?
Azure Cosmos DB for Apache Gremlin
Benefits for Gremlin API
Common scenarios for Gremlin API
Introduction to graph databases
provisioning Azure Cosmos DB for Apache Gremlin via Azure portal
Modeling a graph Database
When Do You Need a Graph Database?
Graph databases are optimally used when your data domain exhibits certain characteristics:
Entities are highly connected through descriptive relationships.
There are cyclic relationships or self-referenced entities (which can be challenging in relational or document databases).
Dynamically evolving relationships exist between entities (common in hierarchical or tree-structured data).
Many-to-many relationships between entities.
Both entities and relationships have read and write requirements.
If your data fits these criteria, a graph database approach can provide advantages in terms of query complexity, data model scalability, and query performance.
Introduction:
Scenario: Building a Social Network for Student Entrepreneurs
Your vision is to build a dynamic social network where aspiring entrepreneurs can connect, collaborate, and support each other’s ventures. As you embark on this journey, you encounter various challenges in structuring and querying your database to efficiently handle complex relationships and data connections.
The Challenge: Mapping Relationships and Insights
In the world of social networking platforms, understanding relationships between users, their interests, connections, and interactions is paramount. Traditional relational databases might fall short when it comes to representing these intricate networks. This is where Azure Cosmos DB for Apache Gremlin steps in as your trusted guide.
Apache Gremlin: Your Graph Database Companion
In your quest to build a thriving social network, you realize that a graph database is the perfect fit for capturing the interconnected nature of user relationships and interactions.
What is Apache Gremlin?
Apache Gremlin is a graph traversal language and virtual machine developed by Apache Software Foundation. It’s specifically designed for querying graph databases and navigating complex networks of interconnected data. Gremlin provides a flexible and powerful framework for traversing graphs, enabling users to perform a wide range of operations such as pathfinding, filtering, and graph analytics.
Azure Cosmos DB for Apache Gremlin
Azure Cosmos DB for Apache Gremlin is a graph database service that can be used to store massive graphs with billions of vertices and edges. You can query the graphs with millisecond latency and evolve the graph structure easily. This integration enables users to store and query graph data using Azure Cosmos DB’s globally distributed, available infrastructure.
The API for Gremlin combines the power of graph database algorithms with highly scalable, managed infrastructure. This approach provides a unique and flexible solution to common data problems associated with inflexible or relational constraints.
Benefits for Gremlin API
The API for Gremlin has added benefits of being built on Azure Cosmos DB:
Elastically Scalable Throughput and Storage: Cosmos DB supports horizontally scalable graph databases with unlimited storage and provisioned throughput. Data is automatically distributed using graph partitioning as the database scale grows.
Multi-region Replication: Graph data can be automatically replicated to any Azure region worldwide, enabling global access to data with minimal latency. Cosmos DB provides a service-managed regional failover mechanism to ensure application continuity in case of service interruptions.
Fast Queries and Traversals with Gremlin: Cosmos DB supports querying heterogeneous vertices and edges using the Gremlin query language, which is widely adopted in the graph database community. This allows for rich real-time queries and traversals without the need for schema hints, secondary indexes, or views.
Fully Managed Graph Database: Cosmos DB eliminates the need for managing database and machine resources, allowing developers to focus on delivering application value. It automatically handles tasks such as virtual machine management, software updates, sharding, replication, and backups, ensuring high availability and reliability.
Automatic Indexing: Gremlin API automatically indexes all properties within nodes and edges without requiring schema definition or creation of secondary indices.
Compatibility with Apache TinkerPop: The Gremlin API supports the open-source Apache TinkerPop standard, enabling integration with a vast ecosystem of applications and libraries.
Tunable Consistency Levels: Cosmos DB provides five well-defined consistency levels (strong, bounded-staleness, session, consistent prefix, and eventual) to balance consistency, availability, and latency based on application requirements. This flexibility allows developers to make informed tradeoffs to optimize performance.
Common scenarios for Gremlin API
Social networks/Customer 365: By combining data about your customers and their interactions with other people, you can develop personalized experiences, predict customer behavior, or connect people with others with similar interests. Azure Cosmos DB can be used to manage social networks and track customer preferences and data.
Recommendation engines: This scenario is commonly used in the retail industry. By combining information about products, users, and user interactions, like purchasing, browsing, or rating an item, you can build customized recommendations. The low latency, elastic scale, and native graph support of Azure Cosmos DB is ideal for these scenarios.
Geospatial: Many applications in telecommunications, logistics, and travel planning need to find a location of interest within an area or locate the shortest/optimal route between two locations. Azure Cosmos DB is a natural fit for these problems.
Internet of Things: With the network and connections between IoT devices modeled as a graph, you can build a better understanding of the state of your devices and assets. You also can learn how changes in one part of the network can potentially affect another part.
Introduction to graph databases
A graph database approach relies on persisting relationships in the storage layer instead, which leads to highly efficient graph retrieval operations. The API for Gremlin supports the property graph model.
Property graph objects
A property graph is a structure that’s composed of vertices and edges. Both objects can have an arbitrary number of key-value pairs as properties.
Vertices/nodes: Vertices denote discrete entities, such as a person, place, or an event.
ID: Each vertex has a unique ID enforced per partition. If no value is supplied upon insertion, an auto-generated GUID is stored.
Label: The vertex label defines the type of entity it represents. If no value is supplied, a default vertex label is used.
Properties: Vertices can have properties (stored as key-value pairs). These properties can be of type string, boolean, or numeric.
Partition Key: Vertices are partitioned, and the partition key determines their distribution across partitions.
Edges/relationships: Edges denote relationships between vertices. For example, a person might know another person, be involved in an event, or have recently been at a location.
Properties: Properties express information (or metadata) about the vertices and edges. There can be any number of properties in either vertices or edges, and they can be used to describe and filter the objects in a query. Example properties include a vertex that has name and age, or an edge, which can have a time stamp and/or a weight.
Example of a graph database
This graph has the following vertex types. These types are also called labels in Gremlin:
People: The graph has three people; Robin, Thomas, and Ben.
Interests: Their interests, in this example, include the game of Football.
Devices: The devices that people use.
Operating Systems: The operating systems that the devices run on.
Place: The place[s] where devices are accessed.
We represent the relationships between these entities via the following edge types:
Knows: Represent familiarity. For example, “Thomas knows Robin”.
Interested: Represent the interests of the people in our graph. For example, “Ben is interested in Football”.
RunsOS: Represent what OS a device runs. For example, “Laptop runs the Windows OS”.
Uses: Represent which device a person uses. For example, “Robin uses a Motorola phone with serial number 77”.
Located: Represent the location from which the devices are accessed.
Creating Azure Cosmos DB for Apache Gremlin in Azure portal
Prerequisites
Azure account – Click to create an account: Create Azure account
Azure subscription – More about subscriptions: more on subscriptions
Steps for Creating Resources in the Azure Portal
Let’s Create an Account
Search for Azure Cosmos DB
Create Azure Cosmos DB Account
Choose Azure Cosmos DB for Apache Gremlin
Under create Azure cosmos DB Account page
Choose your subscription.
Choose or create a resource group.
Create the account name (make it unique).
Choose the availability zone if you want to improve your apps availability and resilient.
Choose the location of your DB according to the available data centers.
Capacity Mode enables you to define the throughput. The Provisioned option also comes with a free tier option.
Select Geo-Redundancy will enable your database to be available to the paired region ie East US and West Us or South Africa North and South Africa West. For this demo ‘South Africa West’ is not included in my subscription
Multi-region writes capability allows you to take advantage of the provisioned throughput for your databases and containers across the globe.
Under networking, your Azure Cosmos DB account either publicly, via public IP addresses or service endpoints, or privately, using a private endpoint. Choose according to your use case.
Connection Security Settings – I will go with TLS 1.2
Backup policy defines the way your backup will occur.
I will let Microsoft encrypt my account using service-managed keys.
I don’t need to create a tag for now, so I will review and create.
Once I have successfully provisioned the resource.
Click Go To resource to the overview page of the resource.
Congratulations, you have Created an Azure Cosmos DB for Apache Gremlin.
Creating a container in Azure Cosmos DB for Gremlin
This part explains way to create a container in Azure Cosmos DB for Gremlin. It shows how to create a container using Azure portal with data explorer. It demonstrates how to create a container, specify the partition key, and provision throughput.
NOTE: When creating containers, make sure you don’t create two containers with the same name but different casing. That’s because some parts of the Azure platform are not case-sensitive, and this can result in confusion/collision of telemetry and actions on containers with such names.
Open the Data Explorer pane and select New Graph. Next, provide the following details:
Indicate whether you are creating a new database or using an existing one. Since this is a new DB account i will new database
Enter a Database ID.
Select database throughput whether auto scale or manual.
Enter a throughput to be provisioned (for example, 1000 RUs).
Enter a graph ID.
Select indexing (automatic or off).
Enter a partition key for vertices.
Select OK.
Congratulations, you have Created a container in Azure Cosmos DB for Apache Gremlin.
Let’s Create an Some Vertex and Edges
You begin by clicking New Vertex button
Start by giving a Label (For Example gamer tag).
Select a gameId ( i.e. 1111)
Add more property like Team and preferredClass
Team: red
preferredClass: Mage
Click OK.
Repeat step 1,2 &3 to add more labels with the data below twice
And now you have successfully added 3 vertices.
Let make some edges by connecting between the labels with a relationship
We can add a relationship between John and Ben that they know each other.
This is done by clicking John Id then click target to add Ben’s id and label as “know”
We can also add the relationship between John and jane that they know each other by repeating the step above again. The final relationship graph will look like this.
Congratulations, you have Created Vertex and Edges on Gremlin graph.
Read more:
Graph data modeling with Azure Cosmos DB for Apache Gremlin
Azure Cosmos DB for Gremlin graph support and compatibility with TinkerPop features
Visualize graph data stored in Azure Cosmos DB for Gremlin with data visualization solutions
Query Azure Cosmos DB for Gremlin by using Gremlin
Pricing model in Azure Cosmos DB
QuickStart SDK:
Azure Cosmos DB for Apache Gremlin library for Python
Azure Cosmos DB for Apache Gremlin library for Node.js
Azure Cosmos DB for Apache Gremlin library for .NET
Microsoft Tech Community – Latest Blogs –Read More
How to call a function with arguments containing “.” in “run” function?
Lets say I am trying to call a function called printVersion() using run.
Here is printVersion()
function printVersion(version)
disp(version)
end
Now, if version number doesn’t contain decimal, it works fine.
But, If version number has decimal, it trys to find the whole string as a script.
Thank you.Lets say I am trying to call a function called printVersion() using run.
Here is printVersion()
function printVersion(version)
disp(version)
end
Now, if version number doesn’t contain decimal, it works fine.
But, If version number has decimal, it trys to find the whole string as a script.
Thank you. Lets say I am trying to call a function called printVersion() using run.
Here is printVersion()
function printVersion(version)
disp(version)
end
Now, if version number doesn’t contain decimal, it works fine.
But, If version number has decimal, it trys to find the whole string as a script.
Thank you. run, argument with decimal MATLAB Answers — New Questions
Copilot Not Working in New Teams
Hello
Please i need your help on this issue.
One of our users is unable to use Copilot in Teams. The user is properly licensed and Copilot was previously working until a few days ago. Also the transcript option is not available in meetings.
We’ve performed the following troubleshooting steps:
– Restart both Teams and the Computer
– Confirmed Teams Meeting Policies in the admin center
– Reinstall Teams on the device using the teams bootstrapper
– Clear Teams cache from AppData
Could you please guide us on further steps to take?
Hello Please i need your help on this issue. One of our users is unable to use Copilot in Teams. The user is properly licensed and Copilot was previously working until a few days ago. Also the transcript option is not available in meetings. We’ve performed the following troubleshooting steps: – Restart both Teams and the Computer- Confirmed Teams Meeting Policies in the admin center- Reinstall Teams on the device using the teams bootstrapper- Clear Teams cache from AppData Could you please guide us on further steps to take? Read More
Azure Portal Login Loop with GitHub
I can’t create a subscription. When I Select offer It will log in. and loop into Account. mirosoft Instead, what do I need to do to fix it?
I can’t create a subscription. When I Select offer It will log in. and loop into Account. mirosoft Instead, what do I need to do to fix it? Read More
Intune iOS ADE MDM asks for apple id
Hi Community,
I have registered an iphone with a apple business token, added a vpp token and some apps. Removed apple store apps and blocked app store. But it still asks the user for a personal apple id. How can I avoid this?
Thanks for your help!
Steffen
Hi Community, I have registered an iphone with a apple business token, added a vpp token and some apps. Removed apple store apps and blocked app store. But it still asks the user for a personal apple id. How can I avoid this? Thanks for your help! Steffen Read More
Text inside the meshgrid
Hello,
I am trying to place an arbitrary text inside the meshgrid. The code is as follows:
Nx = 201; Ny = 201;
TEXT = ‘K e k’; % Text to draw
FONT_SIZE = 10; % Font size
FONT_NAME = ‘Castellar’; % Font style (you can change this to any available font)
% Create a black image
img = zeros(Ny, Nx);
% Create a figure, axes, and an image object
figure(‘Visible’, ‘off’); % Create an invisible figure
axes(‘Units’, ‘pixels’, ‘Position’, [1, 1, Nx, Ny], ‘Visible’, ‘off’); % Create axes
imageHandle = imshow(img); % Show the black image
% Add text to the image
text(Nx / 2, Ny / 2, TEXT, ‘FontSize’, FONT_SIZE, ‘FontName’, FONT_NAME, …
‘Color’, [1, 1, 1], ‘HorizontalAlignment’, ‘center’, ‘VerticalAlignment’, ‘middle’);
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
% Convert to grayscale and then to binary mask
imgWithTextGray = rgb2gray(imgWithText);
mask = imgWithTextGray > 0;
% Invert the binary mask
mask_inverted = ~mask;
% Convert the inverted binary mask to double type
mask_double = double(mask_inverted);
% Flip upside down
obst = flipud(mask_double);
% Display the final mask (optional)
figure;
imshow(obst);
The code works fine with this grid resolution. However, when i increase the number of mesh points along y-axis (Ny), i get incorrect size of the obst. In particular, the maximum resolution of Ny is 420. For example, if i set Nx=601 and Ny=601, i will get the obst size of 420×601. Obviously, the problem is in this part:
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
I cannot understand why the frame data is limited along y-axis (Ny) by 420 points despite i have enough memory. Can someone suggest anything to fix this problem?
kind regards,
AlexHello,
I am trying to place an arbitrary text inside the meshgrid. The code is as follows:
Nx = 201; Ny = 201;
TEXT = ‘K e k’; % Text to draw
FONT_SIZE = 10; % Font size
FONT_NAME = ‘Castellar’; % Font style (you can change this to any available font)
% Create a black image
img = zeros(Ny, Nx);
% Create a figure, axes, and an image object
figure(‘Visible’, ‘off’); % Create an invisible figure
axes(‘Units’, ‘pixels’, ‘Position’, [1, 1, Nx, Ny], ‘Visible’, ‘off’); % Create axes
imageHandle = imshow(img); % Show the black image
% Add text to the image
text(Nx / 2, Ny / 2, TEXT, ‘FontSize’, FONT_SIZE, ‘FontName’, FONT_NAME, …
‘Color’, [1, 1, 1], ‘HorizontalAlignment’, ‘center’, ‘VerticalAlignment’, ‘middle’);
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
% Convert to grayscale and then to binary mask
imgWithTextGray = rgb2gray(imgWithText);
mask = imgWithTextGray > 0;
% Invert the binary mask
mask_inverted = ~mask;
% Convert the inverted binary mask to double type
mask_double = double(mask_inverted);
% Flip upside down
obst = flipud(mask_double);
% Display the final mask (optional)
figure;
imshow(obst);
The code works fine with this grid resolution. However, when i increase the number of mesh points along y-axis (Ny), i get incorrect size of the obst. In particular, the maximum resolution of Ny is 420. For example, if i set Nx=601 and Ny=601, i will get the obst size of 420×601. Obviously, the problem is in this part:
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
I cannot understand why the frame data is limited along y-axis (Ny) by 420 points despite i have enough memory. Can someone suggest anything to fix this problem?
kind regards,
Alex Hello,
I am trying to place an arbitrary text inside the meshgrid. The code is as follows:
Nx = 201; Ny = 201;
TEXT = ‘K e k’; % Text to draw
FONT_SIZE = 10; % Font size
FONT_NAME = ‘Castellar’; % Font style (you can change this to any available font)
% Create a black image
img = zeros(Ny, Nx);
% Create a figure, axes, and an image object
figure(‘Visible’, ‘off’); % Create an invisible figure
axes(‘Units’, ‘pixels’, ‘Position’, [1, 1, Nx, Ny], ‘Visible’, ‘off’); % Create axes
imageHandle = imshow(img); % Show the black image
% Add text to the image
text(Nx / 2, Ny / 2, TEXT, ‘FontSize’, FONT_SIZE, ‘FontName’, FONT_NAME, …
‘Color’, [1, 1, 1], ‘HorizontalAlignment’, ‘center’, ‘VerticalAlignment’, ‘middle’);
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
% Convert to grayscale and then to binary mask
imgWithTextGray = rgb2gray(imgWithText);
mask = imgWithTextGray > 0;
% Invert the binary mask
mask_inverted = ~mask;
% Convert the inverted binary mask to double type
mask_double = double(mask_inverted);
% Flip upside down
obst = flipud(mask_double);
% Display the final mask (optional)
figure;
imshow(obst);
The code works fine with this grid resolution. However, when i increase the number of mesh points along y-axis (Ny), i get incorrect size of the obst. In particular, the maximum resolution of Ny is 420. For example, if i set Nx=601 and Ny=601, i will get the obst size of 420×601. Obviously, the problem is in this part:
% Get the image data
frame = getframe(gca);
imgWithText = frame.cdata;
I cannot understand why the frame data is limited along y-axis (Ny) by 420 points despite i have enough memory. Can someone suggest anything to fix this problem?
kind regards,
Alex visualization, text MATLAB Answers — New Questions
proper namespace organisation with classes and enums
Hi Folks,
I’m curious of how to proper organise a folder structure for xx
Setting
Consider I’m developing a driver class for some DeviceA made by Manufacturer.
I assume, that I will use this DeviceA in several more Projects and I probably will get another one DeviceB, which use the same manufacturer-specific enumerated definitions of something – let`s say the volume levels will be defined as:
classdef enumVolumeLevels < uint8
enumeration
volLow (0)
volMid (50)
volHigh (100)
end
end
So I will write some kine of driver class including everything manufacturer-specific either as constants or as enumerations.
Folder Structure
So my Folderstructure will look like:
%rootfolder:
.+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
Now if I’m going to write a setter and getter method, which both checks If the provided Value fits to the manufacturer-defined levels
classdef DeviceA
% […]
methods
%getter
function value = get.Volume(obj)
value = Manufacturer.enumVolumeLevels(50); %some dummy getter method
end
%setter
function set.Volume(obj,level)
arguments
obj
mode Manufacturer.enumVolumeLevels
end
% some dummy setter method
end
end
%[…]
end
Standalone usage
Now I’m goind to test my class from the root folder of this project.
… and works fine if I define an object of this class and assign or read the property Volume
test = Manufacturer.DeviceA(); %call constructor
test.Volume = 50; %set property to something
disp(test.Volume); % display this property
Code Refactoring
Following the initial Idea of writing this driver class to use it in several Application specific projects I will include it into root folder of ProjectA, which looks like:
%rootfolder of ProjectA:
.+Drivers+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Drivers+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+Drivers+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
.MyFunc.m %some script containing instancesof the DeviceA-class
But if I write MyFunc.m as follows:
function MyFunc
test = Drivers.Manufacturer.DeviceA(); % call constructor
test.Volume = 50; % set property to something
disp(test.Volume); % display this property
end
… it will fail after the 2nd line because from the setter point of view the enumeration class Manufacturer.enumVolumeLevels is not defined.
So my question is:
–> Is there a solution for organizing my namespace folders to avoid such visibility Problem?
Perhaps I’ll need to chanhe the folder structure of my Manufacturer-package or the way I use the enumeration class in my class DeviceA, but I’m completely stuck right now and have no Idea, what should be the best practice in this case,Hi Folks,
I’m curious of how to proper organise a folder structure for xx
Setting
Consider I’m developing a driver class for some DeviceA made by Manufacturer.
I assume, that I will use this DeviceA in several more Projects and I probably will get another one DeviceB, which use the same manufacturer-specific enumerated definitions of something – let`s say the volume levels will be defined as:
classdef enumVolumeLevels < uint8
enumeration
volLow (0)
volMid (50)
volHigh (100)
end
end
So I will write some kine of driver class including everything manufacturer-specific either as constants or as enumerations.
Folder Structure
So my Folderstructure will look like:
%rootfolder:
.+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
Now if I’m going to write a setter and getter method, which both checks If the provided Value fits to the manufacturer-defined levels
classdef DeviceA
% […]
methods
%getter
function value = get.Volume(obj)
value = Manufacturer.enumVolumeLevels(50); %some dummy getter method
end
%setter
function set.Volume(obj,level)
arguments
obj
mode Manufacturer.enumVolumeLevels
end
% some dummy setter method
end
end
%[…]
end
Standalone usage
Now I’m goind to test my class from the root folder of this project.
… and works fine if I define an object of this class and assign or read the property Volume
test = Manufacturer.DeviceA(); %call constructor
test.Volume = 50; %set property to something
disp(test.Volume); % display this property
Code Refactoring
Following the initial Idea of writing this driver class to use it in several Application specific projects I will include it into root folder of ProjectA, which looks like:
%rootfolder of ProjectA:
.+Drivers+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Drivers+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+Drivers+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
.MyFunc.m %some script containing instancesof the DeviceA-class
But if I write MyFunc.m as follows:
function MyFunc
test = Drivers.Manufacturer.DeviceA(); % call constructor
test.Volume = 50; % set property to something
disp(test.Volume); % display this property
end
… it will fail after the 2nd line because from the setter point of view the enumeration class Manufacturer.enumVolumeLevels is not defined.
So my question is:
–> Is there a solution for organizing my namespace folders to avoid such visibility Problem?
Perhaps I’ll need to chanhe the folder structure of my Manufacturer-package or the way I use the enumeration class in my class DeviceA, but I’m completely stuck right now and have no Idea, what should be the best practice in this case, Hi Folks,
I’m curious of how to proper organise a folder structure for xx
Setting
Consider I’m developing a driver class for some DeviceA made by Manufacturer.
I assume, that I will use this DeviceA in several more Projects and I probably will get another one DeviceB, which use the same manufacturer-specific enumerated definitions of something – let`s say the volume levels will be defined as:
classdef enumVolumeLevels < uint8
enumeration
volLow (0)
volMid (50)
volHigh (100)
end
end
So I will write some kine of driver class including everything manufacturer-specific either as constants or as enumerations.
Folder Structure
So my Folderstructure will look like:
%rootfolder:
.+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
Now if I’m going to write a setter and getter method, which both checks If the provided Value fits to the manufacturer-defined levels
classdef DeviceA
% […]
methods
%getter
function value = get.Volume(obj)
value = Manufacturer.enumVolumeLevels(50); %some dummy getter method
end
%setter
function set.Volume(obj,level)
arguments
obj
mode Manufacturer.enumVolumeLevels
end
% some dummy setter method
end
end
%[…]
end
Standalone usage
Now I’m goind to test my class from the root folder of this project.
… and works fine if I define an object of this class and assign or read the property Volume
test = Manufacturer.DeviceA(); %call constructor
test.Volume = 50; %set property to something
disp(test.Volume); % display this property
Code Refactoring
Following the initial Idea of writing this driver class to use it in several Application specific projects I will include it into root folder of ProjectA, which looks like:
%rootfolder of ProjectA:
.+Drivers+Manufacturer@DeviceADeviceA.m % class definition including constructor and destructor methods and some property ‘Volume’
.+Drivers+Manufacturer@DeviceASomeMethod.m % Methods will be stored separately in class folder
.+Drivers+ManufacturerenumVolumeLevels.m % enumeration class containing manufacturer-specific definitions of volume levels
.MyFunc.m %some script containing instancesof the DeviceA-class
But if I write MyFunc.m as follows:
function MyFunc
test = Drivers.Manufacturer.DeviceA(); % call constructor
test.Volume = 50; % set property to something
disp(test.Volume); % display this property
end
… it will fail after the 2nd line because from the setter point of view the enumeration class Manufacturer.enumVolumeLevels is not defined.
So my question is:
–> Is there a solution for organizing my namespace folders to avoid such visibility Problem?
Perhaps I’ll need to chanhe the folder structure of my Manufacturer-package or the way I use the enumeration class in my class DeviceA, but I’m completely stuck right now and have no Idea, what should be the best practice in this case, namespace, package, class, enumeration class, refactoring, 2021a, .git, modular programming, oop MATLAB Answers — New Questions
Distance measurement using TFmini-S in SIMULINK
We are using TFmini-S connected to ARDUINO UNO at pin no 2 and 3, we want to measure the distance in SIMULINK model for some application. can anyone help us?We are using TFmini-S connected to ARDUINO UNO at pin no 2 and 3, we want to measure the distance in SIMULINK model for some application. can anyone help us? We are using TFmini-S connected to ARDUINO UNO at pin no 2 and 3, we want to measure the distance in SIMULINK model for some application. can anyone help us? tfmini, tfmini-s, arduino, simulink MATLAB Answers — New Questions
Need Help Urgently | Microsoft Form Data is Missing
Hi,
I would like to ask for your kind support to help with my issue urgently.
I have used MS Form to collect information but for some reason, today I tried to export data into excel but many data are missing.
I have checked back to the original MS Form, the data is also missing.
I don’t know what to do to recover the data.
Could you please advice?
Regards,
Trinnakorn C.
Hi, I would like to ask for your kind support to help with my issue urgently. I have used MS Form to collect information but for some reason, today I tried to export data into excel but many data are missing. I have checked back to the original MS Form, the data is also missing. I don’t know what to do to recover the data.Could you please advice? Regards,Trinnakorn C. Read More
New columns on existing table are dropped the next day
Has anyone encountered an issue like this? I cannot find anything searching. Troubleshooting is not fruitful yet
New columns created on existing tables will disappear the next day (ie. ALTER TABLE <name> ADD <column and metadata>)
New tables created within a given DB will persist the next day/ongoing, however
Target DB is set to SIMPLE recovery. DB is in autocommit mode
Running SQL Server on Azure VM
Thankyou
Has anyone encountered an issue like this? I cannot find anything searching. Troubleshooting is not fruitful yetNew columns created on existing tables will disappear the next day (ie. ALTER TABLE <name> ADD <column and metadata>)New tables created within a given DB will persist the next day/ongoing, howeverTarget DB is set to SIMPLE recovery. DB is in autocommit modeRunning SQL Server on Azure VMThankyou Read More