Month: September 2025
Flexible work update
Amy Coleman, Executive Vice President and Chief People Officer, shared the below communication with Microsoft employees this morning.
How we work has forever changed. I remember starting at Microsoft in the late ‘90s, always in the office, no laptops, and primarily working with the people right down the hall. As technology evolved and our business expanded, we became more open, more global, and able to scale in ways we couldn’t have imagined. Then the pandemic reshaped everything. It pushed us to think differently about work, to connect like never before (thank you Teams!), reminded us of how much we value being together, and gave us focus and autonomy in the traditional workday. We’re not going back, and we shouldn’t. Instead, we should take the best of what we’ve learned and move forward.
In the AI era, we are moving faster than ever, building world-class technology that changes how people live and work, and how organizations everywhere operate. If you reflect on our history, the most meaningful breakthroughs happen when we build on each other’s ideas together, in real time.
We’ve looked at how our teams work best, and the data is clear: when people work together in person more often, they thrive — they are more energized, empowered, and they deliver stronger results. As we build the AI products that will define this era, we need the kind of energy and momentum that comes from smart people working side by side, solving challenging problems together.
With that in mind, we’re updating our flexible work expectations to three days a week in the office.
We’ll roll this out in three phases: 1) starting in Puget Sound at the end of February; 2) expanding to other US locations; 3) then launching outside the US.
Our goal with this change is to provide more clarity and consistency in how we come together, while maintaining the flexibility we know you value. We want you to continue to shape your schedule in ways that work best for you, making in-person time intentional and impactful. Importantly, this update is not about reducing headcount. It’s about working together in a way that enables us to meet our customers’ needs.
For some of you, this is not a change. For others this may be a bigger adjustment, which is exactly why we’re providing time to plan thoughtfully. As part of these updates, we’re also enhancing our workplace safety and security measures so we can continue to provide a workplace where every employee can do their best work.
What you need to know:
Puget Sound-area employees: If you live within 50 miles of a Microsoft office, you’ll be expected to work onsite three days a week by the end of February 2026. You’ll receive a personalized email today with more details. Please connect with your manager and team to understand your organization’s plans. If needed, you can request an exception by Friday, September 19.
Managers: You’ll find actions to take, and the resources to support both you and your team on the Managers@Microsoft SharePoint.
All employees: You’ll hear from your EVP or organizational leadership today with specific guidance. Each business will do what is best for their team, which means some groups will deviate from our company-wide expectations. If you are outside of the Puget Sound area, you do not need to take any action at this time unless your EVP communicates otherwise.
Timelines and details for additional US office locations will be announced soon. For employees outside the United States, we will begin planning in 2026. More information is available on the Flexible Work at Microsoft SharePoint.
As always, we’ll keep learning together to ensure Microsoft is the best place for you to grow and have a great career. Let’s keep moving forward together.
Thank you,
Amy
The post Flexible work update appeared first on The Official Microsoft Blog.
Amy Coleman, Executive Vice President and Chief People Officer, shared the below communication with Microsoft employees this morning. How we work has forever changed. I remember starting at Microsoft in the late ‘90s, always in the office, no laptops, and primarily working with the people right down the hall. As technology evolved and our business expanded, we became…
The post Flexible work update appeared first on The Official Microsoft Blog.Read More
Identify exact jittered point from swarmchart plot
I created a horizontal swarmchart in app designer. The input data have numeric values and grouping tags (intGroups) associated with each point. Each point’s color is associated with its group. I also defined a ButtonDownFcn to get the point that the user clicks on (using code from a previous Matlab Answer).
The issue is that when I click a point, swarmchart’s XData and YData give the undithered coordinates (i.e., the y-values are all the same). So if I click a point that is far from center (due to a lot of points having that same value), the code below may or may not identify that point I clicked, so I may not get the correct group.
Is there a way to ensure that I get the exact point I clicked (or its index in the vector), not others that are in the same vicinity?
for zz = 1:length(intVarsUnique)
hPlot = swarmchart(axPlot, xData(:, zz), intVars(:, zz), [], categorical(strGroupColors), ‘filled’, ‘o’, …
‘YJitter’,’density’, …
‘HitTest’, ‘on’, ‘ButtonDownFcn’, @(src, eventData) fcnPlot_ButtonDown(app, src, eventData));
if ~ishold(axPlot)
hold(axPlot, ‘on’);
end
end % zz
hold(axPlot, ‘off’);
function fcnPlot_ButtonDown(app, hPlot, eventData)
% Based on code from Yair Altman in https://www.mathworks.com/matlabcentral/answers/1903190-get-data-point-that-was-clicked-on-in-graph
% Get the click coordinates from the click event data
x = eventData.IntersectionPoint(1);
y = eventData.IntersectionPoint(2);
line_xs = hPlot.XData;
line_ys = hPlot.YData;
dist2 = (x-line_xs).^2 + (y-line_ys).^2;
[~,min_idx] = min(dist2);
closest_x = line_xs(min_idx);
closest_y = line_ys(min_idx);
msgbox(sprintf(‘Clicked on: (%g,%g)nClosest pt: (%g,%g)’, x, y, closest_x, closest_y));
% Code to locate point in vector and ID group…
endI created a horizontal swarmchart in app designer. The input data have numeric values and grouping tags (intGroups) associated with each point. Each point’s color is associated with its group. I also defined a ButtonDownFcn to get the point that the user clicks on (using code from a previous Matlab Answer).
The issue is that when I click a point, swarmchart’s XData and YData give the undithered coordinates (i.e., the y-values are all the same). So if I click a point that is far from center (due to a lot of points having that same value), the code below may or may not identify that point I clicked, so I may not get the correct group.
Is there a way to ensure that I get the exact point I clicked (or its index in the vector), not others that are in the same vicinity?
for zz = 1:length(intVarsUnique)
hPlot = swarmchart(axPlot, xData(:, zz), intVars(:, zz), [], categorical(strGroupColors), ‘filled’, ‘o’, …
‘YJitter’,’density’, …
‘HitTest’, ‘on’, ‘ButtonDownFcn’, @(src, eventData) fcnPlot_ButtonDown(app, src, eventData));
if ~ishold(axPlot)
hold(axPlot, ‘on’);
end
end % zz
hold(axPlot, ‘off’);
function fcnPlot_ButtonDown(app, hPlot, eventData)
% Based on code from Yair Altman in https://www.mathworks.com/matlabcentral/answers/1903190-get-data-point-that-was-clicked-on-in-graph
% Get the click coordinates from the click event data
x = eventData.IntersectionPoint(1);
y = eventData.IntersectionPoint(2);
line_xs = hPlot.XData;
line_ys = hPlot.YData;
dist2 = (x-line_xs).^2 + (y-line_ys).^2;
[~,min_idx] = min(dist2);
closest_x = line_xs(min_idx);
closest_y = line_ys(min_idx);
msgbox(sprintf(‘Clicked on: (%g,%g)nClosest pt: (%g,%g)’, x, y, closest_x, closest_y));
% Code to locate point in vector and ID group…
end I created a horizontal swarmchart in app designer. The input data have numeric values and grouping tags (intGroups) associated with each point. Each point’s color is associated with its group. I also defined a ButtonDownFcn to get the point that the user clicks on (using code from a previous Matlab Answer).
The issue is that when I click a point, swarmchart’s XData and YData give the undithered coordinates (i.e., the y-values are all the same). So if I click a point that is far from center (due to a lot of points having that same value), the code below may or may not identify that point I clicked, so I may not get the correct group.
Is there a way to ensure that I get the exact point I clicked (or its index in the vector), not others that are in the same vicinity?
for zz = 1:length(intVarsUnique)
hPlot = swarmchart(axPlot, xData(:, zz), intVars(:, zz), [], categorical(strGroupColors), ‘filled’, ‘o’, …
‘YJitter’,’density’, …
‘HitTest’, ‘on’, ‘ButtonDownFcn’, @(src, eventData) fcnPlot_ButtonDown(app, src, eventData));
if ~ishold(axPlot)
hold(axPlot, ‘on’);
end
end % zz
hold(axPlot, ‘off’);
function fcnPlot_ButtonDown(app, hPlot, eventData)
% Based on code from Yair Altman in https://www.mathworks.com/matlabcentral/answers/1903190-get-data-point-that-was-clicked-on-in-graph
% Get the click coordinates from the click event data
x = eventData.IntersectionPoint(1);
y = eventData.IntersectionPoint(2);
line_xs = hPlot.XData;
line_ys = hPlot.YData;
dist2 = (x-line_xs).^2 + (y-line_ys).^2;
[~,min_idx] = min(dist2);
closest_x = line_xs(min_idx);
closest_y = line_ys(min_idx);
msgbox(sprintf(‘Clicked on: (%g,%g)nClosest pt: (%g,%g)’, x, y, closest_x, closest_y));
% Code to locate point in vector and ID group…
end matlab, swarmchart, appdesigner, undocumented MATLAB Answers — New Questions
Default button of “questdlg” not working in 2025a
answer = questdlg(quest,dlgtitle,btn1,btn2,btn3,defbtn)
When the dialogue box is opened, the default button is selected, but pressing ENTER won’t click the button, and pressing ESC won’t close the dialogue box.answer = questdlg(quest,dlgtitle,btn1,btn2,btn3,defbtn)
When the dialogue box is opened, the default button is selected, but pressing ENTER won’t click the button, and pressing ESC won’t close the dialogue box. answer = questdlg(quest,dlgtitle,btn1,btn2,btn3,defbtn)
When the dialogue box is opened, the default button is selected, but pressing ENTER won’t click the button, and pressing ESC won’t close the dialogue box. matlab gui, nevermind – works now MATLAB Answers — New Questions
Microsoft’s Push to Save Office Files in the Cloud
New Policy Setting to Force Office to Save to Cloud Locations
Announced in Microsoft 365 message notification MC1137593 on 18 August 2025, Microsoft is introducing a new policy setting to force the creation (saving) of Office files in cloud locations. The setting only applies to Word, Excel, and PowerPoint files saved using the Microsoft 365 enterprise apps (subscription version of Office). No other Office version is affected.
Cloud locations means SharePoint Online, OneDrive for Business, and third-party cloud storage services like Dropbox or ShareFile (if the feature is enabled for the Microsoft 365 tenant).
The new policy enablecloudonlysaveasmode setting can be deployed to clients using Group policies or registry updates. The setting is available in the Administrative Template files for Microsoft Office (version 5516.1000 or newer) and applies to the Windows versions of the Microsoft 365 enterprise apps version 2506 (build 19029.2000) or later. I checked the feature using version 2508 (build 19127.20192) (Current Channel Preview).
MC1137593 says that public preview started to roll out in late August 2025 and is scheduled to complete by mid-September 2025. General availability for all clouds will start in mid-September 2025 and should be available everywhere by the end of September 2025. If you don’t take steps to apply the policy setting, nothing changes.
Higher Cloud Usage
Microsoft says that the new policy is “part of a new set of tools for IT Administrators to move their organizations towards higher Cloud usage and Increase security and compliance.” Increasing cloud usage adds stickiness to the Microsoft cloud because the more data that users store in SharePoint Online and OneDrive for Business, the harder it is to move to any other platform.
The point about increasing security and compliance is justified by the fact that SharePoint Online and OneDrive for Business are subject to the tenant’s security and compliance policies. It’s true that cloud files are more resilient than files stored on a local drive and it is very convenient to be able to move from PC to PC while keeping files available. However, everything depends on the network and if the network’s not available or you don’t want to use a potentially insecure network like free wi-fi, losing the ability to save files to the local drive can be a real pain. I often save copies of Offices files as PDFs to share with other people, and I don’t really want those PDFs cluttering up OneDrive.
Microsoft sometimes goes overboard in its enthusiasm to save files in OneDrive, like PowerShell modules. Some might consider this step to be in that category.
What Users See
The default situation is shown in Figure 1. No policy is configured, and the user can save to SharePoint Online, OneDrive for Business, the local hard drive, and other cloud services (configured through Add a Place).

