Month: July 2024
Windows 10 Updates resetting local ethernet
Hi Microsoft Tech Team,
Riddle me this – why o why do your updates reset all my Ethernet settings??? I mean seriously?
Every time there is an update it scrambles my Ethernet and I can spend up to a week meticulously checking every conceivable setting (mainly power management) in the deep dark catacombs of Windows to get a stable connection. It’s infuriating!!
I’ve just come home from an overseas trip, Windows Update required, now my Ethernet is cycling connect-disconnect every 10 second…. I mean why? It was perfectly stable before the update?
Are you hiring monkeys for the Dev Team now?
Hi Microsoft Tech Team, Riddle me this – why o why do your updates reset all my Ethernet settings??? I mean seriously? Every time there is an update it scrambles my Ethernet and I can spend up to a week meticulously checking every conceivable setting (mainly power management) in the deep dark catacombs of Windows to get a stable connection. It’s infuriating!! I’ve just come home from an overseas trip, Windows Update required, now my Ethernet is cycling connect-disconnect every 10 second…. I mean why? It was perfectly stable before the update? Are you hiring monkeys for the Dev Team now? Read More
Write a function called halfsum that takes as input an at most two-dimensional matrix A and computes the sum of the elements of A that are in the diagonal or are to the right of it. example, the input is [1 2 3; 4 5 6; 7 8 9],the ans is 26
function s = halfsum(A)
[row col] = size(A);
if row ~= col
error(‘Expecting a square matrix here people…’);
end
s = 0;
for ii = 1:row
for jj = ii:col
s = s + A(ii,jj);
end
endfunction s = halfsum(A)
[row col] = size(A);
if row ~= col
error(‘Expecting a square matrix here people…’);
end
s = 0;
for ii = 1:row
for jj = ii:col
s = s + A(ii,jj);
end
end function s = halfsum(A)
[row col] = size(A);
if row ~= col
error(‘Expecting a square matrix here people…’);
end
s = 0;
for ii = 1:row
for jj = ii:col
s = s + A(ii,jj);
end
end homework, soft-lock, no more solutions please!!!!!!, make me cry MATLAB Answers — New Questions
PIV image correlation function
Hi all,
I trying to correlate PIV images ( about 100 image). I used the below code that can correlate only the first 2 pair of images and I want to modify the loop so it can correlate the rest images. can somebody help me in modifying the loop?
for i= 1: 100;
for j= 1: 100;
max_correlation=0;
test_xmin=xgrid(i);
test_xmax=xgrid(j)+ 20 %w_width/2;
test_ymin=ygrid(i);
test_ymax=ygrid(j)+ 20 %w_width/2;
x_disp=0;
y_disp=0;
test_ima= Imagea(test_xmin:test_xmax, test_ymin:test_ymax);
test_imb= Imageb(test_xmin-x_disp_max:test_xmax+x_disp_max, test_ymin-y_disp_max:test_ymax+ y_disp_max);
correlation= normxcorr2(test_ima, test_imb);
[xpeak, ypeak]= find (correlation==max(correlation(:) ));
end
end
thanks in advanceHi all,
I trying to correlate PIV images ( about 100 image). I used the below code that can correlate only the first 2 pair of images and I want to modify the loop so it can correlate the rest images. can somebody help me in modifying the loop?
for i= 1: 100;
for j= 1: 100;
max_correlation=0;
test_xmin=xgrid(i);
test_xmax=xgrid(j)+ 20 %w_width/2;
test_ymin=ygrid(i);
test_ymax=ygrid(j)+ 20 %w_width/2;
x_disp=0;
y_disp=0;
test_ima= Imagea(test_xmin:test_xmax, test_ymin:test_ymax);
test_imb= Imageb(test_xmin-x_disp_max:test_xmax+x_disp_max, test_ymin-y_disp_max:test_ymax+ y_disp_max);
correlation= normxcorr2(test_ima, test_imb);
[xpeak, ypeak]= find (correlation==max(correlation(:) ));
end
end
thanks in advance Hi all,
I trying to correlate PIV images ( about 100 image). I used the below code that can correlate only the first 2 pair of images and I want to modify the loop so it can correlate the rest images. can somebody help me in modifying the loop?
for i= 1: 100;
for j= 1: 100;
max_correlation=0;
test_xmin=xgrid(i);
test_xmax=xgrid(j)+ 20 %w_width/2;
test_ymin=ygrid(i);
test_ymax=ygrid(j)+ 20 %w_width/2;
x_disp=0;
y_disp=0;
test_ima= Imagea(test_xmin:test_xmax, test_ymin:test_ymax);
test_imb= Imageb(test_xmin-x_disp_max:test_xmax+x_disp_max, test_ymin-y_disp_max:test_ymax+ y_disp_max);
correlation= normxcorr2(test_ima, test_imb);
[xpeak, ypeak]= find (correlation==max(correlation(:) ));
end
end
thanks in advance piv image correlation MATLAB Answers — New Questions
Create an IFOR formula
I am trying to create a formula to find any fields that are greater than $1,000, if true, then 0, if false, then $5.00. Below are the fields I created and the formula I am trying to use.
=IF(OR(A1>1000,B1>1000,C1>1000,D1>1000,E1>1000,F1>1000,G1>1000), 0,H2)
I am trying to create a formula to find any fields that are greater than $1,000, if true, then 0, if false, then $5.00. Below are the fields I created and the formula I am trying to use. =IF(OR(A1>1000,B1>1000,C1>1000,D1>1000,E1>1000,F1>1000,G1>1000), 0,H2) Read More
How i can write 12 bit rgb image in matlab ?
Dear All,
my goal is to write 12 bit rgb (4 bit for Red, 4 bit for Green, and 4 bit for Blue) image in Matlab.
I already have the image array with size (32,32,3) with range value on 0-15 for each cell.
Does anyone have already done it?
Please let me know if my explanation is not clear.
Thanks.Dear All,
my goal is to write 12 bit rgb (4 bit for Red, 4 bit for Green, and 4 bit for Blue) image in Matlab.
I already have the image array with size (32,32,3) with range value on 0-15 for each cell.
Does anyone have already done it?
Please let me know if my explanation is not clear.
Thanks. Dear All,
my goal is to write 12 bit rgb (4 bit for Red, 4 bit for Green, and 4 bit for Blue) image in Matlab.
I already have the image array with size (32,32,3) with range value on 0-15 for each cell.
Does anyone have already done it?
Please let me know if my explanation is not clear.
Thanks. image processing MATLAB Answers — New Questions
How do I set up MATLAB as the diff and merge tool for TortoiseGit?
I am using TortoiseGit to manage changes to a repository which contains binary files, such as Simulink models (".slx" or ".mdl" files) or live scripts (".mlx" files).
However, when I attempt to diff or merge these files, git fails because they are not text. How do I configure TortoiseGit to use MATLAB’s diff and merge tools for these file types?I am using TortoiseGit to manage changes to a repository which contains binary files, such as Simulink models (".slx" or ".mdl" files) or live scripts (".mlx" files).
However, when I attempt to diff or merge these files, git fails because they are not text. How do I configure TortoiseGit to use MATLAB’s diff and merge tools for these file types? I am using TortoiseGit to manage changes to a repository which contains binary files, such as Simulink models (".slx" or ".mdl" files) or live scripts (".mlx" files).
However, when I attempt to diff or merge these files, git fails because they are not text. How do I configure TortoiseGit to use MATLAB’s diff and merge tools for these file types? MATLAB Answers — New Questions
Read and Write in one scatch
Is it possible in one Arduino sketch to write data to one ThingSpeak field and read data from another field?Is it possible in one Arduino sketch to write data to one ThingSpeak field and read data from another field? Is it possible in one Arduino sketch to write data to one ThingSpeak field and read data from another field? thingspeak MATLAB Answers — New Questions
Any way to automatically save my LiveScript .mlx file as a Text-based .m file?
As given here, LiveScript is rather unhelpful for source control in terms of tractability and interpretation.
https://www.mathworks.com/matlabcentral/answers/271488-how-do-i-use-live-script-mlx-files-in-source-control
I like using LiveScript, but want the ease of source control of a text-based file, such as .m files.
Sometimes, I manually save (a copy of) the LiveScript as a .m file, so that the latest changes may be interpreted in git. Is there a way to automatically copy/save a .m file every time I save the .mlx file?, instead of manually clicking some menu options? This is one way I hope I can access the ease of writing in LiveScript while not compromising on the ease of source control.As given here, LiveScript is rather unhelpful for source control in terms of tractability and interpretation.
https://www.mathworks.com/matlabcentral/answers/271488-how-do-i-use-live-script-mlx-files-in-source-control
I like using LiveScript, but want the ease of source control of a text-based file, such as .m files.
Sometimes, I manually save (a copy of) the LiveScript as a .m file, so that the latest changes may be interpreted in git. Is there a way to automatically copy/save a .m file every time I save the .mlx file?, instead of manually clicking some menu options? This is one way I hope I can access the ease of writing in LiveScript while not compromising on the ease of source control. As given here, LiveScript is rather unhelpful for source control in terms of tractability and interpretation.
https://www.mathworks.com/matlabcentral/answers/271488-how-do-i-use-live-script-mlx-files-in-source-control
I like using LiveScript, but want the ease of source control of a text-based file, such as .m files.
Sometimes, I manually save (a copy of) the LiveScript as a .m file, so that the latest changes may be interpreted in git. Is there a way to automatically copy/save a .m file every time I save the .mlx file?, instead of manually clicking some menu options? This is one way I hope I can access the ease of writing in LiveScript while not compromising on the ease of source control. livescript, source control, 2023a MATLAB Answers — New Questions
A columns’ data under custom sort but still report to subsequent sheets
Hi Everyone,
This is the leaderboard in our sales office at work. In every Sheet (Month), column BP shows each salesman’s total sales for the month in green. It is custom filtered to order the salesmen from most sales to the least in descending order. Resulting in column BP constantly rearranging; so I am struggling to make the final totals in column BP report on the following months column B titled “Last Month” with the correct corresponding salesman. Does anyone know how I can make each sheets column BP report to column B on the following sheet although they sort every day?
Thank you for your time.
Hi Everyone, This is the leaderboard in our sales office at work. In every Sheet (Month), column BP shows each salesman’s total sales for the month in green. It is custom filtered to order the salesmen from most sales to the least in descending order. Resulting in column BP constantly rearranging; so I am struggling to make the final totals in column BP report on the following months column B titled “Last Month” with the correct corresponding salesman. Does anyone know how I can make each sheets column BP report to column B on the following sheet although they sort every day? Thank you for your time. Read More
Defender API – querying IndentityInfo in Advanced Hunting
Hi,
Is any of you having issues with Defender API in Python when running advanced hunting queries that involve the IdentityInfo table?
When i run anything that involves IdentityInfo, i get error 400: bad request. However, if i remove the IdentityInfo from the query, it simply works.
Hi, Is any of you having issues with Defender API in Python when running advanced hunting queries that involve the IdentityInfo table?When i run anything that involves IdentityInfo, i get error 400: bad request. However, if i remove the IdentityInfo from the query, it simply works. Read More
“Repair your computer” from media creation tool doesn’t start
I’ve been having an issue with starting my windows today, as a result of the “reboot and select proper boot device today” error, to which I have already tried rearranging boot disk order in bios, not working. If anyone knows a way to fix that, that would be great, but that is not the relevant problem here. I’m trying to back up my C drive so I can fix a (presumably) corrupted windows booter, and I’ve used the media creation tool to put a windows installation on a USB drive, however when it starts and I try clicking on the “repair your computer” button, it just goes to a blue screen and does nothing. I’ve waited on this for around an hour and tried multiple times again, but it is still the same and never goes to the windows recovery environment as shown in this video.
I’ve been having an issue with starting my windows today, as a result of the “reboot and select proper boot device today” error, to which I have already tried rearranging boot disk order in bios, not working. If anyone knows a way to fix that, that would be great, but that is not the relevant problem here. I’m trying to back up my C drive so I can fix a (presumably) corrupted windows booter, and I’ve used the media creation tool to put a windows installation on a USB drive, however when it starts and I try clicking on the “repair your computer” button, it just goes to a blue screen and does nothing. I’ve waited on this for around an hour and tried multiple times again, but it is still the same and never goes to the windows recovery environment as shown in this video. Read More
Connect to a Linux VM using Bastion and Key Vault without a private key file
In enterprise environments, requirements often demand the use of private networks, resulting in VMs not being assigned Public IP addresses. In such cases, Azure Bastion offers an extremely useful feature for accessing these VMs without complexity. When logging into Linux VMs on Azure via Azure Bastion using an SSH Private Key, the key is often managed as a local file. Managing SSH Private Key files on individual devices poses risks such as potential key leakage. Therefore, centralized management, including proper role assignment, is preferable from a security standpoint. A common need in such scenarios is to manage SSH Private Keys using Key Vault. This article provides such a comprehensive step-by-step guide.
There are two huge benefits here.
SSH Private Key is no longer required to store as a local file Local file by storing it in Azure Key Vault.
Access to Linux VM can be be controlled using RBAC assignment for Azure Key Vault.
Regarding the first point, storing the SSH Private Key locally after creating it through the Azure Portal can be issues such as loss the file or difficulty in identifying which VM it is for. Additionally, it has the benefit of reducing the risk of file leakage if a developer leaves the company or the project.
Regarding the second point, using Key Vault for access management allows you to control VM access through Key Vault. You can manage access control to specific VMs.
Here is the architecture diagram for the current setup. When creating a Linux VM, the SSH Private Key generated through the Azure portal is registered in Key Vault. This SSH Private Key is then used to access the Linux VM via Azure Bastion.
Prerequisites
Before following this article, you have to create Azure resources as follows:
Virtual Network
Key Vault
Azure Bastion
Setup
First, we create a new SSH Key when creating the Linux VM through the Azure portal. While it is possible to create an SSH Private Key when creating a Linux VM through the Azure portal, you can also create it separately. Once you input the parameters and create the Linux VM, you can download the SSH Private Key and save it as a local file.
If you choose to create the SSH Private Key separately, note that you need to select “Reset password” from the VM menu on Azure Portal and use “Add SSH public key” to set the SSH Key information for the Linux VM. The first link in the References section contains relevant information.
Next, you have to acquire proper RBAC role to manage Azure Key Vault. It’s not enough just having subscription Owner role. In this article, we assign Key Vault Administrator role.
We can use Key Vault Secrets Officer role for developers who access your Linux VM. Please refer to the article as follows to assign proper RBA roles.
Provide access to Key Vault keys, certificates, and secrets with an Azure role-based access control
Then, we register the SSH Private Key in the secrets of Azure Key Vault (you cannot select Keys or Certificates with Azure Bastion). There is a tip here that the SSH Private Key contains a multi-line file, but the Key Vault portal does not support the registration of multi-line strings. Therefore, we have to execute this via command line as follows:
az keyvault secret set –name “your-secret-name” –vault-name “your-key-name” –file “my-ssh-private-key.pem”
If the command works well, you can find your SSH Private Key on the Azure Key Vault.
Then, we can access the Linux VM via Azure Bastion. Select the Linux VM, choose “SSH Private Key from Azure Key Vault” from the Authentication Type options, and use the the SSH Private Key you have registered.
Error #1: Register SSH Private Key without RBAC role assignment
You got error as follows if you do not have proper RBAC. I have assigned Key Vault Administrator role to the operator to solve this issue.
Error #2: Access Linux VM without RBAC role assignment
You got error as follows if you do not have proper RBAC. I have assigned Key Vault Secrets Officer role to the operator to solve this issue.
References
ssl – How to use a certificate from a Azure Key Vault to connect to a Azure Virtual Machine through Bastion? – Stack Overflow
az keyvault secret | Microsoft Learn
az sshkey | Microsoft Learn
Connect to a Linux VM using SSH – Azure Bastion | Microsoft Learn
Microsoft Tech Community – Latest Blogs –Read More
Trying to make a 2 value sz vector, get Error using tabular/horzcat All input arguments must be tables.
Seems so simple, I’m trying to set a new table size based on values in a previous table
C = sum(app.UITable2.Data(1,:));
No matter how hard I try I can’t get the sum of a single column!
So I give up and do
sz = [C(1,1) 4];
Get the weird error that all inputs must be tables!
Try making sz a known vector type
make a property sz = [4 4]
then try
app.sz = [C(1,1) 4];
Sorry for all the asks but I’m a very experienced C, C++ (and many other languages) programmer but this .m code is driving me crazy! Help give all kinds of useless details about setting Fonts etc but little about simple syntax for e.g. summing a column.
S = sum(A,1); does sum by columns (vs ,2 for by rows but no way to say just do column 1. Even though C is a 1×4 Can’t seem to get the scaler C(1,1) out of it properly.
C(1,1) or C(1) works in the command line, just not in my app created by app designer.
Ultimately all I really want is to make a new table of the correct size with
app.TrialsTable = table(‘Size’,sz,’VariableTypes’,{‘uint8′,’uint8′,’categorical’,’int16′});Seems so simple, I’m trying to set a new table size based on values in a previous table
C = sum(app.UITable2.Data(1,:));
No matter how hard I try I can’t get the sum of a single column!
So I give up and do
sz = [C(1,1) 4];
Get the weird error that all inputs must be tables!
Try making sz a known vector type
make a property sz = [4 4]
then try
app.sz = [C(1,1) 4];
Sorry for all the asks but I’m a very experienced C, C++ (and many other languages) programmer but this .m code is driving me crazy! Help give all kinds of useless details about setting Fonts etc but little about simple syntax for e.g. summing a column.
S = sum(A,1); does sum by columns (vs ,2 for by rows but no way to say just do column 1. Even though C is a 1×4 Can’t seem to get the scaler C(1,1) out of it properly.
C(1,1) or C(1) works in the command line, just not in my app created by app designer.
Ultimately all I really want is to make a new table of the correct size with
app.TrialsTable = table(‘Size’,sz,’VariableTypes’,{‘uint8′,’uint8′,’categorical’,’int16′}); Seems so simple, I’m trying to set a new table size based on values in a previous table
C = sum(app.UITable2.Data(1,:));
No matter how hard I try I can’t get the sum of a single column!
So I give up and do
sz = [C(1,1) 4];
Get the weird error that all inputs must be tables!
Try making sz a known vector type
make a property sz = [4 4]
then try
app.sz = [C(1,1) 4];
Sorry for all the asks but I’m a very experienced C, C++ (and many other languages) programmer but this .m code is driving me crazy! Help give all kinds of useless details about setting Fonts etc but little about simple syntax for e.g. summing a column.
S = sum(A,1); does sum by columns (vs ,2 for by rows but no way to say just do column 1. Even though C is a 1×4 Can’t seem to get the scaler C(1,1) out of it properly.
C(1,1) or C(1) works in the command line, just not in my app created by app designer.
Ultimately all I really want is to make a new table of the correct size with
app.TrialsTable = table(‘Size’,sz,’VariableTypes’,{‘uint8′,’uint8′,’categorical’,’int16′}); sum, vector, table size MATLAB Answers — New Questions
Files not showing up in ‘current folder’
Hi all,
I’ve been experiencing a weird problem starting in the last 2 days. When go to a certain directory in Matlab, it doesn’t show any of the files in that directory. Moreover, using the dir() command for that directory doesn’t show any files.
I know the directory exists and there are files in it because I can access it through the normal Windows file explorer (see image below).
A few additional details. The directory I’m trying to access is a network drive. However, I can still access other network drives from Matlab and other PCs on the same network are able to view the directory in Matlab. This makes me think its something specific to Matlab on my PC with this directory (although I’m having the same issue on my personal laptop). I’m using a Windows 10 PC and Matlab 2017a.
I’ve already tried restarting matlab, my pc, disconnecting and reconnecting the drive. I have not tried reinstalling Matlab yet. Any help would be greatly appreciated!
<</matlabcentral/answers/uploaded_files/94148/currentfolder.PNG>>Hi all,
I’ve been experiencing a weird problem starting in the last 2 days. When go to a certain directory in Matlab, it doesn’t show any of the files in that directory. Moreover, using the dir() command for that directory doesn’t show any files.
I know the directory exists and there are files in it because I can access it through the normal Windows file explorer (see image below).
A few additional details. The directory I’m trying to access is a network drive. However, I can still access other network drives from Matlab and other PCs on the same network are able to view the directory in Matlab. This makes me think its something specific to Matlab on my PC with this directory (although I’m having the same issue on my personal laptop). I’m using a Windows 10 PC and Matlab 2017a.
I’ve already tried restarting matlab, my pc, disconnecting and reconnecting the drive. I have not tried reinstalling Matlab yet. Any help would be greatly appreciated!
<</matlabcentral/answers/uploaded_files/94148/currentfolder.PNG>> Hi all,
I’ve been experiencing a weird problem starting in the last 2 days. When go to a certain directory in Matlab, it doesn’t show any of the files in that directory. Moreover, using the dir() command for that directory doesn’t show any files.
I know the directory exists and there are files in it because I can access it through the normal Windows file explorer (see image below).
A few additional details. The directory I’m trying to access is a network drive. However, I can still access other network drives from Matlab and other PCs on the same network are able to view the directory in Matlab. This makes me think its something specific to Matlab on my PC with this directory (although I’m having the same issue on my personal laptop). I’m using a Windows 10 PC and Matlab 2017a.
I’ve already tried restarting matlab, my pc, disconnecting and reconnecting the drive. I have not tried reinstalling Matlab yet. Any help would be greatly appreciated!
<</matlabcentral/answers/uploaded_files/94148/currentfolder.PNG>> current folder, directory MATLAB Answers — New Questions
Code checking error in App Designer, it thinks xxxx.BackgroundColor is a scalar
I’m changing the background color to alert the user about various (async) conditions and button pressed.
if app.STOPTRIALSButton.BackgroundColor == [0.95 0.33 0.10]
app.STOPTRIALSButton.BackgroundColor = [0 1 0];
end
and I get the warning:
Unexpected use of ‘[‘ in a scalar context.
but of course colors are RGB three values, so the code runs fine.
Also while the Component browser shows (another) color as 0.65, 0.65, 0.65 that’s the wrong syntax (no commas please for easier cut and paste) and in the startup code the values are actually [0.651 0.651 0.651] so my compare failed without significant research as to why.
Finally, App Designer isn’t listed as a product below, so I can’t flag that. Just saying MATLAB is the product.I’m changing the background color to alert the user about various (async) conditions and button pressed.
if app.STOPTRIALSButton.BackgroundColor == [0.95 0.33 0.10]
app.STOPTRIALSButton.BackgroundColor = [0 1 0];
end
and I get the warning:
Unexpected use of ‘[‘ in a scalar context.
but of course colors are RGB three values, so the code runs fine.
Also while the Component browser shows (another) color as 0.65, 0.65, 0.65 that’s the wrong syntax (no commas please for easier cut and paste) and in the startup code the values are actually [0.651 0.651 0.651] so my compare failed without significant research as to why.
Finally, App Designer isn’t listed as a product below, so I can’t flag that. Just saying MATLAB is the product. I’m changing the background color to alert the user about various (async) conditions and button pressed.
if app.STOPTRIALSButton.BackgroundColor == [0.95 0.33 0.10]
app.STOPTRIALSButton.BackgroundColor = [0 1 0];
end
and I get the warning:
Unexpected use of ‘[‘ in a scalar context.
but of course colors are RGB three values, so the code runs fine.
Also while the Component browser shows (another) color as 0.65, 0.65, 0.65 that’s the wrong syntax (no commas please for easier cut and paste) and in the startup code the values are actually [0.651 0.651 0.651] so my compare failed without significant research as to why.
Finally, App Designer isn’t listed as a product below, so I can’t flag that. Just saying MATLAB is the product. backgroundcolor, scalar MATLAB Answers — New Questions
Using logicals in arrayfun
Hi,
I have two arrays:
tempA, size(10, 18)
tempB, size(1, 10) (is a column vector),
For each row in tempA, I want to extract the number of columns specified for that row by tempB. However, there are certain rows in tempB that are ‘nan’.
u = arrayfun(@(x,y) x{1}(1:y), tempA, tempB, ‘UniformOutput’, false);
Can I use logical in the arrayfun so that it automatically excludes cases that are ‘nan’?
Thank youHi,
I have two arrays:
tempA, size(10, 18)
tempB, size(1, 10) (is a column vector),
For each row in tempA, I want to extract the number of columns specified for that row by tempB. However, there are certain rows in tempB that are ‘nan’.
u = arrayfun(@(x,y) x{1}(1:y), tempA, tempB, ‘UniformOutput’, false);
Can I use logical in the arrayfun so that it automatically excludes cases that are ‘nan’?
Thank you Hi,
I have two arrays:
tempA, size(10, 18)
tempB, size(1, 10) (is a column vector),
For each row in tempA, I want to extract the number of columns specified for that row by tempB. However, there are certain rows in tempB that are ‘nan’.
u = arrayfun(@(x,y) x{1}(1:y), tempA, tempB, ‘UniformOutput’, false);
Can I use logical in the arrayfun so that it automatically excludes cases that are ‘nan’?
Thank you array function, logicals MATLAB Answers — New Questions
Support for Com4 ManagedInProcessServer and others
Com servers may generally be written in managed or unmanaged code. The COM4 schema extensions include elements such as com4:ManagedInProcessServer which allows for the specification of a COM Clsid that is implemented in managed code.
Unfortunately, the foundation manifest was not extended to include these new categories when performing the uniqueness test to ensure that when other element references a CLSID that the ID is defined once and only once in the document. This was done when COM2 was added to the schema set but seems to have been missed here.
These are the lines from the latest SDK version of the FoundationManifestSchema.xsd (starting on line 134) which appear problematic to me:
<xs:unique name=”Class_Id”>
<xs:selector xpath=”f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:ExeServer/com:Class | f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:SurrogateServer/com:Class | f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:TreatAsClass | f:Applications/f:Application/f:Extensions/com:Extension/com:ComInterface/com:ProxyStub | f:Extensions/com:Extension/com:ComInterface/com:ProxyStub | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:ExeServer/com:Class | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:SurrogateServer/com:Class | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:TreatAsClass | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComInterface/com:ProxyStub | f:Extensions/com2:Extension/com2:ComInterface/com:ProxyStub”/>
<xs:field xpath=”@Id”/>
</xs:unique>
This means that while we are able to add the ManagedInProcessServer element to define the com server component (as either a PackageExtension or ApplicationExtension as needed), we cannot reference the Clsid in any other element that would need it, such as a ShellExtension.
Fixing the above in the Foundation (and updating all tooling that verifying the schemas) will be necessary in order to build and package up more modern COM components.
Tagging @Fizza for visibility.
Com servers may generally be written in managed or unmanaged code. The COM4 schema extensions include elements such as com4:ManagedInProcessServer which allows for the specification of a COM Clsid that is implemented in managed code.
Unfortunately, the foundation manifest was not extended to include these new categories when performing the uniqueness test to ensure that when other element references a CLSID that the ID is defined once and only once in the document. This was done when COM2 was added to the schema set but seems to have been missed here.
These are the lines from the latest SDK version of the FoundationManifestSchema.xsd (starting on line 134) which appear problematic to me:
<xs:unique name=”Class_Id”><xs:selector xpath=”f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:ExeServer/com:Class | f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:SurrogateServer/com:Class | f:Applications/f:Application/f:Extensions/com:Extension/com:ComServer/com:TreatAsClass | f:Applications/f:Application/f:Extensions/com:Extension/com:ComInterface/com:ProxyStub | f:Extensions/com:Extension/com:ComInterface/com:ProxyStub | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:ExeServer/com:Class | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:SurrogateServer/com:Class | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComServer/com:TreatAsClass | f:Applications/f:Application/f:Extensions/com2:Extension/com2:ComInterface/com:ProxyStub | f:Extensions/com2:Extension/com2:ComInterface/com:ProxyStub”/><xs:field xpath=”@Id”/></xs:unique>
This means that while we are able to add the ManagedInProcessServer element to define the com server component (as either a PackageExtension or ApplicationExtension as needed), we cannot reference the Clsid in any other element that would need it, such as a ShellExtension.
Fixing the above in the Foundation (and updating all tooling that verifying the schemas) will be necessary in order to build and package up more modern COM components.
Tagging @Fizza for visibility. Read More
Schedule View By Event
I have a given excel schedule, similar to the “Input” table shown in the attachment. I have a need to organize this table by event and show participants in individual columns. I have this table shown as “Desired Output” in the attachment I also have Power BI available to me, if that provides an easier solution.
Any and all help would be greatly appreciated, thank you.
I have a given excel schedule, similar to the “Input” table shown in the attachment. I have a need to organize this table by event and show participants in individual columns. I have this table shown as “Desired Output” in the attachment I also have Power BI available to me, if that provides an easier solution. Any and all help would be greatly appreciated, thank you. Sheet Read More
Find Selected button in Button Group CallBack
I have a group of 5 buttons (including a dummy one for "none"
In the callback I want to do something based on the selected button.
Here is the default start of the callback:
function ManualRewardsButtonGroupSelectionChanged(app, event)
selectedButton = app.ManualRewardsButtonGroup.SelectedObject;
So why is the selectedButton always 1? I’d like 1 to 5 so I can do the appropriate
switch app.ManualRewardsButtonGroup.NewValue % or what here?
case 1
% Give LA reward
case 2
% Give LB reward
case 3
% Give RA reward
case 4
% Give RA reward
end
Help shows that I could use event.NewValue (since selectedButton doesn’t work) but that also returns 1
https://www.mathworks.com/help/matlab/ref/matlab.ui.container.buttongroup-properties.html
Van I set each button to have a different value? (I clicked on the Value check box in the Component but no opportunity to set it. I’ve even tried assigning Tags though I don’t know what they do.
App Designer doesn’t set values and doesn’t let me do it either
% Create ManualRewardsButtonGroup
app.ManualRewardsButtonGroup = uibuttongroup(app.RewardControls);
app.ManualRewardsButtonGroup.AutoResizeChildren = ‘off’;
app.ManualRewardsButtonGroup.SelectionChangedFcn = createCallbackFcn(app, @ManualRewardsButtonGroupSelectionChanged, true);
app.ManualRewardsButtonGroup.TitlePosition = ‘centertop’;
app.ManualRewardsButtonGroup.Title = ‘Manual Rewards’;
app.ManualRewardsButtonGroup.FontSize = 10;
app.ManualRewardsButtonGroup.Position = [38 6 190 95];
% Create Rew_ALeftButton
app.Rew_ALeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ALeftButton.Tag = ‘1’;
app.Rew_ALeftButton.Text = ‘Rew_A Left’;
app.Rew_ALeftButton.FontSize = 10;
app.Rew_ALeftButton.Position = [11 49 73 22];
% Create Rew_ARightButton
app.Rew_ARightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ARightButton.Tag = ‘2’;
app.Rew_ARightButton.Text = ‘Rew_A Right’;
app.Rew_ARightButton.FontSize = 10;
app.Rew_ARightButton.Position = [101 49 80 22];
% Create Rew_BLeftButton
app.Rew_BLeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BLeftButton.Tag = ‘3’;
app.Rew_BLeftButton.Text = ‘Rew_B Left’;
app.Rew_BLeftButton.FontSize = 10;
app.Rew_BLeftButton.Position = [11 27 74 22];
% Create Rew_BRightButton
app.Rew_BRightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BRightButton.Tag = ‘4’;
app.Rew_BRightButton.Text = ‘Rew_B Right’;
app.Rew_BRightButton.FontSize = 10;
app.Rew_BRightButton.Position = [101 27 80 22];
app.Rew_BRightButton.Value = true;
% Create OffButton
app.OffButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.OffButton.Text = ‘Off’;
app.OffButton.FontSize = 10;
app.OffButton.Position = [85 5 35 22];% Create ManualRewardsButtonGroup
app.ManualRewardsButtonGroup = uibuttongroup(app.RewardControls);
app.ManualRewardsButtonGroup.AutoResizeChildren = ‘off’;
app.ManualRewardsButtonGroup.SelectionChangedFcn = createCallbackFcn(app, @ManualRewardsButtonGroupSelectionChanged, true);
app.ManualRewardsButtonGroup.TitlePosition = ‘centertop’;
app.ManualRewardsButtonGroup.Title = ‘Manual Rewards’;
app.ManualRewardsButtonGroup.FontSize = 10;
app.ManualRewardsButtonGroup.Position = [38 6 190 95];
% Create Rew_ALeftButton
app.Rew_ALeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ALeftButton.Tag = ‘1’;
app.Rew_ALeftButton.Text = ‘Rew_A Left’;
app.Rew_ALeftButton.FontSize = 10;
app.Rew_ALeftButton.Position = [11 49 73 22];
% Create Rew_ARightButton
app.Rew_ARightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ARightButton.Tag = ‘2’;
app.Rew_ARightButton.Text = ‘Rew_A Right’;
app.Rew_ARightButton.FontSize = 10;
app.Rew_ARightButton.Position = [101 49 80 22];
% Create Rew_BLeftButton
app.Rew_BLeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BLeftButton.Tag = ‘3’;
app.Rew_BLeftButton.Text = ‘Rew_B Left’;
app.Rew_BLeftButton.FontSize = 10;
app.Rew_BLeftButton.Position = [11 27 74 22];
% Create Rew_BRightButton
app.Rew_BRightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BRightButton.Tag = ‘4’;
app.Rew_BRightButton.Text = ‘Rew_B Right’;
app.Rew_BRightButton.FontSize = 10;
app.Rew_BRightButton.Position = [101 27 80 22];
app.Rew_BRightButton.Value = true;
% Create OffButton
app.OffButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.OffButton.Text = ‘Off’;
app.OffButton.FontSize = 10;
app.OffButton.Position = [85 5 35 22];I have a group of 5 buttons (including a dummy one for "none"
In the callback I want to do something based on the selected button.
Here is the default start of the callback:
function ManualRewardsButtonGroupSelectionChanged(app, event)
selectedButton = app.ManualRewardsButtonGroup.SelectedObject;
So why is the selectedButton always 1? I’d like 1 to 5 so I can do the appropriate
switch app.ManualRewardsButtonGroup.NewValue % or what here?
case 1
% Give LA reward
case 2
% Give LB reward
case 3
% Give RA reward
case 4
% Give RA reward
end
Help shows that I could use event.NewValue (since selectedButton doesn’t work) but that also returns 1
https://www.mathworks.com/help/matlab/ref/matlab.ui.container.buttongroup-properties.html
Van I set each button to have a different value? (I clicked on the Value check box in the Component but no opportunity to set it. I’ve even tried assigning Tags though I don’t know what they do.
App Designer doesn’t set values and doesn’t let me do it either
% Create ManualRewardsButtonGroup
app.ManualRewardsButtonGroup = uibuttongroup(app.RewardControls);
app.ManualRewardsButtonGroup.AutoResizeChildren = ‘off’;
app.ManualRewardsButtonGroup.SelectionChangedFcn = createCallbackFcn(app, @ManualRewardsButtonGroupSelectionChanged, true);
app.ManualRewardsButtonGroup.TitlePosition = ‘centertop’;
app.ManualRewardsButtonGroup.Title = ‘Manual Rewards’;
app.ManualRewardsButtonGroup.FontSize = 10;
app.ManualRewardsButtonGroup.Position = [38 6 190 95];
% Create Rew_ALeftButton
app.Rew_ALeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ALeftButton.Tag = ‘1’;
app.Rew_ALeftButton.Text = ‘Rew_A Left’;
app.Rew_ALeftButton.FontSize = 10;
app.Rew_ALeftButton.Position = [11 49 73 22];
% Create Rew_ARightButton
app.Rew_ARightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ARightButton.Tag = ‘2’;
app.Rew_ARightButton.Text = ‘Rew_A Right’;
app.Rew_ARightButton.FontSize = 10;
app.Rew_ARightButton.Position = [101 49 80 22];
% Create Rew_BLeftButton
app.Rew_BLeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BLeftButton.Tag = ‘3’;
app.Rew_BLeftButton.Text = ‘Rew_B Left’;
app.Rew_BLeftButton.FontSize = 10;
app.Rew_BLeftButton.Position = [11 27 74 22];
% Create Rew_BRightButton
app.Rew_BRightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BRightButton.Tag = ‘4’;
app.Rew_BRightButton.Text = ‘Rew_B Right’;
app.Rew_BRightButton.FontSize = 10;
app.Rew_BRightButton.Position = [101 27 80 22];
app.Rew_BRightButton.Value = true;
% Create OffButton
app.OffButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.OffButton.Text = ‘Off’;
app.OffButton.FontSize = 10;
app.OffButton.Position = [85 5 35 22];% Create ManualRewardsButtonGroup
app.ManualRewardsButtonGroup = uibuttongroup(app.RewardControls);
app.ManualRewardsButtonGroup.AutoResizeChildren = ‘off’;
app.ManualRewardsButtonGroup.SelectionChangedFcn = createCallbackFcn(app, @ManualRewardsButtonGroupSelectionChanged, true);
app.ManualRewardsButtonGroup.TitlePosition = ‘centertop’;
app.ManualRewardsButtonGroup.Title = ‘Manual Rewards’;
app.ManualRewardsButtonGroup.FontSize = 10;
app.ManualRewardsButtonGroup.Position = [38 6 190 95];
% Create Rew_ALeftButton
app.Rew_ALeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ALeftButton.Tag = ‘1’;
app.Rew_ALeftButton.Text = ‘Rew_A Left’;
app.Rew_ALeftButton.FontSize = 10;
app.Rew_ALeftButton.Position = [11 49 73 22];
% Create Rew_ARightButton
app.Rew_ARightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ARightButton.Tag = ‘2’;
app.Rew_ARightButton.Text = ‘Rew_A Right’;
app.Rew_ARightButton.FontSize = 10;
app.Rew_ARightButton.Position = [101 49 80 22];
% Create Rew_BLeftButton
app.Rew_BLeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BLeftButton.Tag = ‘3’;
app.Rew_BLeftButton.Text = ‘Rew_B Left’;
app.Rew_BLeftButton.FontSize = 10;
app.Rew_BLeftButton.Position = [11 27 74 22];
% Create Rew_BRightButton
app.Rew_BRightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BRightButton.Tag = ‘4’;
app.Rew_BRightButton.Text = ‘Rew_B Right’;
app.Rew_BRightButton.FontSize = 10;
app.Rew_BRightButton.Position = [101 27 80 22];
app.Rew_BRightButton.Value = true;
% Create OffButton
app.OffButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.OffButton.Text = ‘Off’;
app.OffButton.FontSize = 10;
app.OffButton.Position = [85 5 35 22]; I have a group of 5 buttons (including a dummy one for "none"
In the callback I want to do something based on the selected button.
Here is the default start of the callback:
function ManualRewardsButtonGroupSelectionChanged(app, event)
selectedButton = app.ManualRewardsButtonGroup.SelectedObject;
So why is the selectedButton always 1? I’d like 1 to 5 so I can do the appropriate
switch app.ManualRewardsButtonGroup.NewValue % or what here?
case 1
% Give LA reward
case 2
% Give LB reward
case 3
% Give RA reward
case 4
% Give RA reward
end
Help shows that I could use event.NewValue (since selectedButton doesn’t work) but that also returns 1
https://www.mathworks.com/help/matlab/ref/matlab.ui.container.buttongroup-properties.html
Van I set each button to have a different value? (I clicked on the Value check box in the Component but no opportunity to set it. I’ve even tried assigning Tags though I don’t know what they do.
App Designer doesn’t set values and doesn’t let me do it either
% Create ManualRewardsButtonGroup
app.ManualRewardsButtonGroup = uibuttongroup(app.RewardControls);
app.ManualRewardsButtonGroup.AutoResizeChildren = ‘off’;
app.ManualRewardsButtonGroup.SelectionChangedFcn = createCallbackFcn(app, @ManualRewardsButtonGroupSelectionChanged, true);
app.ManualRewardsButtonGroup.TitlePosition = ‘centertop’;
app.ManualRewardsButtonGroup.Title = ‘Manual Rewards’;
app.ManualRewardsButtonGroup.FontSize = 10;
app.ManualRewardsButtonGroup.Position = [38 6 190 95];
% Create Rew_ALeftButton
app.Rew_ALeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ALeftButton.Tag = ‘1’;
app.Rew_ALeftButton.Text = ‘Rew_A Left’;
app.Rew_ALeftButton.FontSize = 10;
app.Rew_ALeftButton.Position = [11 49 73 22];
% Create Rew_ARightButton
app.Rew_ARightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ARightButton.Tag = ‘2’;
app.Rew_ARightButton.Text = ‘Rew_A Right’;
app.Rew_ARightButton.FontSize = 10;
app.Rew_ARightButton.Position = [101 49 80 22];
% Create Rew_BLeftButton
app.Rew_BLeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BLeftButton.Tag = ‘3’;
app.Rew_BLeftButton.Text = ‘Rew_B Left’;
app.Rew_BLeftButton.FontSize = 10;
app.Rew_BLeftButton.Position = [11 27 74 22];
% Create Rew_BRightButton
app.Rew_BRightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BRightButton.Tag = ‘4’;
app.Rew_BRightButton.Text = ‘Rew_B Right’;
app.Rew_BRightButton.FontSize = 10;
app.Rew_BRightButton.Position = [101 27 80 22];
app.Rew_BRightButton.Value = true;
% Create OffButton
app.OffButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.OffButton.Text = ‘Off’;
app.OffButton.FontSize = 10;
app.OffButton.Position = [85 5 35 22];% Create ManualRewardsButtonGroup
app.ManualRewardsButtonGroup = uibuttongroup(app.RewardControls);
app.ManualRewardsButtonGroup.AutoResizeChildren = ‘off’;
app.ManualRewardsButtonGroup.SelectionChangedFcn = createCallbackFcn(app, @ManualRewardsButtonGroupSelectionChanged, true);
app.ManualRewardsButtonGroup.TitlePosition = ‘centertop’;
app.ManualRewardsButtonGroup.Title = ‘Manual Rewards’;
app.ManualRewardsButtonGroup.FontSize = 10;
app.ManualRewardsButtonGroup.Position = [38 6 190 95];
% Create Rew_ALeftButton
app.Rew_ALeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ALeftButton.Tag = ‘1’;
app.Rew_ALeftButton.Text = ‘Rew_A Left’;
app.Rew_ALeftButton.FontSize = 10;
app.Rew_ALeftButton.Position = [11 49 73 22];
% Create Rew_ARightButton
app.Rew_ARightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_ARightButton.Tag = ‘2’;
app.Rew_ARightButton.Text = ‘Rew_A Right’;
app.Rew_ARightButton.FontSize = 10;
app.Rew_ARightButton.Position = [101 49 80 22];
% Create Rew_BLeftButton
app.Rew_BLeftButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BLeftButton.Tag = ‘3’;
app.Rew_BLeftButton.Text = ‘Rew_B Left’;
app.Rew_BLeftButton.FontSize = 10;
app.Rew_BLeftButton.Position = [11 27 74 22];
% Create Rew_BRightButton
app.Rew_BRightButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.Rew_BRightButton.Tag = ‘4’;
app.Rew_BRightButton.Text = ‘Rew_B Right’;
app.Rew_BRightButton.FontSize = 10;
app.Rew_BRightButton.Position = [101 27 80 22];
app.Rew_BRightButton.Value = true;
% Create OffButton
app.OffButton = uiradiobutton(app.ManualRewardsButtonGroup);
app.OffButton.Text = ‘Off’;
app.OffButton.FontSize = 10;
app.OffButton.Position = [85 5 35 22]; buttongroup, selectedbutton MATLAB Answers — New Questions
How to explain an ANN graph?
Hello, I’m trying to interpret an ANN graph for a paper, but I’m not sure where to start. Should I explain the detailed computations for each data point, or is there a general approach I can use to highlight the overall differences between the two groups? How do I know if it’s considered a good result? Here’s a sample figure
y=root mean square error, x=number of neurons
y=displacement, x=time pointsHello, I’m trying to interpret an ANN graph for a paper, but I’m not sure where to start. Should I explain the detailed computations for each data point, or is there a general approach I can use to highlight the overall differences between the two groups? How do I know if it’s considered a good result? Here’s a sample figure
y=root mean square error, x=number of neurons
y=displacement, x=time points Hello, I’m trying to interpret an ANN graph for a paper, but I’m not sure where to start. Should I explain the detailed computations for each data point, or is there a general approach I can use to highlight the overall differences between the two groups? How do I know if it’s considered a good result? Here’s a sample figure
y=root mean square error, x=number of neurons
y=displacement, x=time points graph, neural network MATLAB Answers — New Questions