Month: August 2024
recreated mailbox have user AD
How to recreated mailbox clean have you only AD user, restored only ADusers, exchange database is lost create new database new instalation.
Thanks for sugestions.
How to recreated mailbox clean have you only AD user, restored only ADusers, exchange database is lost create new database new instalation.Thanks for sugestions. Read More
Implement Rule-Based scaling in Logic App Standard via Logic App Consumption
Background
As we all know, in Logic App Standard with WS ASP, we follow the target-based scaling as Azure Function EP plan which mostly depends on job queue length not CPU/memory usage.
But in some situations, we could experience high CPU/memory usage without a long job queue which results to the scale controller cannot vote to increase backend instances as expected.
So this blog is introduce how to “simulate” rule based scaling feature for Logic App Standard with WS plan as Logic App Standard running in ASE via using Logic App Consumption (it can be out Azure products as well, eg: Azure Function).
Mechanism
Since we need to scale based on CPU/memory usage (can be different metrics as well) , so the first issue we need to resolved is to get metrics data as following:
For example, if we would like to get average CPU usage, we can go into CPU Percentage page and capture a HAR trace which can tell us that the API used in portal is like:
https://management.azure.com/subscriptions/[SubscriptionID]/resourceGroups/[ResourceGroup]/providers/Microsoft.Web/serverFarms/[ASP Name]/providers/microsoft.Insights/metrics?timespan=[StartTime]/[EndTime]&interval=PT1M&metricnames=CpuPercentage&aggregation=average&metricNamespace=microsoft.web%2Fserverfarms&autoadjusttimegrain=true&validatedimensions=false&api-version=2019-07-01
Once we have the CPU usage data, we can calculate to see whether the current value hit the threshold, if so, we can call management API to change always ready instance count (Web Apps – Update Configuration – REST API (Azure App Service) | Microsoft Learn).
Implementation Logic
1. Retrieve CPU usage via API for past 2 minutes and calculate average
2. Retrieve current Logic App backend instance count and set target instance count as current
3. Validate when average CPU usage hit scale in/out threshold (>50% or <10%)
If larger than scale out threshold, add 1 instance in target instance count if not hit maximum (20) instance count
If less than scale in threshold, remove 1 instance in target instance count if not hit minimum (1) instance count
4. Compare current and target value, if it is different, then send request to change always ready instance(s).
Sample Template
Demo can be found in Drac-Zhang/Rule_Based_Scaling_Template (github.com) which implemented the scaling feature based on CPU usage of past 2 minutes.
Meanwhile, for the Logic App Consumption, we need to enable Managed Identity, assign “Reader” and “Logic App Standard Contributor” role on resource group level for MI.
Known Issues
1. Since it is monitoring the CPU/memory usage on ASP level, so for the ASP, it only can have one Logic App, but this can be workaround via change metrics call to Logic App specific CPU/memory usage.
2. The Logic App Standard configuration API changes always ready instance, the maximum value is 20 as per current WS plan.
3. We have around 1 minute latency for retrieving metrics due to ingestion delay.
Microsoft Tech Community – Latest Blogs –Read More
Transform Application Development with .NET Aspire: Seamless Integration with JavaScript and Node.js
In the ever-evolving landscape of cloud application development, managing configurations, ensuring resilience, and maintaining seamless integration between various components can be quite challenging.
This is where .NET Aspire comes into play! A robust application development framework designed to simplify these complexities, allowing developers to focus on creating features rather than dealing with extensive configurations.
In this article, we will explore the core aspects of .NET Aspire, examining its benefits, the configuration process, and integration with JavaScript, as presented in an outstanding session at the recent .NET Aspire Developers Day by Chris Noring, Senior Developer Advocate at Microsoft.
.NET Aspire Developers Day
The latest .NET Aspire Developers Day, which took place on July 23, 2024, was a great event with lots of technical and practical sessions, featuring different programming languages and frameworks. The main goal of this online event was to show how easy it is to develop modern applications with the power of .NET Aspire!
No worries if you missed the event! Here’s the link to the recording so you can check out and learn more about .NET Aspire and how it can help you in different software development situations.
.NET Aspire Developers Day Online Event
So, what exactly is .NET Aspire? Let’s dive in and find out more!
Understanding .NET Aspire
.NET Aspire is a cloud-ready framework that helps you build distributed and production-ready applications. It’s got NuGet packages that make it easier to build apps that are made up of small, connected services, which are called microservices.
Purpose of .NET Aspire
.NET Aspire is all about making the development process easier, especially when it comes to building cloud-based apps. It’s got tools and patterns that make everything easier, from getting set up to running distributed applications. And also, .NET Aspire makes orchestration simple. It automatically connects projects and their dependencies, so you don’t have to worry about the technical details.
Simplified Orchestration
Orchestration in .NET Aspire is all about making your local development environment easier to use by automating the configuration and interconnection of multiple projects and their dependencies. It’s not meant to replace the kind of robust systems you’d use in production, like Kubernetes. What .NET Aspire does is provide abstractions that make it easier to set up services, find them, and configure containers.
Ready-to-Use Components
.NET Aspire also comes with ready-to-use components like Redis or PostgreSQL that you can add to your project with just a few lines of code. Plus, it’s got project templates and tools for Visual Studio, Visual Studio Code, and the .NET CLI, so it’s a breeze to create and manage your projects.
Usage Example
For instance, you can add a Redis container with just a few lines of code and set up the connection string automatically in the Frontend project.
var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddRedis(“cache”);
builder.AddProject<Projects.MyFrontend>(“frontend”)
.WithReference(cache);
If you want to learn more about .NET Aspire, I suggest checking out the official documentation. It’s got all the details and examples you need to get started developing with .NET Aspire.
Access the official .NET Aspire documentation now: Official .NET Aspire Documentation
Getting Started with .NET Aspire with JavaScript
At the .NET Aspire Developers Day session, Chris Noring showed us an amazing integration between .NET Aspire and JavaScript. He demonstrated how we can use the power of .NET Aspire and the flexibility of JavaScript to create modern, distributed applications.
If you would like to watch Chris Noring’s full session, just click on the link below:
He started off by showing us how simple it is to get started with .NET Aspire. All you need to do is install a few things:
.NET 8
.NET Aspire Workload
OCI-Compatible with Docker ou Podman
Visual Studio Code ou Visual Studio
C# Dev Kit Extension
It’s really straightforward to set up a .NET Aspire project. You can use Visual Studio, Visual Studio Code, or just the terminal.
For instance, you can create a new project using the terminal with this command:
dotnet new aspire-starter
This command puts together a project structure that includes the main bits and pieces you need, like AppHost (the brains of the operation), ServiceDefaults, and a starter application.
Once you have got the project structured, the next thing to do is to run it. Before you get started, you’ll need to make sure that HTTPS is enabled, because .NET Aspire needs HTTPS to work.
To get HTTPS up and running, you can use this command:
dotnet dev-certs https –trust
To get the project up and running, just use the command:
dotnet run
When you run the AppHost project, you’ll see a dashboard with all the resources in your project, like APIs and Frontend services. This dashboard gives you a great overview of your application’s metrics, logs, and active requests, making it easier to monitor and debug your cloud application.
Chris Noring showed us all this at his session at .NET Aspire Developers Day. He made it look really easy and practical to start developing modern applications with .NET Aspire.
If you like, I recommend reading the tutorial: “Quickstart: Build your first .NET Aspire project” available in the official .NET Aspire documentation.
More on Orchestration with .NET Aspire
Let’s take a closer look at what Chris Noring shared in this part of the session.
Orchestrating distributed applications with .NET Aspire is all about setting up and linking the different parts that make up the application. The aspire-manifest.json file is key to this process. It shows how the services connect and configure within the application.
This automation makes life easier for developers, so they don’t have to manually configure each connection and dependency.
The Role of aspire-manifest.json
The aspire-manifest.json is a JSON file that’s automatically generated by .NET Aspire. It contains all the necessary info about the app’s resources and components.
It’s got all the details you need, like connection strings, environment variables, ports, and communication protocols. This manifest makes sure all the app’s services connect right and work together smoothly.
Let’s take a look at the example Chris Noring showed us in the session on how to configure a Redis cache and a Node.js Product API using the Program.cs file.
var cache = builder.AddRedis(“cache”);
var productApi = builder.AddNpmApp(“productapi”, “../NodeApi”, “watch”)
.WithReference(cache)
.WithHttpEndpoint(env: “PORT”)
.WithExternalHttpEndpoints()
.PublishAsDockerFile();
In this example, Redis is configured as a cache service, and the product API, developed in Node.js, is configured to use this cache. The WithReference(cache) method ensures that the product API can connect to Redis. The PublishAsDockerFile() method creates a Dockerfile for the application, allowing it to run in a container.
How Does the Manifest Reflect These Configurations?
Once you have run the code, .NET Aspire will create an aspire-manifest.json file that shows all the settings you’ve configured in the code. Chris goes over how the manifest shows the Redis and Product API configuration:
{
“productapi”: {
“type”: “dockerfile.v0”,
“path”: “../NodeApi/Dockerfile”,
“context”: “../NodeApi”,
“env”: {
“NODE_ENV”: “development”,
“ConnectionStrings__cache”: “{cache.connectionString}”,
“PORT”: “{productapi.bindings.http.port}”
},
“bindings”: {
“http”: {
“scheme”: “http”,
“protocol”: “tcp”,
“transport”: “http”,
“targetPort”: 8000,
“external”: true
}
}
}
}
In this part of the manifest, we can see that the Product API (productapi) is set up to use the Redis connection string (ConnectionStrings__cache), which is automatically generated and added to the application’s environment. On top of that, the manifest says that the Product API will be available via HTTP on port 8000.
How to Create or Update the Manifest?
If you want to generate or update the aspire-manifest.json file, you can use this command:
dotnet run –publisher manifest –output-path aspire-manifest.json
This command runs the application and generates the manifest, which is essential for deployment in production environments or testing during development.
Integrating JavaScript with .NET Aspire
.NET Aspire is flexible enough to work with JavaScript, so you can use it for both front-end and back-end development. This lets developers use popular JavaScript frameworks and libraries with .NET components, creating one unified development environment.
Front-End Example with Angular
Chris Noring showed us how to integrate .NET Aspire into a front-end project developed in Angular. You can make backend configuration and API connection easier by using environment variables. These are automatically generated and injected into the project.
Backend Configuration in Angular
The proxy.conf.js file is used to redirect API calls in the development environment to the right backend. The backend URLs, which can be different in each environment, are managed using environment variables. Here’s an example of how it’s set up:
module.exports = {
“/api”: {
target: process.env[“services__weatherapi__https__0”] || process.env[“services__weatherapi__http__0”],
secure: process.env[“NODE_ENV”] !== “development”,
pathRewrite: { “^/api”: “” },
},
};
In this example, we are setting the target based on the environment variables services__weatherapi__https__0 or services__weatherapi__http__0, which are automatically injected by .NET Aspire. This configuration makes sure that the Angular front end can connect to the backend service no matter what environment it’s in (development, test, or production).
Using HttpClient in Angular
In Angular, you can interact with the backend using the HttpClient service, as shown in the following example:
constructor(private http: HttpClient) {
this.http.get<WeatherForecast[]>(‘api/weatherforecast’).subscribe({
next: result => this.forecasts = result,
error: console.error
});
}
This snippet shows how the call to the api/weatherforecast API is automatically redirected to the correct backend, thanks to the configuration made in proxy.conf.js. This makes it easier for the Angular frontend and the backend to communicate, and it makes sure that the environment variables set up in the .NET Aspire manifest are used correctly.
Integration with Node.js and .NET Aspire
.NET Aspire makes it easy to manage .NET apps and also lets you easily add other technologies like Node.js. This flexibility lets you build distributed apps that combine different tech stacks in a really efficient way.
Orchestration in AppHost
In the orchestration performed in AppHost, .NET Aspire makes it easy for you to connect different components of your application, such as a Node.js Frontend and a Backend API.
In the second image, you can see how AppHost is configured in the code.
var cache = builder.AddRedis(“cache”);
var weatherapi = builder.AddProject<Projects.AspireWithNode_AspNetCoreApi>(“weatherapi”);
var frontend = builder.AddNpmApp(“frontend”, “../NodeFrontend”, “watch”)
.WithReference(weatherapi)
.WithReference(cache)
.WithHttpEndpoint(env: “PORT”)
.WithExternalHttpEndpoints()
.PublishAsDockerFile()
In this example, we’ve got Redis as the cache, the weatherapi for the weather forecast API, and the frontend is the Node.js application. The WithReference() function links everything together, so the frontend can access both Redis and the API.
Using PublishAsDockerFile() lets you package the frontend as a Docker container, which makes it easy to deploy in any environment.
In the Node.js Application…
In the example shown in the images, the Node.js app is set up to get the cache address and API URL straight from the Aspire project.
This is done through environment variables that are automatically generated based on the resources defined in the .NET Aspire manifest.
const cacheAddress = env[‘ConnectionStrings__cache’];
const apiServer = env[‘services__weatherapi__https__0’] ?? env[‘services__weatherapi__http__0’];
.NET Aspire automatically injects environment variables like ConnectionStrings__cache and services__weatherapi into the Node.js application’s runtime environment. These variables have the info needed for the app to connect to Redis and the weather forecast API correctly.
With this info, the app can easily access the cache and the API without having to hard-code URLs or connection strings. This makes it easier to maintain the code and also makes sure the application works correctly in different environments (development, test, production).
Example of Usage in an Express Route
Here’s an example of how this configuration is used in an Express route in a Node.js application:
app.get(‘/’, async (req, res) => {
let cachedForecasts = await cache.get(‘forecasts’);
if (cachedForecasts) {
res.render(‘index’, { forecasts: JSON.parse(cachedForecasts) });
return;
}
let response = await fetch(`${apiServer}/weatherforecast`);
let forecasts = await response.json();
await cache.set(‘forecasts’, JSON.stringify(forecasts));
res.render(‘index’, { forecasts });
});
The app first checks the Redis cache for weather forecasts. If the data is in the cache, it’s displayed right away. Otherwise, the app makes a request to the weather forecast API (apiServer), stores the results in the cache, and then displays them.
This logic really speeds up the app and makes it more efficient, so data is retrieved from the cache as quickly as possible.
Wrapping Up
.NET Aspire is a great tool for building modern apps, especially those that use cloud-based, distributed systems. It gets rid of a lot of the complexity that comes with orchestration, service discovery, and environment configuration, so developers can focus more on writing business logic and less on managing infrastructure.
It’s also great that it works seamlessly with JavaScript and Node.js. This makes it a really useful tool for building robust, scalable apps that can work across different tech stacks.
If you’re looking to make your development workflow easier while making sure your apps are ready for the real world, .NET Aspire is worth checking out.
Don’t miss the opportunity to dive deeper into .NET Aspire’s capabilities. Watch the full session by Chris Noring at .NET Aspire Developers Day to see these concepts in action and learn more about how you can leverage this powerful framework in your projects.
Additional Resources
If you’re looking to keep learning and getting more proficient in .NET Aspire, here are some additional resources to help you out:
Documentação Oficial – .NET Aspire
Orchestrate Node.js apps in .NET Aspire
Code Sample: .NET Aspire with Angular, React, and Vue
Code Sample: .NET Aspire + Node.js
Curso Grátis: Criar aplicativos distribuídos com o .NET Aspire
Video series: Welcome to .NET Aspire
I hope this article has been helpful and inspiring for you. If you have any questions or suggestions, please feel free to share them in the comments below. I’m here to help and support you as you learn and grow professionally.
Until next time! Keep learning, creating, and sharing!
Microsoft Tech Community – Latest Blogs –Read More
Building Power Apps Canvas App with Multimedia Integration in SharePoint – Audio Player
In this article, I’ll demonstrate how to build a Power Apps canvas application from within SharePoint that integrates a SharePoint list backend for storing and retrieving images and audio files. The app that you create will have labels, icons, navigation, image containers, and other elements. You’ll use a layout template and customize the built-in audio control to have a distinct appearance and behavior.
By following the step-by-step instructions in this article, you will be able to create a powerful and fully functional canvas application that’s integrated with SharePoint. By using SharePoint lists for storing and retrieving images and audio files, you can ensure that your app is efficient and easy to manage. The customization options available through Power Apps make it possible to create a unique and visually appealing user interface that’s tailored to your needs. Additionally, you can customize the built-in audio control for a distinct appearance and behavior that will enhance the user experience. With the help of this article, you can create an application that’s sure to impress and provide a valuable tool for your organization.
To begin, you need to have:
A Microsoft 365 license or Microsoft 365 developer account.
A basic understanding about SharePoint (site, list and document library) and Power Apps development.
The high-level sequence of tasks is as follows:
Create elements in SharePoint.
Design and configure the application interface and controls in Power Apps.
Creating a Track List, Picture Library, and Document Library in SharePoint
First, you’ll build the elements in SharePoint.
Step 1: Build the Track List in SharePoint List
In the track list, you’ll create columns for title, artist, artwork, and audio file, where you will add associated data.
Open SharePoint, and then create a new SharePoint site or use an existing site.
Create a new list with the following sample columns (Title, Artist, Artwork, AudioFile), as shown:
The list columns have the following associated data types:
Title – Text
Artist – Text
Artwork – Image
Audio file link – Multiple lines of text
You’ve now created the track list with data. Next, you’ll create the picture library.
Step 2: Create the SharePoint Picture Library to Hold Your Images
Create a picture library to hold all your audio image covers.
To do this, navigate to the site where you want to create the picture library. Select Settings, and then select Add an app. If you don’t see Add an app, select Site contents, and then select Add an app, as shown:
On the Your Apps page, enter Picture into the search box, or select Picture Library. Then in New, select Advanced Options. In Name, enter a name for the library. The library name is required. Enter a description of the library (this is optional), and then choose whether to create a version each time you edit a file in the picture library.
Select Create. The name of the picture library appears under Recent in the Quick Launch panel.
Step 3: Create a SharePoint Document Library to Hold Audio Files
This is the final development stage in SharePoint, where you will create a placeholder for storing image files in SharePoint. In your SharePoint site, select New > Document library > Create (after naming it), as shown in the following video demo.
Video 1: Demonstrates how to create a SharePoint document library.
Developing the Power Apps Application
You can use Power Apps to build custom apps for business scenarios such as data collection, data management, and data visualization, without having to write complex code.
At this point, you’ll develop the Power Apps application UI to feed on the data that you created in SharePoint. Although you could visit make.powerapps.com to start a new blank canvas app and connect to SharePoint to build the app for you, you’ve now integrated this data into a SharePoint list.
Open your track list.
Select Integrate > Power Apps > Create an app (figure 5).
Enter a name for your app, and then select Create.
Designing the Application Controls
Once you’ve generated the app from your SharePoint list, you will construct the interface and configure the controls within the app.
Step 1: Configure and Design the Track List Screen – First Screen
Modify the background properties of the application, and then update the style of the artist image cover to have a circular shape.
To change the background image in PowerApps:
In Power Apps Studio, select the screen.
In the right-hand pane, go to Properties.
From the background image dropdown options, select Add an image file.
Browse to the file you want to use, and then select Open.
To make the image control have a circular shape:
Select the image control that has the artist album cover.
In the right-hand pane, select the Properties tab, if not selected.
Change the Border radius properties to 360.
The aspect ratio of the image will be preserved. If the image isn’t square, it may appear distorted in the circular shape.
Step 2: Build the Play Screen – Second Screen
Now you’ll create the play screen, which includes various controls and displays whatever track is playing. After you’ve built the screen, establish a connection between the first screen (the track list screen) and the play screen. Once you’ve connected the screens, you can navigate, when a track is selected.
To do this:
Go to the first screen (track list screen).
Select the first track, and update its OnSelect property to Navigate(PlayScreen,ScreenTransition.CoverRight). This will navigate the screen to the play screen when you select it.
Build the second screen (play screen) by adding the image control from the selected track:
From the Insert tab, add an image control.
To set the image in your gallery image from the SharePoint database, you can update the image function by using the provided sample code: SongGallery.Selected.Artwork. This is based on what I have. Yours might be a different name.
The Selected property in PowerApps references a currently selected item in a gallery, form, or data table. The SongGallery.Selected refers to a currently selected item in the SongGallery gallery.
The Artwork in this formula is the name of the field that contains the image of the artwork in the data source used by the SongGallery gallery. This field is the column in a SharePoint list that has the track title.
Therefore, SongGallery.Selected.Artwork refers to the image of the artwork that’s associated with the currently selected item in the SongGallery gallery. It enables you to display the artwork in an image control or perform other actions with it.
After making all the necessary editing, the screenshot below shows how your image should look.
Add the Text Labels
On the Insert tab, add two text labels.
Just like the previous updates that you made on the image preview of the selected track, you will apply similar code here to view the artist name and the track title.
Set the text function of one of the text labels to SongGallery.Selected.Title. The Title in this formula is the name of the field that contains the title of the item in the data source that the SongGallery gallery uses. This field is the column in a SharePoint list that has the track title.
Set the second text label function to SongGallery.Selected.Artist.
Add the Audio Control
This is the control that will play the selected track from the previous screen.
From the Insert tab under Media, add an audio Control.
Update its Media function with First(SongGallery.Selected.Attachments).AbsoluteUri. This will enable the audio player to play the selected track.
The following is similar to earlier code, except:
The First function is used to return the first attachment in the attachments collection associated with the currently selected item in the SongGallery gallery.
The AbsoluteUri is a property of the attachment object that returns the URL of the attachment. First(SongGallery.Selected.Attachments).AbsoluteUri is a reference to the URL of the first attachment associated with the currently selected item in the SongGallery gallery, which enables you to display or download the attachment or perform other actions with it.
Change the visibility of the control to False. This is to hide it from showing, since new controls will be created.
Enter the variable varStarPos into the StartTime function.
Enter varPlayinto the Start function.
Add the Slide Bar, Forward, Backward, Play, and Pause Buttons
You will need to add a slide bar and four image controls. You can find these on the Insert tab. After you’ve added them, update each control as follows.
Update the image of the button by browsing an image from your system through the image property of the image control on the Properties tab in the right-hand pane.
Slide Bar:
You can use the slide bar to fast-forward or rewind the currently playing audio.
Update the OnSelect function to Set(varStarPos, Self.Value). Here you’re setting a variable called varStarPos that you used in the StartTime function of the audio control.
Update the Max function to Audio1.Duration. Audio1 is the default name of the audio control.
Set the Default function to varStarPos. This is the default position of the slide bar.
Forward Button:
Update the OnSelect function of the button with the following:
Set(varStarPos,Audio1.Time – 2);
Set(varPlay, false);
Set(varPlay, true);
Backward Button:
Update the OnSelect function of the button with the following:
Set(varStarPos,Audio1.Time + 2);
Set(varPlay, false);
Set(varPlay, true);
Play Button:
Update with the following:
Update the OnSelect function to Set(varPlay,true).
Set its Visible function to !varPlay. The button should not be visible when the audio is playing.
Pause Button:
Update with the following:
Update the OnSelect function to Set(varPlay,false).
Set its Visible function to varPlay. The button should be visible when the audio is playing.
Place the play button on the pause button. The visibility function will make one appear and disappear based on the audio.
The resulting app interface for the play screen (second screen).
Step 3: Build the Add Track Screen – Third Screen
Because you created the app from a SharePoint list, the screen has already been generated for you. You can update the interface by using the available properties.
Step 4: View the Completed App Screens
And there you have it! Don’t forget to add a sound bar .gif file on the screen to display.
Summary
We learned how to build an audio player in Power Apps with a track list integrated from SharePoint. We started by creating a track list, picture library, and document library in SharePoint, and then used Power Apps to design and configure the application controls.
With this audio player, users can easily browse through the track list, select a track to play, and even pause or skip tracks. The user interface is sleek and intuitive, allowing for a seamless experience for users of all skill levels. The integration of SharePoint and Power Apps makes it possible to store and manage the audio files, in addition to any related pictures and documents, all in one central location. This not only improves organization and accessibility but also ensures that the latest versions of files are always available to users. The possibilities for customization and expansion of this audio player are endless, making it a valuable addition to anyone’s digital toolkit.
Resources
Microsoft Power Apps documentation
Microsoft Tech Community – Latest Blogs –Read More
MobileNetV1 & MobileNetV3 matlab code for detecting wafer map defect patterns
Give MobileNetV1 & MobileNetV3 matlab code for identifying defect wafer map patternsGive MobileNetV1 & MobileNetV3 matlab code for identifying defect wafer map patterns Give MobileNetV1 & MobileNetV3 matlab code for identifying defect wafer map patterns mobilenetv1 mobilenetv3 MATLAB Answers — New Questions
how can i show my data on thingsview free app?
i used the read api key to upload my data but it is showing invalid api key. kindly answeri used the read api key to upload my data but it is showing invalid api key. kindly answer i used the read api key to upload my data but it is showing invalid api key. kindly answer 🙂 MATLAB Answers — New Questions
Obtain information after text pattern
Dear all
I am dealing with files of extension .mat (not related to MatLab) like the one attached. I would like to be able to save in a variable the numerical value that appears after the text pattern "material[x]:damping-constant = 1.0" (so, in this case, 1). As you can see, here x can take values from 1 to 8, so it would be useful for me to have an array where each index position stores the the corresponding value.
Any ideas?Dear all
I am dealing with files of extension .mat (not related to MatLab) like the one attached. I would like to be able to save in a variable the numerical value that appears after the text pattern "material[x]:damping-constant = 1.0" (so, in this case, 1). As you can see, here x can take values from 1 to 8, so it would be useful for me to have an array where each index position stores the the corresponding value.
Any ideas? Dear all
I am dealing with files of extension .mat (not related to MatLab) like the one attached. I would like to be able to save in a variable the numerical value that appears after the text pattern "material[x]:damping-constant = 1.0" (so, in this case, 1). As you can see, here x can take values from 1 to 8, so it would be useful for me to have an array where each index position stores the the corresponding value.
Any ideas? information after text pattern MATLAB Answers — New Questions
Generated link to OneDrive file generates “404 NOT FOUND” page
Hi, I’m having an issue with OneDrive – if I attempt to share a file and generate a link that can be opened by anyone and then send that link out, anyone who tries to open the link receives a “404 NOT FOUND” page. This happens for any file in my OneDrive account. I can simulate this if I copy the link and then try to open the link in an incognito or private browser where I am not signed into my OneDrive account. The permissions on the file are set to “anyone with the link can edit”. Can anyone help?
Hi, I’m having an issue with OneDrive – if I attempt to share a file and generate a link that can be opened by anyone and then send that link out, anyone who tries to open the link receives a “404 NOT FOUND” page. This happens for any file in my OneDrive account. I can simulate this if I copy the link and then try to open the link in an incognito or private browser where I am not signed into my OneDrive account. The permissions on the file are set to “anyone with the link can edit”. Can anyone help? Read More
how can i load multiple/all audio files(.wav) in matlab ? all files have different names.
i have a folder containing a number of audio files. i want to load them in a loop so that each audio signals can undergo some operations that i intend to perform.i have a folder containing a number of audio files. i want to load them in a loop so that each audio signals can undergo some operations that i intend to perform. i have a folder containing a number of audio files. i want to load them in a loop so that each audio signals can undergo some operations that i intend to perform. audio signal, loading multiple files, matlab MATLAB Answers — New Questions
Live script: Error Loading
Hi
I have created a matlab livescript file, and saved it as .mlx . When i now try to open the file i get the error:
Error Loading "path to file"
I have tried opening it in a text editor, but it is just empty, though the file is 219 kb.
What can I do?Hi
I have created a matlab livescript file, and saved it as .mlx . When i now try to open the file i get the error:
Error Loading "path to file"
I have tried opening it in a text editor, but it is just empty, though the file is 219 kb.
What can I do? Hi
I have created a matlab livescript file, and saved it as .mlx . When i now try to open the file i get the error:
Error Loading "path to file"
I have tried opening it in a text editor, but it is just empty, though the file is 219 kb.
What can I do? error, live script MATLAB Answers — New Questions
Fully Utilize SharePoint as Document Management
Hi All
I just learned about Document Sets, and got some insights for document handling
I have some plan for development:
Using document sets, we will manage all documents related to end-to-end business from quotations to invoice. Each Purchase Order Doc Set will have their related documents (invoice, approval, payment remittance, etc).
But how we can create a list that contains all the invoice, or approval, or payment (we can store or link them on sharepoint list, and then when we click, we will redirected to the related document set)
In short,
-We have document sets (contains invoice, PO, approval, remittance)
-we would like to create view based on all PO (and other properties also) and when we click, we will redirected to the related doc set
Any suggestions of article or keywords?
Hi AllI just learned about Document Sets, and got some insights for document handling I have some plan for development:Using document sets, we will manage all documents related to end-to-end business from quotations to invoice. Each Purchase Order Doc Set will have their related documents (invoice, approval, payment remittance, etc). But how we can create a list that contains all the invoice, or approval, or payment (we can store or link them on sharepoint list, and then when we click, we will redirected to the related document set)In short, -We have document sets (contains invoice, PO, approval, remittance)-we would like to create view based on all PO (and other properties also) and when we click, we will redirected to the related doc setAny suggestions of article or keywords? Read More
How to modify my MATLAB code to train a neural network with images from different directions?
I am working on a project to estimate the weight of pears using their RGB and Depth images in MATLAB. Initially, I used only front-facing images for training, but now I want to improve the accuracy by including images taken from approximately 90 degrees to the left or right of the pear, in addition to the Depth images.
I tried modifying the code to accommodate these new images, but I’m facing some issues.
I would like to change the following points.
・The pear image uses the front, an image moved approximately 90 degrees to the left or right from the front, and a Depth image.
・I want to put all my data in a datastore.
Currently, the code listed is the code that I have modified, but in this state an error occurs and it is impossible to predict.Please lend me your strength.
cd ‘RGB front file path’
folder_name = pwd;
XImageTrainFront = imageDatastore(folder_name);
cd ‘RGB side file path’
folder_name = pwd;
XImageTrainSide = imageDatastore(folder_name);
cd ‘Depth file path’
folder_name = pwd;
XDispTrain = imageDatastore(folder_name);
YTrain = [ data ]; % weight labels
YTrain = arrayDatastore(YTrain);
% Combine datasets
ds = combine(XImageTrainFront, XImageTrainSide, XDispTrain, YTrain);
dsrand = shuffle(ds);
dsVali = partition(dsrand, 10, 1);
dsTest = partition(dsrand, 10, 2);
ds1=partition(dsrand,10,3);
ds2=partition(dsrand,10,4);
ds3=partition(dsrand,10,5);
ds4=partition(dsrand,10,6);
ds5=partition(dsrand,10,7);
ds6=partition(dsrand,10,8);
ds7=partition(dsrand,10,9);
ds8=partition(dsrand,10,10);
dsTrain=combine(ds1,ds2,ds3,ds4,ds5,ds6,ds7,ds8,ReadOrder="sequential");
YTest = readall(dsTest);
YTest = YTest(:,4);
YTest = cell2mat(YTest);
cd ‘path to googlenet300400_multiple.mat’
load googlenet300400_multiple.mat
miniBatchSize = 16;
options = trainingOptions(‘sgdm’, …
‘MiniBatchSize’, miniBatchSize, …
‘MaxEpochs’, 300, …
‘InitialLearnRate’, 1e-7, …
‘LearnRateSchedule’, ‘piecewise’, …
‘LearnRateDropFactor’, 0.1, …
‘LearnRateDropPeriod’, 30, …
‘Shuffle’, ‘every-epoch’, …
‘ValidationData’, dsVali, …
‘ValidationFrequency’, 50, …
‘Plots’, ‘training-progress’, …
‘Verbose’, true);
net = trainNetwork(dsTrain, lgraph_2, options);
YPredicted = predict(net, dsTest);
predictionError = YTest – YPredicted;
squares = predictionError.^2;
rmse = sqrt(mean(squares));
figure
scatter(YPredicted, YTest, ‘+’);
xlabel("Predicted Value");
ylabel("True Value");
hold on;
plot([100 550], [100 550], ‘r–‘);
Error message that occurred during modification.
Please respond to the following error. Error using: trainNetwork (line 191)
Invalid training data. The output size of the last layer ([1 1 1]) is the response size ([1 1 360000])
does not match.
Error: newcord2 (line 93)
net = trainNetwork(dsTrain, lgraph_2, options);
Error using: nnet.cnn.LayerGraph/replaceLayer (line 300)
Layer ‘finalLayerName’ does not exist.
Error: newcord2 (line 85)
lgraph_2 = replaceLayer(lgraph_2, ‘finalLayerName’, finalLayer);I am working on a project to estimate the weight of pears using their RGB and Depth images in MATLAB. Initially, I used only front-facing images for training, but now I want to improve the accuracy by including images taken from approximately 90 degrees to the left or right of the pear, in addition to the Depth images.
I tried modifying the code to accommodate these new images, but I’m facing some issues.
I would like to change the following points.
・The pear image uses the front, an image moved approximately 90 degrees to the left or right from the front, and a Depth image.
・I want to put all my data in a datastore.
Currently, the code listed is the code that I have modified, but in this state an error occurs and it is impossible to predict.Please lend me your strength.
cd ‘RGB front file path’
folder_name = pwd;
XImageTrainFront = imageDatastore(folder_name);
cd ‘RGB side file path’
folder_name = pwd;
XImageTrainSide = imageDatastore(folder_name);
cd ‘Depth file path’
folder_name = pwd;
XDispTrain = imageDatastore(folder_name);
YTrain = [ data ]; % weight labels
YTrain = arrayDatastore(YTrain);
% Combine datasets
ds = combine(XImageTrainFront, XImageTrainSide, XDispTrain, YTrain);
dsrand = shuffle(ds);
dsVali = partition(dsrand, 10, 1);
dsTest = partition(dsrand, 10, 2);
ds1=partition(dsrand,10,3);
ds2=partition(dsrand,10,4);
ds3=partition(dsrand,10,5);
ds4=partition(dsrand,10,6);
ds5=partition(dsrand,10,7);
ds6=partition(dsrand,10,8);
ds7=partition(dsrand,10,9);
ds8=partition(dsrand,10,10);
dsTrain=combine(ds1,ds2,ds3,ds4,ds5,ds6,ds7,ds8,ReadOrder="sequential");
YTest = readall(dsTest);
YTest = YTest(:,4);
YTest = cell2mat(YTest);
cd ‘path to googlenet300400_multiple.mat’
load googlenet300400_multiple.mat
miniBatchSize = 16;
options = trainingOptions(‘sgdm’, …
‘MiniBatchSize’, miniBatchSize, …
‘MaxEpochs’, 300, …
‘InitialLearnRate’, 1e-7, …
‘LearnRateSchedule’, ‘piecewise’, …
‘LearnRateDropFactor’, 0.1, …
‘LearnRateDropPeriod’, 30, …
‘Shuffle’, ‘every-epoch’, …
‘ValidationData’, dsVali, …
‘ValidationFrequency’, 50, …
‘Plots’, ‘training-progress’, …
‘Verbose’, true);
net = trainNetwork(dsTrain, lgraph_2, options);
YPredicted = predict(net, dsTest);
predictionError = YTest – YPredicted;
squares = predictionError.^2;
rmse = sqrt(mean(squares));
figure
scatter(YPredicted, YTest, ‘+’);
xlabel("Predicted Value");
ylabel("True Value");
hold on;
plot([100 550], [100 550], ‘r–‘);
Error message that occurred during modification.
Please respond to the following error. Error using: trainNetwork (line 191)
Invalid training data. The output size of the last layer ([1 1 1]) is the response size ([1 1 360000])
does not match.
Error: newcord2 (line 93)
net = trainNetwork(dsTrain, lgraph_2, options);
Error using: nnet.cnn.LayerGraph/replaceLayer (line 300)
Layer ‘finalLayerName’ does not exist.
Error: newcord2 (line 85)
lgraph_2 = replaceLayer(lgraph_2, ‘finalLayerName’, finalLayer); I am working on a project to estimate the weight of pears using their RGB and Depth images in MATLAB. Initially, I used only front-facing images for training, but now I want to improve the accuracy by including images taken from approximately 90 degrees to the left or right of the pear, in addition to the Depth images.
I tried modifying the code to accommodate these new images, but I’m facing some issues.
I would like to change the following points.
・The pear image uses the front, an image moved approximately 90 degrees to the left or right from the front, and a Depth image.
・I want to put all my data in a datastore.
Currently, the code listed is the code that I have modified, but in this state an error occurs and it is impossible to predict.Please lend me your strength.
cd ‘RGB front file path’
folder_name = pwd;
XImageTrainFront = imageDatastore(folder_name);
cd ‘RGB side file path’
folder_name = pwd;
XImageTrainSide = imageDatastore(folder_name);
cd ‘Depth file path’
folder_name = pwd;
XDispTrain = imageDatastore(folder_name);
YTrain = [ data ]; % weight labels
YTrain = arrayDatastore(YTrain);
% Combine datasets
ds = combine(XImageTrainFront, XImageTrainSide, XDispTrain, YTrain);
dsrand = shuffle(ds);
dsVali = partition(dsrand, 10, 1);
dsTest = partition(dsrand, 10, 2);
ds1=partition(dsrand,10,3);
ds2=partition(dsrand,10,4);
ds3=partition(dsrand,10,5);
ds4=partition(dsrand,10,6);
ds5=partition(dsrand,10,7);
ds6=partition(dsrand,10,8);
ds7=partition(dsrand,10,9);
ds8=partition(dsrand,10,10);
dsTrain=combine(ds1,ds2,ds3,ds4,ds5,ds6,ds7,ds8,ReadOrder="sequential");
YTest = readall(dsTest);
YTest = YTest(:,4);
YTest = cell2mat(YTest);
cd ‘path to googlenet300400_multiple.mat’
load googlenet300400_multiple.mat
miniBatchSize = 16;
options = trainingOptions(‘sgdm’, …
‘MiniBatchSize’, miniBatchSize, …
‘MaxEpochs’, 300, …
‘InitialLearnRate’, 1e-7, …
‘LearnRateSchedule’, ‘piecewise’, …
‘LearnRateDropFactor’, 0.1, …
‘LearnRateDropPeriod’, 30, …
‘Shuffle’, ‘every-epoch’, …
‘ValidationData’, dsVali, …
‘ValidationFrequency’, 50, …
‘Plots’, ‘training-progress’, …
‘Verbose’, true);
net = trainNetwork(dsTrain, lgraph_2, options);
YPredicted = predict(net, dsTest);
predictionError = YTest – YPredicted;
squares = predictionError.^2;
rmse = sqrt(mean(squares));
figure
scatter(YPredicted, YTest, ‘+’);
xlabel("Predicted Value");
ylabel("True Value");
hold on;
plot([100 550], [100 550], ‘r–‘);
Error message that occurred during modification.
Please respond to the following error. Error using: trainNetwork (line 191)
Invalid training data. The output size of the last layer ([1 1 1]) is the response size ([1 1 360000])
does not match.
Error: newcord2 (line 93)
net = trainNetwork(dsTrain, lgraph_2, options);
Error using: nnet.cnn.LayerGraph/replaceLayer (line 300)
Layer ‘finalLayerName’ does not exist.
Error: newcord2 (line 85)
lgraph_2 = replaceLayer(lgraph_2, ‘finalLayerName’, finalLayer); prediction, multi-input network, 予測, 多入力ネットワーク MATLAB Answers — New Questions
Trouble with for loop to determine the discrete wavelet transform (DWT)
Hi, I need assistance plotting the approximation (A) and detail (D) coefficients separately for all sheets in an Excel file over a given time frame. Currently, the existing code generates the transform only for the final sheet (Sheet 8). I am uncertain how to modify the code to plot A1 and D1 separately for all sheets. I would be grateful for any guidance you may provide. Thank you for your time and help.
clc
close all
clear all
filename = ‘s.xlsx’;
% Get the sheet names
[~, sheetNames] = xlsfinfo(filename);
for i = 1:numel(sheetNames)
% Read the data from the sheet
data = xlsread(filename, i);
% Extract the time and signal columns
t(:,i) = data(:, 1);
sig (:,i) = data(:, 2);
N = length(sig);
dt = t(3) – t(2); % sampling time
fs = 1/dt; % freq
signal = sig (:,i);
wname = ‘bior6.8’;
% Discrete Wavelet, DWT
[CA1,CD1] = dwt(signal,wname);
A1 = idwt(CA1,[],wname,N);
D1 = idwt([],CD1,wname,N);
t (:,i) = linspace(0,N,N)*(1/fs);
subplot(1,2,1);
plot (t,A1,’k’,’LineWidth’,1.5);
title(sprintf(‘Approximation for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
subplot(1,2,2);
plot (t,D1,’k’,’LineWidth’,1.5);
title(sprintf(‘Detail for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
endHi, I need assistance plotting the approximation (A) and detail (D) coefficients separately for all sheets in an Excel file over a given time frame. Currently, the existing code generates the transform only for the final sheet (Sheet 8). I am uncertain how to modify the code to plot A1 and D1 separately for all sheets. I would be grateful for any guidance you may provide. Thank you for your time and help.
clc
close all
clear all
filename = ‘s.xlsx’;
% Get the sheet names
[~, sheetNames] = xlsfinfo(filename);
for i = 1:numel(sheetNames)
% Read the data from the sheet
data = xlsread(filename, i);
% Extract the time and signal columns
t(:,i) = data(:, 1);
sig (:,i) = data(:, 2);
N = length(sig);
dt = t(3) – t(2); % sampling time
fs = 1/dt; % freq
signal = sig (:,i);
wname = ‘bior6.8’;
% Discrete Wavelet, DWT
[CA1,CD1] = dwt(signal,wname);
A1 = idwt(CA1,[],wname,N);
D1 = idwt([],CD1,wname,N);
t (:,i) = linspace(0,N,N)*(1/fs);
subplot(1,2,1);
plot (t,A1,’k’,’LineWidth’,1.5);
title(sprintf(‘Approximation for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
subplot(1,2,2);
plot (t,D1,’k’,’LineWidth’,1.5);
title(sprintf(‘Detail for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
end Hi, I need assistance plotting the approximation (A) and detail (D) coefficients separately for all sheets in an Excel file over a given time frame. Currently, the existing code generates the transform only for the final sheet (Sheet 8). I am uncertain how to modify the code to plot A1 and D1 separately for all sheets. I would be grateful for any guidance you may provide. Thank you for your time and help.
clc
close all
clear all
filename = ‘s.xlsx’;
% Get the sheet names
[~, sheetNames] = xlsfinfo(filename);
for i = 1:numel(sheetNames)
% Read the data from the sheet
data = xlsread(filename, i);
% Extract the time and signal columns
t(:,i) = data(:, 1);
sig (:,i) = data(:, 2);
N = length(sig);
dt = t(3) – t(2); % sampling time
fs = 1/dt; % freq
signal = sig (:,i);
wname = ‘bior6.8’;
% Discrete Wavelet, DWT
[CA1,CD1] = dwt(signal,wname);
A1 = idwt(CA1,[],wname,N);
D1 = idwt([],CD1,wname,N);
t (:,i) = linspace(0,N,N)*(1/fs);
subplot(1,2,1);
plot (t,A1,’k’,’LineWidth’,1.5);
title(sprintf(‘Approximation for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
subplot(1,2,2);
plot (t,D1,’k’,’LineWidth’,1.5);
title(sprintf(‘Detail for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
end dwt, plot, for loop MATLAB Answers — New Questions
Seeking assistance for MS project
Hi Team,
Can we use ‘Expected Finish’ or ‘Projected Finish’ in MS Project in a similar way to how they are used in Primavera P6?
For instance
If a Contractor or Consultant commits to completing work by a date that differs from the baseline plan, how should the project schedule be adjusted to reflect these new dates? For instance, if the building structure was originally scheduled for completion in August, but the contractor has now committed to finishing by November, what is the best way to analyze the impact of this change on the overall project timeline in MS project?
Regards
Abhishek
Hi Team, Can we use ‘Expected Finish’ or ‘Projected Finish’ in MS Project in a similar way to how they are used in Primavera P6?For instance If a Contractor or Consultant commits to completing work by a date that differs from the baseline plan, how should the project schedule be adjusted to reflect these new dates? For instance, if the building structure was originally scheduled for completion in August, but the contractor has now committed to finishing by November, what is the best way to analyze the impact of this change on the overall project timeline in MS project? Regards Abhishek Read More
Set up a native connection from Matlab to MySQL with SSL
I’m trying to use the native mysql interface to connect to a MySql 8.0.37 database on Azure. This database was previously deployed to a test server which didn’t require SSL and I was able to connect to it without issue. I’m also able to connect to the new Azure MySql database using DBeaver and the MySql Workbench from the same client computer, but I get the following error when I try to connect with Matlab’s mysql connector:
Error using mysql (line 49)
Connections using insecure transport are prohibited while –require_secure_transport=ON..
My connection code is as follows (where aosDbSettings is a struct containing the connection details):
conn = mysql( …
aosDbSettings.UserName, aosDbSettings.UserPassword, …
‘Server’, aosDbSettings.Server, …
‘DatabaseName’, aosDbSettings.DatabaseName, …
‘PortNumber’, aosDbSettings.PortNumber …
);
Having reviewed the documentation for the Native MySql Interface (specifically the mysql function), I don’t see any options related to SSL. Are there any undocumented options available to make this work? I find it surprising that there’s no mention of security options in the documentation. Am I missing something?I’m trying to use the native mysql interface to connect to a MySql 8.0.37 database on Azure. This database was previously deployed to a test server which didn’t require SSL and I was able to connect to it without issue. I’m also able to connect to the new Azure MySql database using DBeaver and the MySql Workbench from the same client computer, but I get the following error when I try to connect with Matlab’s mysql connector:
Error using mysql (line 49)
Connections using insecure transport are prohibited while –require_secure_transport=ON..
My connection code is as follows (where aosDbSettings is a struct containing the connection details):
conn = mysql( …
aosDbSettings.UserName, aosDbSettings.UserPassword, …
‘Server’, aosDbSettings.Server, …
‘DatabaseName’, aosDbSettings.DatabaseName, …
‘PortNumber’, aosDbSettings.PortNumber …
);
Having reviewed the documentation for the Native MySql Interface (specifically the mysql function), I don’t see any options related to SSL. Are there any undocumented options available to make this work? I find it surprising that there’s no mention of security options in the documentation. Am I missing something? I’m trying to use the native mysql interface to connect to a MySql 8.0.37 database on Azure. This database was previously deployed to a test server which didn’t require SSL and I was able to connect to it without issue. I’m also able to connect to the new Azure MySql database using DBeaver and the MySql Workbench from the same client computer, but I get the following error when I try to connect with Matlab’s mysql connector:
Error using mysql (line 49)
Connections using insecure transport are prohibited while –require_secure_transport=ON..
My connection code is as follows (where aosDbSettings is a struct containing the connection details):
conn = mysql( …
aosDbSettings.UserName, aosDbSettings.UserPassword, …
‘Server’, aosDbSettings.Server, …
‘DatabaseName’, aosDbSettings.DatabaseName, …
‘PortNumber’, aosDbSettings.PortNumber …
);
Having reviewed the documentation for the Native MySql Interface (specifically the mysql function), I don’t see any options related to SSL. Are there any undocumented options available to make this work? I find it surprising that there’s no mention of security options in the documentation. Am I missing something? mysql, ssl, database toolbox MATLAB Answers — New Questions
How to Curve the Lane
I want to show the straight and curved lanes on the roadrunner.
Is there a way to turn a straight lane into a curved lane?
Or is there a document or link to refer to?I want to show the straight and curved lanes on the roadrunner.
Is there a way to turn a straight lane into a curved lane?
Or is there a document or link to refer to? I want to show the straight and curved lanes on the roadrunner.
Is there a way to turn a straight lane into a curved lane?
Or is there a document or link to refer to? curve, roadrunner MATLAB Answers — New Questions
Failed to load a mesh from gptoolbox. I am missing something, what is it?
% 1. Load a Mesh
[V, F] = readOFF(‘D:Conferences and WorkshopsSG SummerMFC – Scodesgptoolbox-mastergptoolbox-mastermesh.off’);
% 2. Display the Mesh
figure;
trisurf(F, V(:,1), V(:,2), V(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘Original Mesh’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% Define the number of iterations and timestep for smoothing
num_iterations = 100;
time_step = 0.01;
% 3. Mean Curvature Flow (MCF) – Explicit Method
V_explicit = V; % Copy the vertices for the explicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator and mean curvature normal
L = cotmatrix(V_explicit, F);
HN = -L * V_explicit;
% Update vertex positions
V_explicit = V_explicit + time_step * HN;
end
% Display the smoothed mesh – Explicit Method
figure;
trisurf(F, V_explicit(:,1), V_explicit(:,2), V_explicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Explicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% 3. Mean Curvature Flow (MCF) – Semi-Implicit Method
V_implicit = V; % Copy the vertices for the implicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator
L = cotmatrix(V_implicit, F);
% Solve (I – time_step * L) * V_new = V_old
V_implicit = (speye(size(V_implicit, 1)) – time_step * L) V_implicit;
end
% Display the smoothed mesh – Semi-Implicit Method
figure;
trisurf(F, V_implicit(:,1), V_implicit(:,2), V_implicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Semi-Implicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
here is the link to loadmesh function: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/load_mesh.m
and the readOFF: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/readOFF.m% 1. Load a Mesh
[V, F] = readOFF(‘D:Conferences and WorkshopsSG SummerMFC – Scodesgptoolbox-mastergptoolbox-mastermesh.off’);
% 2. Display the Mesh
figure;
trisurf(F, V(:,1), V(:,2), V(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘Original Mesh’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% Define the number of iterations and timestep for smoothing
num_iterations = 100;
time_step = 0.01;
% 3. Mean Curvature Flow (MCF) – Explicit Method
V_explicit = V; % Copy the vertices for the explicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator and mean curvature normal
L = cotmatrix(V_explicit, F);
HN = -L * V_explicit;
% Update vertex positions
V_explicit = V_explicit + time_step * HN;
end
% Display the smoothed mesh – Explicit Method
figure;
trisurf(F, V_explicit(:,1), V_explicit(:,2), V_explicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Explicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% 3. Mean Curvature Flow (MCF) – Semi-Implicit Method
V_implicit = V; % Copy the vertices for the implicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator
L = cotmatrix(V_implicit, F);
% Solve (I – time_step * L) * V_new = V_old
V_implicit = (speye(size(V_implicit, 1)) – time_step * L) V_implicit;
end
% Display the smoothed mesh – Semi-Implicit Method
figure;
trisurf(F, V_implicit(:,1), V_implicit(:,2), V_implicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Semi-Implicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
here is the link to loadmesh function: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/load_mesh.m
and the readOFF: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/readOFF.m % 1. Load a Mesh
[V, F] = readOFF(‘D:Conferences and WorkshopsSG SummerMFC – Scodesgptoolbox-mastergptoolbox-mastermesh.off’);
% 2. Display the Mesh
figure;
trisurf(F, V(:,1), V(:,2), V(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘Original Mesh’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% Define the number of iterations and timestep for smoothing
num_iterations = 100;
time_step = 0.01;
% 3. Mean Curvature Flow (MCF) – Explicit Method
V_explicit = V; % Copy the vertices for the explicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator and mean curvature normal
L = cotmatrix(V_explicit, F);
HN = -L * V_explicit;
% Update vertex positions
V_explicit = V_explicit + time_step * HN;
end
% Display the smoothed mesh – Explicit Method
figure;
trisurf(F, V_explicit(:,1), V_explicit(:,2), V_explicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Explicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% 3. Mean Curvature Flow (MCF) – Semi-Implicit Method
V_implicit = V; % Copy the vertices for the implicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator
L = cotmatrix(V_implicit, F);
% Solve (I – time_step * L) * V_new = V_old
V_implicit = (speye(size(V_implicit, 1)) – time_step * L) V_implicit;
end
% Display the smoothed mesh – Semi-Implicit Method
figure;
trisurf(F, V_implicit(:,1), V_implicit(:,2), V_implicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Semi-Implicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
here is the link to loadmesh function: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/load_mesh.m
and the readOFF: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/readOFF.m gpu, gp, image processing, mesh MATLAB Answers — New Questions
Can’t connect branch with block in simulink
Hello.
I made a circuit for superposition theorem in simulink with dc voltage source and the measured current is connected to the scope as an output so i can see the value.My next task is to simulate the work of this circuit. When i try to drag & connect the branch with the input of the current measurement block then it is showing red dashed line which means that i cannot connect it to my circuit.
Please someone help me solve this problem, it is a bit urgent.
Thank you!Hello.
I made a circuit for superposition theorem in simulink with dc voltage source and the measured current is connected to the scope as an output so i can see the value.My next task is to simulate the work of this circuit. When i try to drag & connect the branch with the input of the current measurement block then it is showing red dashed line which means that i cannot connect it to my circuit.
Please someone help me solve this problem, it is a bit urgent.
Thank you! Hello.
I made a circuit for superposition theorem in simulink with dc voltage source and the measured current is connected to the scope as an output so i can see the value.My next task is to simulate the work of this circuit. When i try to drag & connect the branch with the input of the current measurement block then it is showing red dashed line which means that i cannot connect it to my circuit.
Please someone help me solve this problem, it is a bit urgent.
Thank you! superposition theorem, block connection MATLAB Answers — New Questions
大发回血上岸最快的方法技巧
大发回血上岸最快的方法技巧:white_heavy_check_mark:《網:36hf. cc》【 导师 Q:8521248】【23hf.cc】:white_heavy_check_mark:【首丨存丨即丨送】:white_heavy_check_mark:【靠丨谱丨老丨台】:white_heavy_check_mark:【万丨人丨聊丨天丨室】:white_heavy_check_mark:【精丨准丨计丨划】:white_heavy_check_mark:【财丨运丨当丨头】:white_heavy_check_mark:【好丨运丨连丨连】:white_heavy_check_mark:【共丨创丨辉丨煌】:white_heavy_check_mark:你若信我,请坚信,我必定会带你东山再起!风险和机会共存!我需要对你负责,也不做没把握的事情,只要你准备的足够充分,我也有绝对的能力,带你赚取到你的理想金额,希望我们可以做到真正的合作共赢!【TGRsdllakbz】
大发回血上岸最快的方法技巧:white_heavy_check_mark:《網:36hf. cc》【 导师 Q:8521248】【23hf.cc】:white_heavy_check_mark:【首丨存丨即丨送】:white_heavy_check_mark:【靠丨谱丨老丨台】:white_heavy_check_mark:【万丨人丨聊丨天丨室】:white_heavy_check_mark:【精丨准丨计丨划】:white_heavy_check_mark:【财丨运丨当丨头】:white_heavy_check_mark:【好丨运丨连丨连】:white_heavy_check_mark:【共丨创丨辉丨煌】:white_heavy_check_mark:你若信我,请坚信,我必定会带你东山再起!风险和机会共存!我需要对你负责,也不做没把握的事情,只要你准备的足够充分,我也有绝对的能力,带你赚取到你的理想金额,希望我们可以做到真正的合作共赢!【TGRsdllakbz】 Read More
Criteria for the final SINR, CQI computation in 5G NR CSI Reporting
In 5G toolbox, specifically NR Downlink CSI Reporting Example, SINR is being calculated for all layers. I have a question, for a two-layer scenario, if SINR values vary considerably, what should be the criteria for the final SINR, CQI computation? The lowest SINR, the mean or something between? In other words, which one of these criteria should we choose, as each comes with pros and cons.
Go with lowest SINR.
Go with higher SINR and rank1.
Go between lower SINR and average SINR.
ThanksIn 5G toolbox, specifically NR Downlink CSI Reporting Example, SINR is being calculated for all layers. I have a question, for a two-layer scenario, if SINR values vary considerably, what should be the criteria for the final SINR, CQI computation? The lowest SINR, the mean or something between? In other words, which one of these criteria should we choose, as each comes with pros and cons.
Go with lowest SINR.
Go with higher SINR and rank1.
Go between lower SINR and average SINR.
Thanks In 5G toolbox, specifically NR Downlink CSI Reporting Example, SINR is being calculated for all layers. I have a question, for a two-layer scenario, if SINR values vary considerably, what should be the criteria for the final SINR, CQI computation? The lowest SINR, the mean or something between? In other words, which one of these criteria should we choose, as each comes with pros and cons.
Go with lowest SINR.
Go with higher SINR and rank1.
Go between lower SINR and average SINR.
Thanks csirs, 5g, nr, sinr MATLAB Answers — New Questions