With the policy setting enabled, Office applications are limited to cloud locations to save new files or save existing files as a new file (Figure 2). Note that the “This PC” and “Browse” (for folder) options are missing.

Updating Office with the Microsoft 365 Apps Policy
Microsoft 365 tenants can apply the setting to restrict saving to the cloud via a cloud policy configured in the Microsoft 365 Apps center. Search for the Restrict saving on non-cloud locations setting and change the value from not configured to enabled (Figure 3).

After saving the policy, its settings are applied by the click to run service and the new setting should be active within a day.
Like most Office settings, the change can be made manually by updating the system registry on a PC. In this case, it seems like the setting is controlled by two settings. The first enables the cloud only save mode by creating a new DWORD value called EnableCloudOnlySaveAsMode at HKEY_CURRENT_USERSOFTWAREMicrosoftOffice16.0CommonFileIO. The second apparently removes the UI options for non-cloud locations through another DWORD value called PreferCloudSaveLocations at HKEY_CURRENT_USERSoftwareMicrosoftOffice16.0CommonGeneral. Both values are set to 1 to enable or 0 to disable. When I tested, the settings worked on one PC and not on another. It took too long to figure out that the PC where things worked ran Current Channel (Preview) while the one where the feature didn’t work ran Current Channel.
A Change That Might Annoy Some
Some will hate this change and ask what’s the point of having a local drive if it’s inaccessible. Others might not notice that all files are stored in the cloud because they do that as the norm. And some will only notice the change when they go to save a file locally. I save most of what I do with Word, Excel, and PowerPoint in the cloud, so I guess that I’m in the last category.
If I was forced to live with storing all Office files in the cloud, I could adapt my workflow without much difficulty. Until a network outage occurs…

