Month: August 2024
Custom views in new Outlook client gone
It appears in the new Outlook client you cannot add custom views anymore like explained in this article https://support.microsoft.com/en-us/office/create-change-or-customize-a-view-f693f3d9-0037-4fa0-9376-3a57b6337b71 – is there another option in the new teams for this.
I have quite a few users now reporting this and I can’t find a MSFT documented way to get something back in place for our users.
It appears in the new Outlook client you cannot add custom views anymore like explained in this article https://support.microsoft.com/en-us/office/create-change-or-customize-a-view-f693f3d9-0037-4fa0-9376-3a57b6337b71 – is there another option in the new teams for this. I have quite a few users now reporting this and I can’t find a MSFT documented way to get something back in place for our users. Read More
Function disappears after Import-Module
I have a problem with Import-Module.
I have a psm1 file which exports function “Write-FromWithinPsmFile“. This psm1 is imported into two ps1 files using Import-Module.
Also the main ps1 files calls the other ps1 file.
Now I found two cases, where calling the function “Write-FromWithinPsmFile” works fine and the other way shows some confusing result, which I cannot explain. The function “disappears” after the main script executes the second script. But only in case it executes the second script from within a function.
This is the Test.psm1 file:
function Write-FromWithinPsmFile($Text)
{
Write-Host “code in Test.psm1: $Text”
}
Export-ModuleMember -Function Write-FromWithinPsmFile
This is the script Start.ps1:
param (
[Parameter()]
[switch]
$WillFail
)
Import-Module “C:tmpTest.psm1” -Scope Local -Force -ErrorAction Stop
function Invoke-ScriptFromFunction
{
. “C:tmpCalledScript_repro.ps1”
}
Write-FromWithinPsmFile “called from Start.ps1 – first time”
if ($WillFail)
{
# execute the script from within a function
Invoke-ScriptFromFunction
}
else
{
# execute the script directly
. “C:tmpCalledScript_repro.ps1”
}
Write-FromWithinPsmFile “called from Start.ps1 – second time”
And this is the CalledScript_repro.ps1, which is called by the main script:
Import-Module “C:tmpTest.psm1” -Scope Local -ErrorAction Stop -Force
# do something …..
This is the successfull execution: powershell -File C:tmpStart.ps1 -Verbose
This is the failing one: powershell -File C:tmpStart.ps1 -WillFail -Verbose
It tells me:
Write-FromWithinPsmFile : The term ‘Write-FromWithinPsmFile’ is not recognized as the name of a
cmdlet, function, script file, or operable program.
Both calls will succeed, in case I change the CalledScript_repro.ps1 to this (I removed the -Force):
Import-Module “C:tmpTest.psm1” -Scope Local -ErrorAction Stop
# do something …..
Some time ago I added the -Force, because it is more convenient when debugging and writing the code.
So my question is:
What am I doing wrong? Do I need to do the Remove-Module explicitly? How should I use the Import-Module?
I have a problem with Import-Module.I have a psm1 file which exports function “Write-FromWithinPsmFile”. This psm1 is imported into two ps1 files using Import-Module.Also the main ps1 files calls the other ps1 file.Now I found two cases, where calling the function “Write-FromWithinPsmFile” works fine and the other way shows some confusing result, which I cannot explain. The function “disappears” after the main script executes the second script. But only in case it executes the second script from within a function. This is the Test.psm1 file: function Write-FromWithinPsmFile($Text)
{
Write-Host “code in Test.psm1: $Text”
}
Export-ModuleMember -Function Write-FromWithinPsmFile This is the script Start.ps1: param (
[Parameter()]
[switch]
$WillFail
)
Import-Module “C:tmpTest.psm1” -Scope Local -Force -ErrorAction Stop
function Invoke-ScriptFromFunction
{
. “C:tmpCalledScript_repro.ps1”
}
Write-FromWithinPsmFile “called from Start.ps1 – first time”
if ($WillFail)
{
# execute the script from within a function
Invoke-ScriptFromFunction
}
else
{
# execute the script directly
. “C:tmpCalledScript_repro.ps1”
}
Write-FromWithinPsmFile “called from Start.ps1 – second time” And this is the CalledScript_repro.ps1, which is called by the main script: Import-Module “C:tmpTest.psm1” -Scope Local -ErrorAction Stop -Force
# do something ….. This is the successfull execution: powershell -File C:tmpStart.ps1 -VerboseThis is the failing one: powershell -File C:tmpStart.ps1 -WillFail -VerboseIt tells me:Write-FromWithinPsmFile : The term ‘Write-FromWithinPsmFile’ is not recognized as the name of acmdlet, function, script file, or operable program.Both calls will succeed, in case I change the CalledScript_repro.ps1 to this (I removed the -Force): Import-Module “C:tmpTest.psm1” -Scope Local -ErrorAction Stop
# do something ….. Some time ago I added the -Force, because it is more convenient when debugging and writing the code.So my question is:What am I doing wrong? Do I need to do the Remove-Module explicitly? How should I use the Import-Module? Read More
need help transforming data
Hi,
I basicly have the left table and want to create the right one but with a larger data set. Annybody knows how to do this in Excel? Does this proces have a name?
Hi, I basicly have the left table and want to create the right one but with a larger data set. Annybody knows how to do this in Excel? Does this proces have a name? Read More
Microsoft Intune agent on Linux
hi team
we enroll a Linux device successfully with Intune.
Linux os is ubuntu 22.04.4 LTS
Intune agent is Ver 1.2405.17
every time after closing the agent or restarting the os the Intune agent does not connect automatically and asks for login.
is this the normal behavior in Linux or am I missing something? 🙂
hi team we enroll a Linux device successfully with Intune.Linux os is ubuntu 22.04.4 LTS Intune agent is Ver 1.2405.17every time after closing the agent or restarting the os the Intune agent does not connect automatically and asks for login.is this the normal behavior in Linux or am I missing something? 🙂 Read More
Outlook deeplink calendar compose ends with a blank screen on save
Recently we noticed any deeplinks we use for composing events into the outlook calendar end with a blank screen. This used to close automatically on complete.
We have an offering of our app in msTeams so this flow is very confusing for users as it’s not apparent a new tab has been opened in msteams.
We are working towards using teams specific deeplinks for calendar events but we still need the outlook deeplink to work as expected for web versions of our app.
An example of this behaviour from another thread this was mentioned in that has had no response:
https://www.youtube.com/watch?v=TqEkn5SGQPU
Recently we noticed any deeplinks we use for composing events into the outlook calendar end with a blank screen. This used to close automatically on complete.We have an offering of our app in msTeams so this flow is very confusing for users as it’s not apparent a new tab has been opened in msteams. We are working towards using teams specific deeplinks for calendar events but we still need the outlook deeplink to work as expected for web versions of our app.An example of this behaviour from another thread this was mentioned in that has had no response: https://www.youtube.com/watch?v=TqEkn5SGQPU Read More
Cross-workspace incident management
Hello Techcommunity, We are looking for a solution to manage incidents in several Sentinel workspaces within the same tenant. 1. We reviewed Azure Lighthouse and it seems to be working only for cross-tenant management2. We saw the option to mark the workspaces we want to monitor and click on “View incidents”3. We also considered building the dashboard in a Workbook Could you please say if there is any other option to have a unified dashboard for managing incidents from several Sentinels within the same tenant? Read More
Issue Plotting Array in Imagesc
I am trying to plot an array as an imagesc plot. The array is full of non-zero numbers, but imagesc plots them as zero. I think the issue is with scaling, but I don’t know how to fix it. Screenshots attached to show what I mean. How do I scale my imagesc plot so that the numbers in the array are visible appropriately? Tried looking it up on the documentation but couldn’t find a clear answer for my problem.I am trying to plot an array as an imagesc plot. The array is full of non-zero numbers, but imagesc plots them as zero. I think the issue is with scaling, but I don’t know how to fix it. Screenshots attached to show what I mean. How do I scale my imagesc plot so that the numbers in the array are visible appropriately? Tried looking it up on the documentation but couldn’t find a clear answer for my problem. I am trying to plot an array as an imagesc plot. The array is full of non-zero numbers, but imagesc plots them as zero. I think the issue is with scaling, but I don’t know how to fix it. Screenshots attached to show what I mean. How do I scale my imagesc plot so that the numbers in the array are visible appropriately? Tried looking it up on the documentation but couldn’t find a clear answer for my problem. imagesc MATLAB Answers — New Questions
Kindly guide how to add the single edit field for each RLC like [0.01, …] and different time interval [10, 20, 30] in app designer and also the phase result on interfaces
Kindly guide how to add the single edit field for each RLC like [0.01, …] and different time interval [10, 20, 30] in app designerKindly guide how to add the single edit field for each RLC like [0.01, …] and different time interval [10, 20, 30] in app designer Kindly guide how to add the single edit field for each RLC like [0.01, …] and different time interval [10, 20, 30] in app designer appdesigner MATLAB Answers — New Questions
Index 3D Array with 2D logical array
I have an logical array B and an 3D array A. I wish to extract and manipulate values of A for specific , whereby the values in the first two dimensions are given by B. I was hoping something like
A(B,[1 3 5])
would give me the values specified by B for the first, third and fifth slice of A, but MATLAB doesn’t allow this kind of indexing.
In particular, I would like to switch values given by B for certain (excuse the fauly syntax) akin to
A(B,[1 3 5]) = A(B,[2 4 6])
A minimum example of what I would like to achieve would be:
% coordinate mesh
[X,Y] = meshgrid(1:n,1:m);
% logical array B
B = (X-n/4).^2 + (Y-m/2).^2 < m;
% 3d array A
A = zeros(m,n,9);
A(:,:,1:4) = 1;
A(:,:,5:8) = 2;
A(:,:,9) = 3;
% switching of slices (in fauly syntax)
A(B,[1 2 3 ] = A(B,[5 6 7])
A(B,[5 6 7 ] = A(B,[1 2 3])
I need to do this switching of specific values in the 3. dimension for different slices of A and have not been able to come up with an efficient way of doing this. Any help would be greatly appreciated!I have an logical array B and an 3D array A. I wish to extract and manipulate values of A for specific , whereby the values in the first two dimensions are given by B. I was hoping something like
A(B,[1 3 5])
would give me the values specified by B for the first, third and fifth slice of A, but MATLAB doesn’t allow this kind of indexing.
In particular, I would like to switch values given by B for certain (excuse the fauly syntax) akin to
A(B,[1 3 5]) = A(B,[2 4 6])
A minimum example of what I would like to achieve would be:
% coordinate mesh
[X,Y] = meshgrid(1:n,1:m);
% logical array B
B = (X-n/4).^2 + (Y-m/2).^2 < m;
% 3d array A
A = zeros(m,n,9);
A(:,:,1:4) = 1;
A(:,:,5:8) = 2;
A(:,:,9) = 3;
% switching of slices (in fauly syntax)
A(B,[1 2 3 ] = A(B,[5 6 7])
A(B,[5 6 7 ] = A(B,[1 2 3])
I need to do this switching of specific values in the 3. dimension for different slices of A and have not been able to come up with an efficient way of doing this. Any help would be greatly appreciated! I have an logical array B and an 3D array A. I wish to extract and manipulate values of A for specific , whereby the values in the first two dimensions are given by B. I was hoping something like
A(B,[1 3 5])
would give me the values specified by B for the first, third and fifth slice of A, but MATLAB doesn’t allow this kind of indexing.
In particular, I would like to switch values given by B for certain (excuse the fauly syntax) akin to
A(B,[1 3 5]) = A(B,[2 4 6])
A minimum example of what I would like to achieve would be:
% coordinate mesh
[X,Y] = meshgrid(1:n,1:m);
% logical array B
B = (X-n/4).^2 + (Y-m/2).^2 < m;
% 3d array A
A = zeros(m,n,9);
A(:,:,1:4) = 1;
A(:,:,5:8) = 2;
A(:,:,9) = 3;
% switching of slices (in fauly syntax)
A(B,[1 2 3 ] = A(B,[5 6 7])
A(B,[5 6 7 ] = A(B,[1 2 3])
I need to do this switching of specific values in the 3. dimension for different slices of A and have not been able to come up with an efficient way of doing this. Any help would be greatly appreciated! 3d, matrix array, indexing, index, sub2ind MATLAB Answers — New Questions
How do I change a chart legend’s marker size without affecting the main marker
How can I change the marker size in the legend of an Excel chart without affecting the main marker in the plot area? Sometimes it is necessary to have small plot markers which affect the legend’s markers size, which makes the legend unclear, as seen in the attached image.
Thanks.
How can I change the marker size in the legend of an Excel chart without affecting the main marker in the plot area? Sometimes it is necessary to have small plot markers which affect the legend’s markers size, which makes the legend unclear, as seen in the attached image.Thanks. Read More
Question: confidential calls
Hello!
Can someone please let me know if it is possible to disable Co-pilot for confidential calls?
Thank you!
Hello! Can someone please let me know if it is possible to disable Co-pilot for confidential calls? Thank you! Read More
SSRS – Pagination of two tables in a single page
Question :
we are facing an issue to achieve the pagination of data from two tables when these both tables are placed under single page. The requirement is to get the 12 rows from each table and show in the respective table of a page in SSRS report.
Current Result : Pagination of second table is not showing under the same page where the first table pagination rendered. Second page pagination is getting started only after the pagination for data of first table is completed. Overall the the pagination is happening sequential. But we need the pagination to happen parallel for both tables under the same page.
Any help is much appreciated in advance.
Expected : Pagination of first and second tables should be rendered in the same page across all the pages rendered as part of the pagination.
Question :we are facing an issue to achieve the pagination of data from two tables when these both tables are placed under single page. The requirement is to get the 12 rows from each table and show in the respective table of a page in SSRS report. Current Result : Pagination of second table is not showing under the same page where the first table pagination rendered. Second page pagination is getting started only after the pagination for data of first table is completed. Overall the the pagination is happening sequential. But we need the pagination to happen parallel for both tables under the same page. Any help is much appreciated in advance. Expected : Pagination of first and second tables should be rendered in the same page across all the pages rendered as part of the pagination. Read More
The .Net response code changed from a 201 to a 200 on all .Net framework versions from 4.8 and below
The .Net response code changed from a 201 to a 200 on all .Net framework versions from 4.8 and below which is very weird. I upgrade this to a .net core or higher version the status code returned is a 201.can someone please help me solve this mystery?
The .Net response code changed from a 201 to a 200 on all .Net framework versions from 4.8 and below which is very weird. I upgrade this to a .net core or higher version the status code returned is a 201.can someone please help me solve this mystery? Read More
Introducing Semantic Workbench: Your Gateway to Agentic AI Development
Introducing Semantic Workbench: Your Gateway to Agentic AI Development
In the rapidly evolving landscape of artificial intelligence (AI), the ability to quickly prototype and integrate intelligent assistants is becoming increasingly crucial. Whether you’re developing a new agent from scratch or integrating an existing one, having a versatile and user-friendly tool can make all the difference. Enter Semantic Workbench — a powerful tool designed to streamline the creation and management of intelligent agents.
The Semantic Workbench comes from our own efforts inside Microsoft to explore these ideas, it is a platform in active use. We decided to make this available as multiple teams inside Microsoft are finding value in it and we believe the broader community will as well. Separating it out as an independent project will enable teams that want to use this to add capabilities for their scenarios which will benefit everyone using it.
What is Semantic Workbench?
Semantic Workbench is a versatile tool designed to help you prototype intelligent agents quickly and efficiently. It supports the creation of new assistants or the integration of existing ones, all within a cohesive and intuitive interface. The workbench provides a user-friendly UI for creating conversations with one or more assistants, configuring settings, and exposing various behaviors.
Semantic Workbench is composed of three main components, each playing a crucial role in its functionality:
Workbench Service: The backend service that handles core functionalities, such as agents’ interaction, conversations, file uploads, authentication, and more.
Workbench App: The frontend web user interface that allows users to interact with the workbench and assistants seamlessly.
Agent Services: Any number of agent services that implement the workbench service protocol API, developed using any framework and programming language of your choice.
Why Use Semantic Workbench?
Simplified AI Agents Development
Writing a new agent and multi-agent solutions with Semantic Workbench is very simple. Developers can focus on the most important aspects, such as messaging, handling events, and executing commands. The integration with the workbench is a non-intrusive thin layer that can be removed when agents are ready for production, ensuring a smooth transition from development to deployment.
Versatility and Flexibility
Designed to be agnostic of any agent framework, language, or platform, Semantic Workbench facilitates experimentation, development, testing, and measurement of agent behaviors and workflows. This flexibility allows developers to integrate agents via a RESTful API, making it broadly applicable in various development environments. Agents can be written in any programming language and can interact with the user and each other via the Semantic Workbench web service.
User-Friendly Interface with Real-Time Insights and Debugging
Semantic Workbench provides a cohesive and intuitive interface for creating and managing conversations with intelligent assistants. This user-friendly UI simplifies the process of configuring settings and exposing various behaviors, making it accessible even to those who may not have extensive technical expertise. The interface allows users to chat with agents and offers other utilities to aid development, such as attaching debugging information to each message, including details about agent behavior, costs, and performance.
Agents can publish insights, called “states”, that are visible on side panels. These insights can be HTML/Markdown pages, allowing for the publication of complex information. Agents can update these insights in real-time, providing continuous feedback and debugging information. This feature is invaluable for developers looking to fine-tune agent behaviors and performance.
Customizable Configuration
Agents can have custom configuration settings, which are completely customizable. This includes text areas, radio buttons, checkboxes, and more, providing developers with the flexibility to tailor the settings to their specific needs. Agents can also expose configuration options such as prompts and temperature into assistant options making end user customization possible to improve iteration without having to update code.
File Management, Persistence and Cloning
The workbench also supports file management, allowing both users and agents to upload and manage files. This means AI agents can generate output as files that can be downloaded or shared with other agents, facilitating a more integrated and collaborative development environment.
Conversations and agents persist on disk, so you can develop an agent, restart it, and continue without losing state. Conversations can also be downloaded, making it easy to share demos and test results. Additionally, agents can be cloned to work with different configurations, allowing for parallel development and testing.
Conversation management
There are options within the conversation interface to delete messages from the conversation, as well as the option to rewind the conversation to a specific point which removes all the messages past that. You also have the option to add files to the conversation via a side panel or as part of a message. The side panel also provides you the option to export a conversation as markdown. There is an option to import past conversations from the dashboard screen as well.
The chat interface also informs you as to how many tokens your message is going to use.
Responses from generative assistants provide an info button which allows you to access the underlying messages that were sent to generate that response and examine details such as how many tokens were used.
Support for Multiple Users
The workbench supports multiple users. Conversations with assistants support multiple participants. Links to a conversation can be shared with other users to join. The workbench is configured by default to work with Microsoft organization or personal accounts.
Getting Started with Semantic Workbench
To get started with Semantic Workbench, you can follow these steps:
Clone the Repository: start by cloning the Semantic Workbench repository from GitHub at https://github.com/microsoft/semanticworkbench
Set Up the Workbench Service: Install and configure the backend service to handle core functionalities.
Launch the Workbench App: Use the frontend web interface to interact with the workbench and assistants.
Integrate your Agent Services: Develop and integrate agent services using any framework and programming language of your choice, following the service protocols/APIs. Agents can be developed with any editor, from VS Code and Visual Studio, to Rider, PyCharm, and any IDE.
You can get started even more quickly by opening the repository locally in VS Code, and letting it open the project as a dev container. In this mode all the required dependencies are provided automatically and there are launch configurations provided to start the Workbench Service and App. You can also open the repository directly in GitHub Codespaces for editing, please see this readme on an additional required step for running it in Codespaces.
Using the Semantic Workbench
On your first run of the Semantic Workbench, you’ll need to agree to the terms and sign in. This step is necessary even for local use because the workbench supports multiple users. Once signed in, you’ll be greeted by the Semantic Workbench dashboard.
The dashboard allows you to manage assistants. You can select an assistant from a dropdown menu if you’ve already created one or start a new one. Creating a new assistant involves selecting it from the dropdown and providing a name. The repository includes a Canonical Assistant that echoes input, which can be used as a starting point for your projects.
After saving your assistant you can select it and change any of its default setting if you like. Assistants can surface settings such as prompts, temperature, etc. here which makes it very convenient to iterate ideas without having to go back to code. This allows users who are not developers to experiment and provide feedback at earlier stages of development of generative assistants.
You can start a new conversation from either the assistant screen or the main dashboard. Opening a conversation lets you interact with your agent using a basic chat interface. You can see a response from the Echo assistant here:
If multiple assistants are involved, you can direct messages to a specific one using the “Directed to” box. The message box also reports how many tokens the message you are sending will use.
The side panel lets you see which participants across users and assistants are in the conversation. You can also download a transcript of the conversation to use it in other contexts. If there are files in the conversation they will be displayed here, and more can be added.
Explore the GitHub Repository
Semantic Workbench is publicly available on GitHub at https://github.com/microsoft/semanticworkbench. The repository contains some examples in Python and .NET, demonstrating how agents can be written in different languages. These examples also show how to leverage Azure AI Content Safety for responsible AI bots, how to render complex content types such as Mermaid graphs, Markdown, HTML, and more.
Semantic Workbench is a game-changer for anyone looking to prototype and integrate Agentic AI solutions quickly and efficiently. Its versatility, user-friendly interface, real-time insights, and seamless integration capabilities make it an invaluable tool in the AI development toolkit. Whether you’re a seasoned developer or just starting, Semantic Workbench provides the flexibility and functionality you need to bring your intelligent assistant projects to life.
Microsoft Tech Community – Latest Blogs –Read More
Solving with ode45 with a solution dependant variable in the ode
Hi,
Let’s say I want to solve :
with , with all following the same ode as y(z).
I can theoretically solve each ode with RK4 at step z+dz and then calculate N(z+dz). But how do I do it using the already implemented RK4 function implemented in Matlab? Would something like this work or is there a way better solution?
while(z<zLim)%%This is just an idea of the algorithm I would use
zspan=[0 dz];%Solving the ODE for a very small zspan
if(z~=0)
y0=y(length(y));
else
y0=0;
end
[z,y] = ode45(@(z,y) N*y, zspan, y0);
%Calculate c(z),g(z),….
%Calculate N at step dz
z=z+dz;
end
ThanksHi,
Let’s say I want to solve :
with , with all following the same ode as y(z).
I can theoretically solve each ode with RK4 at step z+dz and then calculate N(z+dz). But how do I do it using the already implemented RK4 function implemented in Matlab? Would something like this work or is there a way better solution?
while(z<zLim)%%This is just an idea of the algorithm I would use
zspan=[0 dz];%Solving the ODE for a very small zspan
if(z~=0)
y0=y(length(y));
else
y0=0;
end
[z,y] = ode45(@(z,y) N*y, zspan, y0);
%Calculate c(z),g(z),….
%Calculate N at step dz
z=z+dz;
end
Thanks Hi,
Let’s say I want to solve :
with , with all following the same ode as y(z).
I can theoretically solve each ode with RK4 at step z+dz and then calculate N(z+dz). But how do I do it using the already implemented RK4 function implemented in Matlab? Would something like this work or is there a way better solution?
while(z<zLim)%%This is just an idea of the algorithm I would use
zspan=[0 dz];%Solving the ODE for a very small zspan
if(z~=0)
y0=y(length(y));
else
y0=0;
end
[z,y] = ode45(@(z,y) N*y, zspan, y0);
%Calculate c(z),g(z),….
%Calculate N at step dz
z=z+dz;
end
Thanks ode45, ode MATLAB Answers — New Questions
How to use fitnlm
Hello I am trying to fit acurve to my data but I don’t know where to begin or what to do? Any help will be appretiated!
This is the graph and code of my data. I have attached the excel file of my data.
A=xlsread(‘Plague_data.xlsx’);
t=A(:,12);
c=A(:,13);
figure (1)
Number.of.cases=plot(t,c,’.’,’color’,’b’)Hello I am trying to fit acurve to my data but I don’t know where to begin or what to do? Any help will be appretiated!
This is the graph and code of my data. I have attached the excel file of my data.
A=xlsread(‘Plague_data.xlsx’);
t=A(:,12);
c=A(:,13);
figure (1)
Number.of.cases=plot(t,c,’.’,’color’,’b’) Hello I am trying to fit acurve to my data but I don’t know where to begin or what to do? Any help will be appretiated!
This is the graph and code of my data. I have attached the excel file of my data.
A=xlsread(‘Plague_data.xlsx’);
t=A(:,12);
c=A(:,13);
figure (1)
Number.of.cases=plot(t,c,’.’,’color’,’b’) nonlinear fit, nonlinear regression, covid-19, covid19 MATLAB Answers — New Questions
Help me generate better spectrogram data using Matlab?
Hi everyone
I am trying to generate spectrograms for .mat EEG files to show the breakdown of frequencies over time. I have got a series of spectrograms that look like this but I am not sure how to alter the code so they are more useful. My code currently is this:
% Set the directory containing .mat files
dataDir = ‘C:UsersclloyDownloadsspectrogram_data_to_use’;
% Get a list of all .mat files in the directory
matFiles = dir(fullfile(dataDir, ‘*.mat’));
% Electrode information (modify as per your electrode configuration)
electrodes = 1:32; % Assuming electrodes are labeled from 1 to 32
% Loop through each file and generate spectrograms for each electrode
for k = 1:length(matFiles)
% Load the .mat file
matFilePath = fullfile(dataDir, matFiles(k).name);
dataStruct = load(matFilePath);
% Extract the Clean_data variable
if isfield(dataStruct, ‘Clean_data’)
Clean_data = dataStruct.Clean_data;
% Sampling frequency (Hz)
fs = 128; % Sampling rate is 128 Hz
% Size of Clean_data
[numElectrodes, numSamples] = size(Clean_data);
% Loop through each electrode and generate spectrogram
for elecIdx = 1:numElectrodes
% Get data for current electrode
electrodeData = Clean_data(elecIdx, :);
% Generate spectrogram
figure;
spectrogram(electrodeData, 256, [], [], fs, ‘yaxis’);
% Add title and labels
title([‘Spectrogram of Electrode ‘, num2str(elecIdx), ‘ – File: ‘, matFiles(k).name]);
xlabel(‘Time (s)’);
ylabel(‘Frequency (Hz)’);
% Customize y-axis labels for electrodes
ax = gca;
ax.YTickLabel = compose(‘%.1f’, ax.YTick);
% Save the figure as an image file
saveas(gcf, fullfile(dataDir, [matFiles(k).name, ‘_electrode_’, num2str(elecIdx), ‘_spectrogram.png’]));
% Close the figure to avoid excessive memory usage
close(gcf);
end
else
warning(‘File %s does not contain the variable "Clean_data". Skipping…’, matFiles(k).name);
continue;
end
end
Please let me know if theres anything I can do to alter it and make the spectrograms better!Hi everyone
I am trying to generate spectrograms for .mat EEG files to show the breakdown of frequencies over time. I have got a series of spectrograms that look like this but I am not sure how to alter the code so they are more useful. My code currently is this:
% Set the directory containing .mat files
dataDir = ‘C:UsersclloyDownloadsspectrogram_data_to_use’;
% Get a list of all .mat files in the directory
matFiles = dir(fullfile(dataDir, ‘*.mat’));
% Electrode information (modify as per your electrode configuration)
electrodes = 1:32; % Assuming electrodes are labeled from 1 to 32
% Loop through each file and generate spectrograms for each electrode
for k = 1:length(matFiles)
% Load the .mat file
matFilePath = fullfile(dataDir, matFiles(k).name);
dataStruct = load(matFilePath);
% Extract the Clean_data variable
if isfield(dataStruct, ‘Clean_data’)
Clean_data = dataStruct.Clean_data;
% Sampling frequency (Hz)
fs = 128; % Sampling rate is 128 Hz
% Size of Clean_data
[numElectrodes, numSamples] = size(Clean_data);
% Loop through each electrode and generate spectrogram
for elecIdx = 1:numElectrodes
% Get data for current electrode
electrodeData = Clean_data(elecIdx, :);
% Generate spectrogram
figure;
spectrogram(electrodeData, 256, [], [], fs, ‘yaxis’);
% Add title and labels
title([‘Spectrogram of Electrode ‘, num2str(elecIdx), ‘ – File: ‘, matFiles(k).name]);
xlabel(‘Time (s)’);
ylabel(‘Frequency (Hz)’);
% Customize y-axis labels for electrodes
ax = gca;
ax.YTickLabel = compose(‘%.1f’, ax.YTick);
% Save the figure as an image file
saveas(gcf, fullfile(dataDir, [matFiles(k).name, ‘_electrode_’, num2str(elecIdx), ‘_spectrogram.png’]));
% Close the figure to avoid excessive memory usage
close(gcf);
end
else
warning(‘File %s does not contain the variable "Clean_data". Skipping…’, matFiles(k).name);
continue;
end
end
Please let me know if theres anything I can do to alter it and make the spectrograms better! Hi everyone
I am trying to generate spectrograms for .mat EEG files to show the breakdown of frequencies over time. I have got a series of spectrograms that look like this but I am not sure how to alter the code so they are more useful. My code currently is this:
% Set the directory containing .mat files
dataDir = ‘C:UsersclloyDownloadsspectrogram_data_to_use’;
% Get a list of all .mat files in the directory
matFiles = dir(fullfile(dataDir, ‘*.mat’));
% Electrode information (modify as per your electrode configuration)
electrodes = 1:32; % Assuming electrodes are labeled from 1 to 32
% Loop through each file and generate spectrograms for each electrode
for k = 1:length(matFiles)
% Load the .mat file
matFilePath = fullfile(dataDir, matFiles(k).name);
dataStruct = load(matFilePath);
% Extract the Clean_data variable
if isfield(dataStruct, ‘Clean_data’)
Clean_data = dataStruct.Clean_data;
% Sampling frequency (Hz)
fs = 128; % Sampling rate is 128 Hz
% Size of Clean_data
[numElectrodes, numSamples] = size(Clean_data);
% Loop through each electrode and generate spectrogram
for elecIdx = 1:numElectrodes
% Get data for current electrode
electrodeData = Clean_data(elecIdx, :);
% Generate spectrogram
figure;
spectrogram(electrodeData, 256, [], [], fs, ‘yaxis’);
% Add title and labels
title([‘Spectrogram of Electrode ‘, num2str(elecIdx), ‘ – File: ‘, matFiles(k).name]);
xlabel(‘Time (s)’);
ylabel(‘Frequency (Hz)’);
% Customize y-axis labels for electrodes
ax = gca;
ax.YTickLabel = compose(‘%.1f’, ax.YTick);
% Save the figure as an image file
saveas(gcf, fullfile(dataDir, [matFiles(k).name, ‘_electrode_’, num2str(elecIdx), ‘_spectrogram.png’]));
% Close the figure to avoid excessive memory usage
close(gcf);
end
else
warning(‘File %s does not contain the variable "Clean_data". Skipping…’, matFiles(k).name);
continue;
end
end
Please let me know if theres anything I can do to alter it and make the spectrograms better! spectrograms eeg MATLAB Answers — New Questions
HOW DO I MAKE A FUNCTION THAT CHANGES MY FORCE VS. TIME GRAPH TO FORCE VS. POSITION
Hello, I plotted a graph that gave me force vs. position but I need to make it so it gives me force vs. time but I am not sure on how to convert the time. I am given the sample rate which is 20 samples per second and the crosspeed is 15 inches per minute. but if the sample rate fluctuates, how can I obtain the actual distance ? I hope this makes sense, anything helps
files = [
"Test 22 Sensor.txt" "Test 22 Instron.TXT";
%%"Test 17 Sensor.txt" "Test 17 Instron.TXT";
];
Valueshift=12.53-6.18;
% value that is adjusted in case the final cross value is not
% correct and the graphs do not match up
SampleRate=10;
% sample rate of the Instron machine
NamedGraphTitle=["2022.03.16 Test 22, .012in Uncoated, 7000lbs, 15in per min"];
TimeendX=20;
%the last value for the axis
% Import the data
for k=1:size(files)
TestSensor = readtable(files(k,1),opts);
TestInstron = readtable(files(k,2),opts_instron);
% transfer the table data to the array
sensor_data = table2array(TestSensor(2:height(TestSensor)-2,:));
instron_data = table2array(TestInstron(2:height(TestInstron),:));
% Plotting
%Pulling Force
plot(sensor_data_shift.*mask,sensor_data(:,3).*mask,’LineWidth’,1.5,’Color’,[0.267, 0.447, 0.769])% RGB Blue 68, 114, 196
hold on
%Normal Force
plot(instron_data(:,1)/SampleRate+gap,instron_data(:,3),’LineWidth’,1.5,’Color’,[0.929, 0.490, 0.192])% RGB Orange 237, 125, 49
%Friction
% RGB Grey 165, 165, 165
legend(‘Normal Force’,’Pulling Force’,’Friction*1000′)
grid on
title(NamedGraphTitle)
xlabel(‘Time(s)’)
ylabel(‘Force (lbs)’)
axis([16.5,TimeendX,0,7500])
hold off
endHello, I plotted a graph that gave me force vs. position but I need to make it so it gives me force vs. time but I am not sure on how to convert the time. I am given the sample rate which is 20 samples per second and the crosspeed is 15 inches per minute. but if the sample rate fluctuates, how can I obtain the actual distance ? I hope this makes sense, anything helps
files = [
"Test 22 Sensor.txt" "Test 22 Instron.TXT";
%%"Test 17 Sensor.txt" "Test 17 Instron.TXT";
];
Valueshift=12.53-6.18;
% value that is adjusted in case the final cross value is not
% correct and the graphs do not match up
SampleRate=10;
% sample rate of the Instron machine
NamedGraphTitle=["2022.03.16 Test 22, .012in Uncoated, 7000lbs, 15in per min"];
TimeendX=20;
%the last value for the axis
% Import the data
for k=1:size(files)
TestSensor = readtable(files(k,1),opts);
TestInstron = readtable(files(k,2),opts_instron);
% transfer the table data to the array
sensor_data = table2array(TestSensor(2:height(TestSensor)-2,:));
instron_data = table2array(TestInstron(2:height(TestInstron),:));
% Plotting
%Pulling Force
plot(sensor_data_shift.*mask,sensor_data(:,3).*mask,’LineWidth’,1.5,’Color’,[0.267, 0.447, 0.769])% RGB Blue 68, 114, 196
hold on
%Normal Force
plot(instron_data(:,1)/SampleRate+gap,instron_data(:,3),’LineWidth’,1.5,’Color’,[0.929, 0.490, 0.192])% RGB Orange 237, 125, 49
%Friction
% RGB Grey 165, 165, 165
legend(‘Normal Force’,’Pulling Force’,’Friction*1000′)
grid on
title(NamedGraphTitle)
xlabel(‘Time(s)’)
ylabel(‘Force (lbs)’)
axis([16.5,TimeendX,0,7500])
hold off
end Hello, I plotted a graph that gave me force vs. position but I need to make it so it gives me force vs. time but I am not sure on how to convert the time. I am given the sample rate which is 20 samples per second and the crosspeed is 15 inches per minute. but if the sample rate fluctuates, how can I obtain the actual distance ? I hope this makes sense, anything helps
files = [
"Test 22 Sensor.txt" "Test 22 Instron.TXT";
%%"Test 17 Sensor.txt" "Test 17 Instron.TXT";
];
Valueshift=12.53-6.18;
% value that is adjusted in case the final cross value is not
% correct and the graphs do not match up
SampleRate=10;
% sample rate of the Instron machine
NamedGraphTitle=["2022.03.16 Test 22, .012in Uncoated, 7000lbs, 15in per min"];
TimeendX=20;
%the last value for the axis
% Import the data
for k=1:size(files)
TestSensor = readtable(files(k,1),opts);
TestInstron = readtable(files(k,2),opts_instron);
% transfer the table data to the array
sensor_data = table2array(TestSensor(2:height(TestSensor)-2,:));
instron_data = table2array(TestInstron(2:height(TestInstron),:));
% Plotting
%Pulling Force
plot(sensor_data_shift.*mask,sensor_data(:,3).*mask,’LineWidth’,1.5,’Color’,[0.267, 0.447, 0.769])% RGB Blue 68, 114, 196
hold on
%Normal Force
plot(instron_data(:,1)/SampleRate+gap,instron_data(:,3),’LineWidth’,1.5,’Color’,[0.929, 0.490, 0.192])% RGB Orange 237, 125, 49
%Friction
% RGB Grey 165, 165, 165
legend(‘Normal Force’,’Pulling Force’,’Friction*1000′)
grid on
title(NamedGraphTitle)
xlabel(‘Time(s)’)
ylabel(‘Force (lbs)’)
axis([16.5,TimeendX,0,7500])
hold off
end plotting, convert, speed, time MATLAB Answers — New Questions
I want to segment an apple fruit image and i’m using histogram’s method but when i’m using the function: n=hist(reshape(double(rgb(:,:,i)),[480*640 1]),0.5:256); i have this error: To RESHAPE the number of elements must not change.
% load image (colorful fabric acquired with frame grabber and camera)
rgb = imread(‘7.png’); % Matrox frame grabber + Pulnix camera
imshow(rgb)
% explore color content using image viewer
imshow(rgb)
% smooth image (reduce noise/color variation)
rgb = imfilter(rgb,ones(3,3)/9);
imshow(rgb)
% view image and RGB layers (nonuniform illumination)
figure(1), set(1,’position’,[99 79 826 589])
subplot(2,2,1), subimage(rgb), title(‘fabric image’), axis off
subplot(2,2,2), map=gray(256); map(:,2:3)=0; subimage(rgb(:,:,1),map), title(‘red layer’), axis off
subplot(2,2,3), map=gray(256); map(:,[1 3])=0; subimage(rgb(:,:,2),map), title(‘green layer’), axis off
subplot(2,2,4), map=gray(256); map(:,1:2)=0; subimage(rgb(:,:,3),map), title(‘blue layer’), axis off
% RGB histograms (poor separability)
figure(1), set(1,’position’,[452 68 560 420])
figure(2), set(2,’position’,[16 269 560 420])
c=’rgb’;
for i=1:3
n=hist(reshape(double(rgb(:,:,i)),[480*640 1]),0.5:256);
line(0:255,n,’color’,c(i))
end% load image (colorful fabric acquired with frame grabber and camera)
rgb = imread(‘7.png’); % Matrox frame grabber + Pulnix camera
imshow(rgb)
% explore color content using image viewer
imshow(rgb)
% smooth image (reduce noise/color variation)
rgb = imfilter(rgb,ones(3,3)/9);
imshow(rgb)
% view image and RGB layers (nonuniform illumination)
figure(1), set(1,’position’,[99 79 826 589])
subplot(2,2,1), subimage(rgb), title(‘fabric image’), axis off
subplot(2,2,2), map=gray(256); map(:,2:3)=0; subimage(rgb(:,:,1),map), title(‘red layer’), axis off
subplot(2,2,3), map=gray(256); map(:,[1 3])=0; subimage(rgb(:,:,2),map), title(‘green layer’), axis off
subplot(2,2,4), map=gray(256); map(:,1:2)=0; subimage(rgb(:,:,3),map), title(‘blue layer’), axis off
% RGB histograms (poor separability)
figure(1), set(1,’position’,[452 68 560 420])
figure(2), set(2,’position’,[16 269 560 420])
c=’rgb’;
for i=1:3
n=hist(reshape(double(rgb(:,:,i)),[480*640 1]),0.5:256);
line(0:255,n,’color’,c(i))
end % load image (colorful fabric acquired with frame grabber and camera)
rgb = imread(‘7.png’); % Matrox frame grabber + Pulnix camera
imshow(rgb)
% explore color content using image viewer
imshow(rgb)
% smooth image (reduce noise/color variation)
rgb = imfilter(rgb,ones(3,3)/9);
imshow(rgb)
% view image and RGB layers (nonuniform illumination)
figure(1), set(1,’position’,[99 79 826 589])
subplot(2,2,1), subimage(rgb), title(‘fabric image’), axis off
subplot(2,2,2), map=gray(256); map(:,2:3)=0; subimage(rgb(:,:,1),map), title(‘red layer’), axis off
subplot(2,2,3), map=gray(256); map(:,[1 3])=0; subimage(rgb(:,:,2),map), title(‘green layer’), axis off
subplot(2,2,4), map=gray(256); map(:,1:2)=0; subimage(rgb(:,:,3),map), title(‘blue layer’), axis off
% RGB histograms (poor separability)
figure(1), set(1,’position’,[452 68 560 420])
figure(2), set(2,’position’,[16 269 560 420])
c=’rgb’;
for i=1:3
n=hist(reshape(double(rgb(:,:,i)),[480*640 1]),0.5:256);
line(0:255,n,’color’,c(i))
end color image segmentation for apple fruit MATLAB Answers — New Questions
How to Automate KB5040434 Installation on Multiple VMs?
Hey everyone,
I need to install the KB5040434 update on a bunch of VMs. This update is super important because it fixes several vulnerabilities. Doing this one by one is a huge hassle, and each VM also needs a restart after the update.
Is there a way to automate this process? Maybe using Azure Cloud Shell, an automation account, or some other Azure feature? Any tips or guides would be really helpful.
Thanks in advance!
Hey everyone,I need to install the KB5040434 update on a bunch of VMs. This update is super important because it fixes several vulnerabilities. Doing this one by one is a huge hassle, and each VM also needs a restart after the update.Is there a way to automate this process? Maybe using Azure Cloud Shell, an automation account, or some other Azure feature? Any tips or guides would be really helpful.Thanks in advance! Read More