Support the work of the Office 365 for IT Pros team by subscribing to the Office 365 for IT Pros eBook. Your support pays for the time we need to track, analyze, and document the changing world of Microsoft 365 and Office 365. Only humans contribute to our work!
start app by doubleclicking mat-file with custom extension
An application which was greated using GUIDE can save *.mat files with a cusom extension, like *.MyExtension. What I want is, that I doubleclick in the windows explorer such a file, which will:
1. open my application (probably some settings in windows)
2. pass the file path to the application, so that the data can be loaded. Can someone help me on this?An application which was greated using GUIDE can save *.mat files with a cusom extension, like *.MyExtension. What I want is, that I doubleclick in the windows explorer such a file, which will:
1. open my application (probably some settings in windows)
2. pass the file path to the application, so that the data can be loaded. Can someone help me on this? An application which was greated using GUIDE can save *.mat files with a cusom extension, like *.MyExtension. What I want is, that I doubleclick in the windows explorer such a file, which will:
1. open my application (probably some settings in windows)
2. pass the file path to the application, so that the data can be loaded. Can someone help me on this? load file in application MATLAB Answers — New Questions
Performing 2D convolution
Hello,
I am new to image processing and had a conceptual question. I am currently trying to perform a 2D convolution of an image and a kernel (filter) in simulink using the 2D convolution block. I have code that transposes the image, then flips it, then performs the 2D convolution with the kernel. However from my (very limited) understanding convolution already flips the filter that I want to apply. I was told that the output of me transposing and flipping the image, then convolving with the kernel looks correct, however from my understanding I would be transposing and flipping the image once then convolving, which involves another flip, so therefore not actually convolving? I have read that this would just produce instead a correlation?
Hoping someone who knows more may be able to help give me a better understanding.
Thank you!Hello,
I am new to image processing and had a conceptual question. I am currently trying to perform a 2D convolution of an image and a kernel (filter) in simulink using the 2D convolution block. I have code that transposes the image, then flips it, then performs the 2D convolution with the kernel. However from my (very limited) understanding convolution already flips the filter that I want to apply. I was told that the output of me transposing and flipping the image, then convolving with the kernel looks correct, however from my understanding I would be transposing and flipping the image once then convolving, which involves another flip, so therefore not actually convolving? I have read that this would just produce instead a correlation?
Hoping someone who knows more may be able to help give me a better understanding.
Thank you! Hello,
I am new to image processing and had a conceptual question. I am currently trying to perform a 2D convolution of an image and a kernel (filter) in simulink using the 2D convolution block. I have code that transposes the image, then flips it, then performs the 2D convolution with the kernel. However from my (very limited) understanding convolution already flips the filter that I want to apply. I was told that the output of me transposing and flipping the image, then convolving with the kernel looks correct, however from my understanding I would be transposing and flipping the image once then convolving, which involves another flip, so therefore not actually convolving? I have read that this would just produce instead a correlation?
Hoping someone who knows more may be able to help give me a better understanding.
Thank you! convolution, simulink, image processing MATLAB Answers — New Questions
Problem on startup. MacMini M4, Sequoia 15.6.1
On starup I get this meggage:
Ubable yo communicate with required MathWorks services (error 201)
Any ideas?On starup I get this meggage:
Ubable yo communicate with required MathWorks services (error 201)
Any ideas? On starup I get this meggage:
Ubable yo communicate with required MathWorks services (error 201)
Any ideas? jon’s q MATLAB Answers — New Questions
Microsoft Bolts on Copilot License Check onto ExRCA
Hard to Find Logic for Copilot License Check in Exchange Connectivity Tool
Unless you’re a keen reader of the Microsoft blogs posted to the Microsoft Technical community, you might have missed the August 25 article about a new diagnostic tool for a “Copilot License Details Check.” According to the text, it’s “a powerful tool designed to streamline and validate your license readiness by confirming whether Copilot for Microsoft 365 licenses are properly assigned to users.” In reality, it’s some Graph API requests cobbled together to report details of a Microsoft 365 Copilot license assignment to a user account that’s been bolted onto the side of the Exchange Remote Connectivity Analyzer (ExRCA).
As I explain in another article, ExRCA started as a troubleshooting tool to help Exchange on-premises administrators debug connectivity problems with protocols like Autodiscover and ActiveSync (check out the YouTube video from that time). Later, Microsoft upgraded ExRCA to support Exchange Online and Teams. At this point, it’s fair to say that ExRCA is an invaluable tool for Microsoft 365 tenant administrators.
However, having a valuable support tool is no reason to bolt on a license checker. I’m sure Microsoft will point to the inclusion of the message header analyzer tool in ExRCA as evidence that ExRCA has become a toolbox, but that’s missing the point that the message header tool is at least associated with a messaging protocol (SMTP) whereas the Copilot license check is a barefaced attempt to help people use more Copilot features.
Running a Copilot License Check
Running a Copilot license check is very simple. Input the user principal name or primary SMTP address of a user account, sign in as an administrator with permissions to access user account details, and the code runs to verify that the account has a Microsoft 365 Copilot license with all its service plans intact (Figure 1).

A Simple Check
Stripping everything away, the license check is very simple and the results that it generates are equally simple (no expensive CPU cycles for AI analysis are burned here). Figure 2 shows that the user being checked is good to go. I’m sure that this is deemed to be a successful test.

But some issues exist. First, the test doesn’t distinguish between direct-assigned licenses and group-assigned licenses, which is valuable information for an administrator to know if they want to address a problem highlighted by the test. Second, the test only considers a “full” Microsoft 365 Copilot license to be valid. Trial licenses are not considered valid. Third, disabling some Copilot features is a perfectly reasonable thing to do. Not everyone needs to create new agents through Copilot Studio, for example.
PowerShell Code for the Copilot License Check
To show what the ExRCA Copilot check does, I recreated the check using the Microsoft Graph PowerShell SDK. The code is simple and took about an hour to write (including testing):
- Sign into the Graph with Connect-MgGraph using an administrator account.
- Prompt for a user account and validate that the account exists.
- Check that the account has a valid Microsoft 365 Copilot license (including trial licenses). License and service plan information is available online.
- Run the Get-MgUserLicenseDetail cmdlet to retrieve service plan information for the Copilot SKU.
- Check each of the service plans defined in the license to report if it is enabled or disabled.
Figure 3 shows some sample output.

You can download the script from the Office 365 for IT Pros GitHub repository.
No Reason to Use ExRCA to Check License Details
I don’t know how many Microsoft 365 tenant administrators will seek out ExRCA to answer questions like “I wonder if the Copilot license assigned to John Doe is good to go?” It seems like an unnatural reaction to consider ExRCA in that light when it’s straightforward to build your own tools to measure user readiness for Copilot or analyze and report licenses assigned to user accounts (including disabled service plans).
The idea might be a good one, but I fear it’s implemented in the wrong place and is too limited to deliver much value.
Need some assistance to write and manage PowerShell scripts for Microsoft 365, including Azure Automation runbooks? Get a copy of the Automating Microsoft 365 with PowerShell eBook, available standalone or as part of the Office 365 for IT Pros eBook bundle.
Why am I not getting printed all zones and info from one column in my table?
Here are the steps that lead to the results:
1) You start by running app2_tester that leads to app3_tester ( for making the problem simpler, I have just made it possible choosing just one combination of salts, NaCl KCl and ZnBr2: so that I don’t need to attach many function files, though there are listed up many salts in the listbox of app3_tester.
2) Each time you have pressed the choices for every zone, you press the button “done with the zone”, for instance when you in start have chosen that there are two zones, you first begin to selecting information for zone1 then do the same for zone 2
3) When you have finished pressing info about both zones, you press “ computed water activity and osmotic pressure” in app2_tester
I have problems in app2_tester and app3_tester. The other apps and some functions that are needed to run the apps are correct. I get error in app3_tester. So what I am wondering is:
Why am I not getting the zone nr 2 writtten in my osmotic table data that is printed out when I press on the button “display results from all zones”, and neither the names of the different combinations of salts in the column called combination_of_salts in my table?
The error I get says:
Error using table (line 231)
All input variables must have the same number of rows.
Error in app3_tester/StartanalysisButtonPushed (line 259)
app.Callingapp.Osmotisk_data(app.zone_now,:) = table(app.zone_now, app.combinations_of_salts, app.vekt_prosent_best_salt_1,app.vekt_prosent_best_salt_2, app.samlet_vannaktivitet,P,effect);Here are the steps that lead to the results:
1) You start by running app2_tester that leads to app3_tester ( for making the problem simpler, I have just made it possible choosing just one combination of salts, NaCl KCl and ZnBr2: so that I don’t need to attach many function files, though there are listed up many salts in the listbox of app3_tester.
2) Each time you have pressed the choices for every zone, you press the button “done with the zone”, for instance when you in start have chosen that there are two zones, you first begin to selecting information for zone1 then do the same for zone 2
3) When you have finished pressing info about both zones, you press “ computed water activity and osmotic pressure” in app2_tester
I have problems in app2_tester and app3_tester. The other apps and some functions that are needed to run the apps are correct. I get error in app3_tester. So what I am wondering is:
Why am I not getting the zone nr 2 writtten in my osmotic table data that is printed out when I press on the button “display results from all zones”, and neither the names of the different combinations of salts in the column called combination_of_salts in my table?
The error I get says:
Error using table (line 231)
All input variables must have the same number of rows.
Error in app3_tester/StartanalysisButtonPushed (line 259)
app.Callingapp.Osmotisk_data(app.zone_now,:) = table(app.zone_now, app.combinations_of_salts, app.vekt_prosent_best_salt_1,app.vekt_prosent_best_salt_2, app.samlet_vannaktivitet,P,effect); Here are the steps that lead to the results:
1) You start by running app2_tester that leads to app3_tester ( for making the problem simpler, I have just made it possible choosing just one combination of salts, NaCl KCl and ZnBr2: so that I don’t need to attach many function files, though there are listed up many salts in the listbox of app3_tester.
2) Each time you have pressed the choices for every zone, you press the button “done with the zone”, for instance when you in start have chosen that there are two zones, you first begin to selecting information for zone1 then do the same for zone 2
3) When you have finished pressing info about both zones, you press “ computed water activity and osmotic pressure” in app2_tester
I have problems in app2_tester and app3_tester. The other apps and some functions that are needed to run the apps are correct. I get error in app3_tester. So what I am wondering is:
Why am I not getting the zone nr 2 writtten in my osmotic table data that is printed out when I press on the button “display results from all zones”, and neither the names of the different combinations of salts in the column called combination_of_salts in my table?
The error I get says:
Error using table (line 231)
All input variables must have the same number of rows.
Error in app3_tester/StartanalysisButtonPushed (line 259)
app.Callingapp.Osmotisk_data(app.zone_now,:) = table(app.zone_now, app.combinations_of_salts, app.vekt_prosent_best_salt_1,app.vekt_prosent_best_salt_2, app.samlet_vannaktivitet,P,effect); appdesigner, table MATLAB Answers — New Questions
What is the fastest way to swap large blocks of data between RAM and disk storage?
Hi all. I need to work with 4 large matrix variables repeatedly in sequence. But only one of them can fit in RAM at a time. (70 GB each, 128 GB of RAM). The operations are time-sensitive, so I need to be able to load one block of data, do some computations, release the memory, load the next block…and so on, as fast as possible. I have been looking at data store & tall arrays — I could concatenate the 4 into one tall array — but that seems intended for operations that have to span more rows than memory can hold, like taking a max across all of them. Here I just need access to one contiguous block that -will- all fit in memory, but to cycle through multiple of them. What is the preferred approach? I am using the parallel processing toolbox, but am not sure how to apply parallelization to this issue in a way that doesn’t just add more overhead. Currently I save data into uncompressed v7.3 .mat files, but I can convert to whatever helps. Thanks in advance for your insights!Hi all. I need to work with 4 large matrix variables repeatedly in sequence. But only one of them can fit in RAM at a time. (70 GB each, 128 GB of RAM). The operations are time-sensitive, so I need to be able to load one block of data, do some computations, release the memory, load the next block…and so on, as fast as possible. I have been looking at data store & tall arrays — I could concatenate the 4 into one tall array — but that seems intended for operations that have to span more rows than memory can hold, like taking a max across all of them. Here I just need access to one contiguous block that -will- all fit in memory, but to cycle through multiple of them. What is the preferred approach? I am using the parallel processing toolbox, but am not sure how to apply parallelization to this issue in a way that doesn’t just add more overhead. Currently I save data into uncompressed v7.3 .mat files, but I can convert to whatever helps. Thanks in advance for your insights! Hi all. I need to work with 4 large matrix variables repeatedly in sequence. But only one of them can fit in RAM at a time. (70 GB each, 128 GB of RAM). The operations are time-sensitive, so I need to be able to load one block of data, do some computations, release the memory, load the next block…and so on, as fast as possible. I have been looking at data store & tall arrays — I could concatenate the 4 into one tall array — but that seems intended for operations that have to span more rows than memory can hold, like taking a max across all of them. Here I just need access to one contiguous block that -will- all fit in memory, but to cycle through multiple of them. What is the preferred approach? I am using the parallel processing toolbox, but am not sure how to apply parallelization to this issue in a way that doesn’t just add more overhead. Currently I save data into uncompressed v7.3 .mat files, but I can convert to whatever helps. Thanks in advance for your insights! memory management, tall arrays MATLAB Answers — New Questions
Issues with the quality difference between plots created in live script and normal script or command window.
Hey there, recently I’ve updated from 2024b to 2025a and immediately the thing that grabbed my attention was the fact that plots created in live editor and command window are vastly different in resolution and smoothness. I’ve tried searching for people with similar experience in Matlab answers but couldn’t find anything related. Some had issues with the gpu or renderer but my problem is only happening in live editor.
Here’s a comparison between a plot created in two environments:
clear; close; clc
t = linspace(0, 2*pi, 1000);
f = 4;
y = 0.8*sin(2*pi*f*t);
figure
plot(t, y)
axis tight
Lower res from live editor:
Higher res from work space:
I’ve also attached the plots incase uploding them corrupts the quality.
Now the interesting thing is that when I open up the figure window of the same plot that I had created in live editor then suddenly the quality is high again. I tried my luck with chat gpt and grok but they were pulling their results from the same forums that I had already visited so nothing useful was found that way.Hey there, recently I’ve updated from 2024b to 2025a and immediately the thing that grabbed my attention was the fact that plots created in live editor and command window are vastly different in resolution and smoothness. I’ve tried searching for people with similar experience in Matlab answers but couldn’t find anything related. Some had issues with the gpu or renderer but my problem is only happening in live editor.
Here’s a comparison between a plot created in two environments:
clear; close; clc
t = linspace(0, 2*pi, 1000);
f = 4;
y = 0.8*sin(2*pi*f*t);
figure
plot(t, y)
axis tight
Lower res from live editor:
Higher res from work space:
I’ve also attached the plots incase uploding them corrupts the quality.
Now the interesting thing is that when I open up the figure window of the same plot that I had created in live editor then suddenly the quality is high again. I tried my luck with chat gpt and grok but they were pulling their results from the same forums that I had already visited so nothing useful was found that way. Hey there, recently I’ve updated from 2024b to 2025a and immediately the thing that grabbed my attention was the fact that plots created in live editor and command window are vastly different in resolution and smoothness. I’ve tried searching for people with similar experience in Matlab answers but couldn’t find anything related. Some had issues with the gpu or renderer but my problem is only happening in live editor.
Here’s a comparison between a plot created in two environments:
clear; close; clc
t = linspace(0, 2*pi, 1000);
f = 4;
y = 0.8*sin(2*pi*f*t);
figure
plot(t, y)
axis tight
Lower res from live editor:
Higher res from work space:
I’ve also attached the plots incase uploding them corrupts the quality.
Now the interesting thing is that when I open up the figure window of the same plot that I had created in live editor then suddenly the quality is high again. I tried my luck with chat gpt and grok but they were pulling their results from the same forums that I had already visited so nothing useful was found that way. low resolution plot, live editor MATLAB Answers — New Questions
How to force Embedded coder to use a specific struct name (instead of struct_xxxxxx) for system object parameters?
I have a custom System object that uses a configuration struct returned by a helper function:
classdef Demo_setpoint_adjuster < matlab.System
properties
config = Demo.getconfig;
end
methods
function obj = Demo_setpoint_adjuster()
% Optionally initialize config/state here if needed
end
end
methods(Access = protected)
function [adjusted_setpoint] = stepImpl(obj, setpoint)
% Default passthrough implementation
% Assign outputs
adjusted_setpoint = setpoint * obj.config.gain;
% TODO implement
end
function num = getNumInputsImpl(~), num = 1; end
function varargout = getNumOutputsImpl(~), varargout = {1, []}; end
function varargout = getOutputSizeImpl(~), varargout = {1}; end
function varargout = getOutputDataTypeImpl(~), varargout = {‘double’}; end
function varargout = isOutputComplexImpl(~), varargout = {false}; end
function varargout = isOutputFixedSizeImpl(~), varargout = {true}; end
end
end
My getconfig function looks like this:
function cfg = getconfig(varargin)
cfg = Simulink.Bus.createMATLABStruct(‘DEMO_config_def’);
cfg.gain = 10;
cfg.offset = 1e-13;
coder.cstructname(cfg, ‘my_struct’);
end % end of main function getconfig
When I generate code with Embedded coder, the header file defines the parameter type as something like:
typedef struct {
real_T gain;
real_T offset;
} struct_6h72eH5WFuEIyQr5YrdGuB;
Instead of my desired:
typedef struct {
real_T gain;
real_T offset;
} my_struct;
Even though I use coder.cstructname, Simulink still generates the anonymous struct_xxxxxx
Question:
When using a System object parameter inside a simulink model, how can i ensure embedded coder generates a struct with a specific typedef name (e.g., my_struct)? Is the recommended approach to use Simulink.Bus/Simulink.Parameter, or can coder.cstructname be applied directly in this workflow?I have a custom System object that uses a configuration struct returned by a helper function:
classdef Demo_setpoint_adjuster < matlab.System
properties
config = Demo.getconfig;
end
methods
function obj = Demo_setpoint_adjuster()
% Optionally initialize config/state here if needed
end
end
methods(Access = protected)
function [adjusted_setpoint] = stepImpl(obj, setpoint)
% Default passthrough implementation
% Assign outputs
adjusted_setpoint = setpoint * obj.config.gain;
% TODO implement
end
function num = getNumInputsImpl(~), num = 1; end
function varargout = getNumOutputsImpl(~), varargout = {1, []}; end
function varargout = getOutputSizeImpl(~), varargout = {1}; end
function varargout = getOutputDataTypeImpl(~), varargout = {‘double’}; end
function varargout = isOutputComplexImpl(~), varargout = {false}; end
function varargout = isOutputFixedSizeImpl(~), varargout = {true}; end
end
end
My getconfig function looks like this:
function cfg = getconfig(varargin)
cfg = Simulink.Bus.createMATLABStruct(‘DEMO_config_def’);
cfg.gain = 10;
cfg.offset = 1e-13;
coder.cstructname(cfg, ‘my_struct’);
end % end of main function getconfig
When I generate code with Embedded coder, the header file defines the parameter type as something like:
typedef struct {
real_T gain;
real_T offset;
} struct_6h72eH5WFuEIyQr5YrdGuB;
Instead of my desired:
typedef struct {
real_T gain;
real_T offset;
} my_struct;
Even though I use coder.cstructname, Simulink still generates the anonymous struct_xxxxxx
Question:
When using a System object parameter inside a simulink model, how can i ensure embedded coder generates a struct with a specific typedef name (e.g., my_struct)? Is the recommended approach to use Simulink.Bus/Simulink.Parameter, or can coder.cstructname be applied directly in this workflow? I have a custom System object that uses a configuration struct returned by a helper function:
classdef Demo_setpoint_adjuster < matlab.System
properties
config = Demo.getconfig;
end
methods
function obj = Demo_setpoint_adjuster()
% Optionally initialize config/state here if needed
end
end
methods(Access = protected)
function [adjusted_setpoint] = stepImpl(obj, setpoint)
% Default passthrough implementation
% Assign outputs
adjusted_setpoint = setpoint * obj.config.gain;
% TODO implement
end
function num = getNumInputsImpl(~), num = 1; end
function varargout = getNumOutputsImpl(~), varargout = {1, []}; end
function varargout = getOutputSizeImpl(~), varargout = {1}; end
function varargout = getOutputDataTypeImpl(~), varargout = {‘double’}; end
function varargout = isOutputComplexImpl(~), varargout = {false}; end
function varargout = isOutputFixedSizeImpl(~), varargout = {true}; end
end
end
My getconfig function looks like this:
function cfg = getconfig(varargin)
cfg = Simulink.Bus.createMATLABStruct(‘DEMO_config_def’);
cfg.gain = 10;
cfg.offset = 1e-13;
coder.cstructname(cfg, ‘my_struct’);
end % end of main function getconfig
When I generate code with Embedded coder, the header file defines the parameter type as something like:
typedef struct {
real_T gain;
real_T offset;
} struct_6h72eH5WFuEIyQr5YrdGuB;
Instead of my desired:
typedef struct {
real_T gain;
real_T offset;
} my_struct;
Even though I use coder.cstructname, Simulink still generates the anonymous struct_xxxxxx
Question:
When using a System object parameter inside a simulink model, how can i ensure embedded coder generates a struct with a specific typedef name (e.g., my_struct)? Is the recommended approach to use Simulink.Bus/Simulink.Parameter, or can coder.cstructname be applied directly in this workflow? embedded coder MATLAB Answers — New Questions
How do I implement a script using system objects?
Hello, I am new to Simulink so please go easy on me. I am trying to implement this particular example using system objects from the related toolboxes.
https://www.mathworks.com/help/phased/ug/integrated-sensing-and-communication-2-communication-centric-approach-using-mimo-ofdm.html
I have tried using different transmitters available but it does not seem to work. Any idea to create the Tx/Rx arras and set their locations? Thanks.Hello, I am new to Simulink so please go easy on me. I am trying to implement this particular example using system objects from the related toolboxes.
https://www.mathworks.com/help/phased/ug/integrated-sensing-and-communication-2-communication-centric-approach-using-mimo-ofdm.html
I have tried using different transmitters available but it does not seem to work. Any idea to create the Tx/Rx arras and set their locations? Thanks. Hello, I am new to Simulink so please go easy on me. I am trying to implement this particular example using system objects from the related toolboxes.
https://www.mathworks.com/help/phased/ug/integrated-sensing-and-communication-2-communication-centric-approach-using-mimo-ofdm.html
I have tried using different transmitters available but it does not seem to work. Any idea to create the Tx/Rx arras and set their locations? Thanks. simulink, phased array MATLAB Answers — New Questions
How to correctly find the solution of a system of equations containing trigonometric functions
theta=70;L=1500;h=200;D=1;
eq=[l1+l2==L;
(cosd(theta)*cosd(x1)-sind(theta)*sind(x1))/x==cosd(x1)/l2;
(cosd(theta)*cosd(x1)+sind(theta)*sind(x1))/x==cosd(x1)/l1;
tand(x1)==D/(2*f);tand(x1)==x/y;cosd(theta)==h/(y+f)];
vars=[x1,l1,l2,f,x,y];
[x1,l1,l2,f,x,y]=solve(eq,vars)
The code is as above,the solution show
l1 =
7590603.4479823424160756070250191
l2 =
-7587603.8886555868349951502850662,I think the solution is wrong,but I don’t know what is wrong,Can anyone fix this?theta=70;L=1500;h=200;D=1;
eq=[l1+l2==L;
(cosd(theta)*cosd(x1)-sind(theta)*sind(x1))/x==cosd(x1)/l2;
(cosd(theta)*cosd(x1)+sind(theta)*sind(x1))/x==cosd(x1)/l1;
tand(x1)==D/(2*f);tand(x1)==x/y;cosd(theta)==h/(y+f)];
vars=[x1,l1,l2,f,x,y];
[x1,l1,l2,f,x,y]=solve(eq,vars)
The code is as above,the solution show
l1 =
7590603.4479823424160756070250191
l2 =
-7587603.8886555868349951502850662,I think the solution is wrong,but I don’t know what is wrong,Can anyone fix this? theta=70;L=1500;h=200;D=1;
eq=[l1+l2==L;
(cosd(theta)*cosd(x1)-sind(theta)*sind(x1))/x==cosd(x1)/l2;
(cosd(theta)*cosd(x1)+sind(theta)*sind(x1))/x==cosd(x1)/l1;
tand(x1)==D/(2*f);tand(x1)==x/y;cosd(theta)==h/(y+f)];
vars=[x1,l1,l2,f,x,y];
[x1,l1,l2,f,x,y]=solve(eq,vars)
The code is as above,the solution show
l1 =
7590603.4479823424160756070250191
l2 =
-7587603.8886555868349951502850662,I think the solution is wrong,but I don’t know what is wrong,Can anyone fix this? trigonometric functions;, equations MATLAB Answers — New Questions
How to keep Host ID from changing on Linux
I am currently on a trial of matlab and my host ID changes upon completely random circumstances, I can have consequtive launches with no problem then suddenly it says my hwid is mismatched, happened once when I installed new desktop to get dark mode, then just randomly a few times. I am on Arch, what could be causing this? It’s not like it changes every other launch either
> matlab
MATLAB is selecting SOFTWARE rendering.
License checkout failed.
License Manager Error -9
Host ID ‘125e69df2eff’ in the license file does not match your computer’s host ID: "1643c734f6fd f02f741d5011 f02f741d4fb4".
To resolve this issue, reactivate your license.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/9
Diagnostic Information:
Feature: MATLAB
License path: /home/ciel/.matlab/R2024b_licenses:/home/ciel/MATLAB/2024B/licenses/license.dat:/home/ciel/MATLAB/2024B/licenses/trial_12942131_R2024b.lic
Licensing error: -9,57.
Unable to launch MVM server: License Error: Licensing shutdown
> ./MATLAB/2024B/bin/glnxa64/MathWorksProductAuthorizer
> matlab
MATLAB is selecting SOFTWARE rendering.
> matlab -nosoftwareopengl
License checkout failed.
License Manager Error -9
Host ID ‘1643c734f6fd’ in the license file does not match your computer’s host ID: "2652814a85c3 f02f741d5011 f02f741d4fb4".
To resolve this issue, reactivate your license.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/9
Diagnostic Information:
Feature: MATLAB
License path: /home/ciel/.matlab/R2024b_licenses:/home/ciel/MATLAB/2024B/licenses/license.dat:/home/ciel/MATLAB/2024B/licenses/trial_12942131_R2024b.lic
Licensing error: -9,57.
Unable to launch MVM server: License Error: Licensing shutdown
> ./MATLAB/2024B/bin/glnxa64/MathWorksProductAuthorizer
> matlab -nosoftwareopengl
> matlab
This is all within one single terminal session, and a few more has happened before this, what do I do?I am currently on a trial of matlab and my host ID changes upon completely random circumstances, I can have consequtive launches with no problem then suddenly it says my hwid is mismatched, happened once when I installed new desktop to get dark mode, then just randomly a few times. I am on Arch, what could be causing this? It’s not like it changes every other launch either
> matlab
MATLAB is selecting SOFTWARE rendering.
License checkout failed.
License Manager Error -9
Host ID ‘125e69df2eff’ in the license file does not match your computer’s host ID: "1643c734f6fd f02f741d5011 f02f741d4fb4".
To resolve this issue, reactivate your license.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/9
Diagnostic Information:
Feature: MATLAB
License path: /home/ciel/.matlab/R2024b_licenses:/home/ciel/MATLAB/2024B/licenses/license.dat:/home/ciel/MATLAB/2024B/licenses/trial_12942131_R2024b.lic
Licensing error: -9,57.
Unable to launch MVM server: License Error: Licensing shutdown
> ./MATLAB/2024B/bin/glnxa64/MathWorksProductAuthorizer
> matlab
MATLAB is selecting SOFTWARE rendering.
> matlab -nosoftwareopengl
License checkout failed.
License Manager Error -9
Host ID ‘1643c734f6fd’ in the license file does not match your computer’s host ID: "2652814a85c3 f02f741d5011 f02f741d4fb4".
To resolve this issue, reactivate your license.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/9
Diagnostic Information:
Feature: MATLAB
License path: /home/ciel/.matlab/R2024b_licenses:/home/ciel/MATLAB/2024B/licenses/license.dat:/home/ciel/MATLAB/2024B/licenses/trial_12942131_R2024b.lic
Licensing error: -9,57.
Unable to launch MVM server: License Error: Licensing shutdown
> ./MATLAB/2024B/bin/glnxa64/MathWorksProductAuthorizer
> matlab -nosoftwareopengl
> matlab
This is all within one single terminal session, and a few more has happened before this, what do I do? I am currently on a trial of matlab and my host ID changes upon completely random circumstances, I can have consequtive launches with no problem then suddenly it says my hwid is mismatched, happened once when I installed new desktop to get dark mode, then just randomly a few times. I am on Arch, what could be causing this? It’s not like it changes every other launch either
> matlab
MATLAB is selecting SOFTWARE rendering.
License checkout failed.
License Manager Error -9
Host ID ‘125e69df2eff’ in the license file does not match your computer’s host ID: "1643c734f6fd f02f741d5011 f02f741d4fb4".
To resolve this issue, reactivate your license.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/9
Diagnostic Information:
Feature: MATLAB
License path: /home/ciel/.matlab/R2024b_licenses:/home/ciel/MATLAB/2024B/licenses/license.dat:/home/ciel/MATLAB/2024B/licenses/trial_12942131_R2024b.lic
Licensing error: -9,57.
Unable to launch MVM server: License Error: Licensing shutdown
> ./MATLAB/2024B/bin/glnxa64/MathWorksProductAuthorizer
> matlab
MATLAB is selecting SOFTWARE rendering.
> matlab -nosoftwareopengl
License checkout failed.
License Manager Error -9
Host ID ‘1643c734f6fd’ in the license file does not match your computer’s host ID: "2652814a85c3 f02f741d5011 f02f741d4fb4".
To resolve this issue, reactivate your license.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/9
Diagnostic Information:
Feature: MATLAB
License path: /home/ciel/.matlab/R2024b_licenses:/home/ciel/MATLAB/2024B/licenses/license.dat:/home/ciel/MATLAB/2024B/licenses/trial_12942131_R2024b.lic
Licensing error: -9,57.
Unable to launch MVM server: License Error: Licensing shutdown
> ./MATLAB/2024B/bin/glnxa64/MathWorksProductAuthorizer
> matlab -nosoftwareopengl
> matlab
This is all within one single terminal session, and a few more has happened before this, what do I do? installataion, licensing, host id MATLAB Answers — New Questions
Change color of diagonal bars (1,1), (2,2), (3,3)… in bar3
I am plotting a 2D histogram where there are 7 bars in each axis. An example of the data is attached as N.
On this plot, I would like to be able to color the diagonal bars [e.g., (1,1), (2,2) … (7,7)] green, while leaving the rest of the bars the the base color.
I’ve built the chart using:
[N, Xedges, Yedges] = histcounts2(Xvals, yVals, [7, 7]);
h = bar3(N);
And I’m trying to color the bars using something like this, but I can’t seem to figure out how to select the only the kth bar in each row:
for k = 1 : length(h) % operate on each row of bars
% Set FaceColor to ‘flat’ to use CData for coloring
h(k).FaceColor = ‘flat’;
set(h(k),’facecolor’,[0 1 0]) % green
end
Ideally, I’d like to color both the top and sides of the selected bars green.I am plotting a 2D histogram where there are 7 bars in each axis. An example of the data is attached as N.
On this plot, I would like to be able to color the diagonal bars [e.g., (1,1), (2,2) … (7,7)] green, while leaving the rest of the bars the the base color.
I’ve built the chart using:
[N, Xedges, Yedges] = histcounts2(Xvals, yVals, [7, 7]);
h = bar3(N);
And I’m trying to color the bars using something like this, but I can’t seem to figure out how to select the only the kth bar in each row:
for k = 1 : length(h) % operate on each row of bars
% Set FaceColor to ‘flat’ to use CData for coloring
h(k).FaceColor = ‘flat’;
set(h(k),’facecolor’,[0 1 0]) % green
end
Ideally, I’d like to color both the top and sides of the selected bars green. I am plotting a 2D histogram where there are 7 bars in each axis. An example of the data is attached as N.
On this plot, I would like to be able to color the diagonal bars [e.g., (1,1), (2,2) … (7,7)] green, while leaving the rest of the bars the the base color.
I’ve built the chart using:
[N, Xedges, Yedges] = histcounts2(Xvals, yVals, [7, 7]);
h = bar3(N);
And I’m trying to color the bars using something like this, but I can’t seem to figure out how to select the only the kth bar in each row:
for k = 1 : length(h) % operate on each row of bars
% Set FaceColor to ‘flat’ to use CData for coloring
h(k).FaceColor = ‘flat’;
set(h(k),’facecolor’,[0 1 0]) % green
end
Ideally, I’d like to color both the top and sides of the selected bars green. bar3, color specific bars, handles MATLAB Answers — New Questions
Error using Git source control with Simulink
I’m using MATLAB 2023a and Git for a Simulink Project (.prj). The project contains a "main" Simulink model that references several other models using Model Reference blocks. Most of these models also have test harnesses.
When I try to compare my model against its ancestor (or any Git revision), I get the following error pop-up:
Cannot open test harness ‘name-of-test’ as another model with the same name is currently open. Please close the other model before opening this harness
Additionaly, when comparing the "main" model, the comparison results show only changes in test harnesses but no differences in the actual model itself.
Important notes:
I am not editing the test harness
I don’t have any harness open during the comparison
Has anyone run into this behaviour? Is there a way to configure MATLAB/Simulink (or Git) to ignore test harness models during comparison so that only actual model changes are shown?I’m using MATLAB 2023a and Git for a Simulink Project (.prj). The project contains a "main" Simulink model that references several other models using Model Reference blocks. Most of these models also have test harnesses.
When I try to compare my model against its ancestor (or any Git revision), I get the following error pop-up:
Cannot open test harness ‘name-of-test’ as another model with the same name is currently open. Please close the other model before opening this harness
Additionaly, when comparing the "main" model, the comparison results show only changes in test harnesses but no differences in the actual model itself.
Important notes:
I am not editing the test harness
I don’t have any harness open during the comparison
Has anyone run into this behaviour? Is there a way to configure MATLAB/Simulink (or Git) to ignore test harness models during comparison so that only actual model changes are shown? I’m using MATLAB 2023a and Git for a Simulink Project (.prj). The project contains a "main" Simulink model that references several other models using Model Reference blocks. Most of these models also have test harnesses.
When I try to compare my model against its ancestor (or any Git revision), I get the following error pop-up:
Cannot open test harness ‘name-of-test’ as another model with the same name is currently open. Please close the other model before opening this harness
Additionaly, when comparing the "main" model, the comparison results show only changes in test harnesses but no differences in the actual model itself.
Important notes:
I am not editing the test harness
I don’t have any harness open during the comparison
Has anyone run into this behaviour? Is there a way to configure MATLAB/Simulink (or Git) to ignore test harness models during comparison so that only actual model changes are shown? test harness, git, source control MATLAB Answers — New Questions
why exportgraphics fails to print the legend when the content type is vector and the legend is latex interpreted?
when exporting a fig as a vector, e.g. eps or pdf, if the legend is latex interpreted, the exported graphics do not show the legend. Below a snippet of my code:
% Figure
if showFig
f = figure(‘Color’,’w’);
else
f = figure(‘Visible’,’off’,’Color’,’w’);
end
hold on; grid on; box on; set(gca,’YScale’,’log’);
cols = lines(9);
% Plot ML refined (solid) and CRB/PEB (dashed, black markers)
% Case A
p1 = semilogy(x, RMSE_A, ‘-o’, ‘Color’, cols(1,:), ‘LineWidth’, 1.8, ‘MarkerSize’, 6);
p2 = semilogy(x, PEB_A, ‘–o’, ‘Color’, [0 0 0], ‘LineWidth’, 1.3, ‘MarkerSize’, 5);
% Case B
p3 = semilogy(x, RMSE_B, ‘-s’, ‘Color’, cols(2,:), ‘LineWidth’, 1.8, ‘MarkerSize’, 6);
p4 = semilogy(x, PEB_B, ‘–s’, ‘Color’, [0 0 0], ‘LineWidth’, 1.3, ‘MarkerSize’, 5);
% Case C
p5 = semilogy(x, RMSE_C, ‘-^’, ‘Color’, cols(3,:), ‘LineWidth’, 1.8, ‘MarkerSize’, 6);
p6 = semilogy(x, PEB_C, ‘–^’, ‘Color’, [0 0 0], ‘LineWidth’, 1.3, ‘MarkerSize’, 5);
semilogy(R.values, 20*ones(size(R.values)),’:r’,’LineWidth’,1.8);
xlim([min(x) max(x)])
legend([p1 p2 p3 p4 p5 p6], …
{‘ML RMSE_A’,’PEB_A’,’ML RMSE_B’,’PEB_B’,’ML RMSE_C’,’PEB_C’}, …
‘Location’,’best’,’Interpreter’,’latex’);
xlabel(xlab, ‘Interpreter’,’latex’);
ylabel(‘RMSE / PEB [mm]’, ‘Interpreter’,’latex’);
title(run_title, ‘Interpreter’,’none’);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,18,’LineWidth’,1.2);
% EXPORT FIG
drawnow; % ensure legend is drawn
set(f, ‘Renderer’, ‘painters’); % force vector renderer
set(f, ‘PaperPositionMode’,’auto’); % match figure size
[~, base, ~] = fileparts(mat_path);
out_path = fullfile(files(i).folder, sprintf(‘%s_PEB_ML.%s’, base, fmt));
switch lower(fmt)
case ‘eps’
saveas(f,out_path,’epsc’)
case ‘pdf’
exportgraphics(gca, [out_path, ‘.pdf’], ‘ContentType’,’vector’)
case ‘png’
print(f, out_path, ‘-dpng’,’-r300′);
otherwise
warning(‘Unknown fmt: %s. Skipping save.’, fmt);
end
endwhen exporting a fig as a vector, e.g. eps or pdf, if the legend is latex interpreted, the exported graphics do not show the legend. Below a snippet of my code:
% Figure
if showFig
f = figure(‘Color’,’w’);
else
f = figure(‘Visible’,’off’,’Color’,’w’);
end
hold on; grid on; box on; set(gca,’YScale’,’log’);
cols = lines(9);
% Plot ML refined (solid) and CRB/PEB (dashed, black markers)
% Case A
p1 = semilogy(x, RMSE_A, ‘-o’, ‘Color’, cols(1,:), ‘LineWidth’, 1.8, ‘MarkerSize’, 6);
p2 = semilogy(x, PEB_A, ‘–o’, ‘Color’, [0 0 0], ‘LineWidth’, 1.3, ‘MarkerSize’, 5);
% Case B
p3 = semilogy(x, RMSE_B, ‘-s’, ‘Color’, cols(2,:), ‘LineWidth’, 1.8, ‘MarkerSize’, 6);
p4 = semilogy(x, PEB_B, ‘–s’, ‘Color’, [0 0 0], ‘LineWidth’, 1.3, ‘MarkerSize’, 5);
% Case C
p5 = semilogy(x, RMSE_C, ‘-^’, ‘Color’, cols(3,:), ‘LineWidth’, 1.8, ‘MarkerSize’, 6);
p6 = semilogy(x, PEB_C, ‘–^’, ‘Color’, [0 0 0], ‘LineWidth’, 1.3, ‘MarkerSize’, 5);
semilogy(R.values, 20*ones(size(R.values)),’:r’,’LineWidth’,1.8);
xlim([min(x) max(x)])
legend([p1 p2 p3 p4 p5 p6], …
{‘ML RMSE_A’,’PEB_A’,’ML RMSE_B’,’PEB_B’,’ML RMSE_C’,’PEB_C’}, …
‘Location’,’best’,’Interpreter’,’latex’);
xlabel(xlab, ‘Interpreter’,’latex’);
ylabel(‘RMSE / PEB [mm]’, ‘Interpreter’,’latex’);
title(run_title, ‘Interpreter’,’none’);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,18,’LineWidth’,1.2);
% EXPORT FIG
drawnow; % ensure legend is drawn
set(f, ‘Renderer’, ‘painters’); % force vector renderer
set(f, ‘PaperPositionMode’,’auto’); % match figure size
[~, base, ~] = fileparts(mat_path);
out_path = fullfile(files(i).folder, sprintf(‘%s_PEB_ML.%s’, base, fmt));
switch lower(fmt)
case ‘eps’
saveas(f,out_path,’epsc’)
case ‘pdf’
exportgraphics(gca, [out_path, ‘.pdf’], ‘ContentType’,’vector’)
case ‘png’
print(f, out_path, ‘-dpng’,’-r300′);
otherwise
warning(‘Unknown fmt: %s. Skipping save.’, fmt);
end
end when exporting a fig as a vector, e.g. eps or pdf, if the legend is latex interpreted, the exported graphics do not show the legend. Below a snippet of my code:
% Figure
if showFig
f = figure(‘Color’,’w’);
else
f = figure(‘Visible’,’off’,’Color’,’w’);
end
hold on; grid on; box on; set(gca,’YScale’,’log’);
cols = lines(9);
% Plot ML refined (solid) and CRB/PEB (dashed, black markers)
% Case A
p1 = semilogy(x, RMSE_A, ‘-o’, ‘Color’, cols(1,:), ‘LineWidth’, 1.8, ‘MarkerSize’, 6);
p2 = semilogy(x, PEB_A, ‘–o’, ‘Color’, [0 0 0], ‘LineWidth’, 1.3, ‘MarkerSize’, 5);
% Case B
p3 = semilogy(x, RMSE_B, ‘-s’, ‘Color’, cols(2,:), ‘LineWidth’, 1.8, ‘MarkerSize’, 6);
p4 = semilogy(x, PEB_B, ‘–s’, ‘Color’, [0 0 0], ‘LineWidth’, 1.3, ‘MarkerSize’, 5);
% Case C
p5 = semilogy(x, RMSE_C, ‘-^’, ‘Color’, cols(3,:), ‘LineWidth’, 1.8, ‘MarkerSize’, 6);
p6 = semilogy(x, PEB_C, ‘–^’, ‘Color’, [0 0 0], ‘LineWidth’, 1.3, ‘MarkerSize’, 5);
semilogy(R.values, 20*ones(size(R.values)),’:r’,’LineWidth’,1.8);
xlim([min(x) max(x)])
legend([p1 p2 p3 p4 p5 p6], …
{‘ML RMSE_A’,’PEB_A’,’ML RMSE_B’,’PEB_B’,’ML RMSE_C’,’PEB_C’}, …
‘Location’,’best’,’Interpreter’,’latex’);
xlabel(xlab, ‘Interpreter’,’latex’);
ylabel(‘RMSE / PEB [mm]’, ‘Interpreter’,’latex’);
title(run_title, ‘Interpreter’,’none’);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,18,’LineWidth’,1.2);
% EXPORT FIG
drawnow; % ensure legend is drawn
set(f, ‘Renderer’, ‘painters’); % force vector renderer
set(f, ‘PaperPositionMode’,’auto’); % match figure size
[~, base, ~] = fileparts(mat_path);
out_path = fullfile(files(i).folder, sprintf(‘%s_PEB_ML.%s’, base, fmt));
switch lower(fmt)
case ‘eps’
saveas(f,out_path,’epsc’)
case ‘pdf’
exportgraphics(gca, [out_path, ‘.pdf’], ‘ContentType’,’vector’)
case ‘png’
print(f, out_path, ‘-dpng’,’-r300′);
otherwise
warning(‘Unknown fmt: %s. Skipping save.’, fmt);
end
end plot, exportgraphics MATLAB Answers — New Questions
I have a code but am unable to use if conditions with matrix value
My code required a condition for avoiding if 0 value read from text and continue to verify the next valueMy code required a condition for avoiding if 0 value read from text and continue to verify the next value My code required a condition for avoiding if 0 value read from text and continue to verify the next value if statement, continue MATLAB Answers — New Questions
Supressing Live Script plotting figure inline
I am plotting a figure from a Live Script using the
set(gcf, ‘Visible’, ‘on’);
option to make it appear in a separate, external window.
However, a copy of the figure still appears inline the Live Script and I could not find a way to avoid it.
The figure should only appear externally (i.e. in a separate window, which it already does), and not get created inline too.I am plotting a figure from a Live Script using the
set(gcf, ‘Visible’, ‘on’);
option to make it appear in a separate, external window.
However, a copy of the figure still appears inline the Live Script and I could not find a way to avoid it.
The figure should only appear externally (i.e. in a separate window, which it already does), and not get created inline too. I am plotting a figure from a Live Script using the
set(gcf, ‘Visible’, ‘on’);
option to make it appear in a separate, external window.
However, a copy of the figure still appears inline the Live Script and I could not find a way to avoid it.
The figure should only appear externally (i.e. in a separate window, which it already does), and not get created inline too. live script, figure, plot, window MATLAB Answers — New Questions