Author: PuTI
Adding variables to a plugin interface
Hello,
I’m working on a BiQuad plugin in Matlab. In the code, I generate the coeffients and use these to build the filter. I’m trying to figure out how to display the coefficent variables in the plugin interface window. Would anyone know how to do that and add it to the grid layout? Thank you.Hello,
I’m working on a BiQuad plugin in Matlab. In the code, I generate the coeffients and use these to build the filter. I’m trying to figure out how to display the coefficent variables in the plugin interface window. Would anyone know how to do that and add it to the grid layout? Thank you. Hello,
I’m working on a BiQuad plugin in Matlab. In the code, I generate the coeffients and use these to build the filter. I’m trying to figure out how to display the coefficent variables in the plugin interface window. Would anyone know how to do that and add it to the grid layout? Thank you. plugin, variables MATLAB Answers — New Questions
Kundur Two-Area System Simulink Model (.slx) for MATLAB R2025b and Adding Distributed Generators
I am looking for a Simulink (.slx) file of the Kundur two-area power system model that is compatible with MATLAB/Simulink R2025b.
Specifically, I would like to know:
Where can I find or download a reliable Simulink implementation of Kundur’s two-area system (preferably already validated)?
If an existing model is from an older MATLAB version, what steps are required to make it compatible with R2025b?
Additionally, I want to extend the model by integrating distributed generators (DGs) into the system.
What is the recommended approach to add distributed generation units (e.g., inverter-based DGs or small synchronous generators) into the Kundur two-area system in Simulink?
Which Simulink/Simscape Electrical blocks should be used for modeling DGs?
Are there best practices for:
Connecting DGs to existing buses
Control strategies (e.g., PQ control, droop control)
Maintaining system stability after integration
Any references, example models, or guidance would be greatly appreciated.I am looking for a Simulink (.slx) file of the Kundur two-area power system model that is compatible with MATLAB/Simulink R2025b.
Specifically, I would like to know:
Where can I find or download a reliable Simulink implementation of Kundur’s two-area system (preferably already validated)?
If an existing model is from an older MATLAB version, what steps are required to make it compatible with R2025b?
Additionally, I want to extend the model by integrating distributed generators (DGs) into the system.
What is the recommended approach to add distributed generation units (e.g., inverter-based DGs or small synchronous generators) into the Kundur two-area system in Simulink?
Which Simulink/Simscape Electrical blocks should be used for modeling DGs?
Are there best practices for:
Connecting DGs to existing buses
Control strategies (e.g., PQ control, droop control)
Maintaining system stability after integration
Any references, example models, or guidance would be greatly appreciated. I am looking for a Simulink (.slx) file of the Kundur two-area power system model that is compatible with MATLAB/Simulink R2025b.
Specifically, I would like to know:
Where can I find or download a reliable Simulink implementation of Kundur’s two-area system (preferably already validated)?
If an existing model is from an older MATLAB version, what steps are required to make it compatible with R2025b?
Additionally, I want to extend the model by integrating distributed generators (DGs) into the system.
What is the recommended approach to add distributed generation units (e.g., inverter-based DGs or small synchronous generators) into the Kundur two-area system in Simulink?
Which Simulink/Simscape Electrical blocks should be used for modeling DGs?
Are there best practices for:
Connecting DGs to existing buses
Control strategies (e.g., PQ control, droop control)
Maintaining system stability after integration
Any references, example models, or guidance would be greatly appreciated. kundur’s two area bus system, transient stability MATLAB Answers — New Questions
chebyshev II BPF magnitude response is not equal to 1 in the passband – incorrect magnitude response when using freqz(b,a)
I need to exctract frequency bands of eeg signal using iir filterbanks , i got the optimum order of chebyshev type II BPF , I designed the filter but I get magntitude response not equal to 1 in the passbands , also I get incorrect magntuide response when using freqz(b,a) , code given below and magnitude response figure when using freqz(sos,[],Fs)and freqz(b,a) , kindly check .
clear
close all
clc
% Delta (0.5 – 4) Hz
% theta (4 – 7.9) Hz
% Lower Alpha (7.9 – 10) Hz
% Upper Alpha (10.1 – 12.9) Hz
% LOW BETA (12-15) Hz
% MID BETA (15-18) Hz
Fs=173.61;% Sampling Frequency
Fn=Fs/2; % Nyquist Frequency
Wpm=[0.5 4;4 7.9;7.9 10;10.1 12.9;12 15;15 18];% Passbands
Rp=3;% Passband Ripple
Rs=40;% Stopband Ripple
for m=1:size(Wpm,1)
Wp=Wpm(m,:)/Fn;
Ws=Wp.*[0.9 1.05];
%% Design a bandpass filters
[n(m,:),Ws]=cheb2ord(Wp,Ws,Rp,Rs); % Determine filter Order
[b{m},a{m}]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass");
[z,p,k]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass"); % Transfer Function Coefficients
[sos{m},g{m}]=zp2sos(z,p,k);
[H{m},f]=freqz(sos{m},[],Fs);
[H1{m},f]=freqz(b{m},a{m},[],Fs);
subplot(size(Wpm,1),2,2*m-1)
plot(f,abs(H{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H{m}))]),xlabel(‘Hz’) , ylabel(‘Magnitude’)
grid on , xticks([Wp*Fn Fn])
subplot(size(Wpm,1),2,2*m)
plot(f,abs(H1{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H1{m}))]),xlabel(‘Hz’), ylabel(‘Magnitude’),
grid on , xticks([Wp*Fn Fn])
grid on , xticks([Wp*Fn Fn])
endI need to exctract frequency bands of eeg signal using iir filterbanks , i got the optimum order of chebyshev type II BPF , I designed the filter but I get magntitude response not equal to 1 in the passbands , also I get incorrect magntuide response when using freqz(b,a) , code given below and magnitude response figure when using freqz(sos,[],Fs)and freqz(b,a) , kindly check .
clear
close all
clc
% Delta (0.5 – 4) Hz
% theta (4 – 7.9) Hz
% Lower Alpha (7.9 – 10) Hz
% Upper Alpha (10.1 – 12.9) Hz
% LOW BETA (12-15) Hz
% MID BETA (15-18) Hz
Fs=173.61;% Sampling Frequency
Fn=Fs/2; % Nyquist Frequency
Wpm=[0.5 4;4 7.9;7.9 10;10.1 12.9;12 15;15 18];% Passbands
Rp=3;% Passband Ripple
Rs=40;% Stopband Ripple
for m=1:size(Wpm,1)
Wp=Wpm(m,:)/Fn;
Ws=Wp.*[0.9 1.05];
%% Design a bandpass filters
[n(m,:),Ws]=cheb2ord(Wp,Ws,Rp,Rs); % Determine filter Order
[b{m},a{m}]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass");
[z,p,k]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass"); % Transfer Function Coefficients
[sos{m},g{m}]=zp2sos(z,p,k);
[H{m},f]=freqz(sos{m},[],Fs);
[H1{m},f]=freqz(b{m},a{m},[],Fs);
subplot(size(Wpm,1),2,2*m-1)
plot(f,abs(H{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H{m}))]),xlabel(‘Hz’) , ylabel(‘Magnitude’)
grid on , xticks([Wp*Fn Fn])
subplot(size(Wpm,1),2,2*m)
plot(f,abs(H1{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H1{m}))]),xlabel(‘Hz’), ylabel(‘Magnitude’),
grid on , xticks([Wp*Fn Fn])
grid on , xticks([Wp*Fn Fn])
end I need to exctract frequency bands of eeg signal using iir filterbanks , i got the optimum order of chebyshev type II BPF , I designed the filter but I get magntitude response not equal to 1 in the passbands , also I get incorrect magntuide response when using freqz(b,a) , code given below and magnitude response figure when using freqz(sos,[],Fs)and freqz(b,a) , kindly check .
clear
close all
clc
% Delta (0.5 – 4) Hz
% theta (4 – 7.9) Hz
% Lower Alpha (7.9 – 10) Hz
% Upper Alpha (10.1 – 12.9) Hz
% LOW BETA (12-15) Hz
% MID BETA (15-18) Hz
Fs=173.61;% Sampling Frequency
Fn=Fs/2; % Nyquist Frequency
Wpm=[0.5 4;4 7.9;7.9 10;10.1 12.9;12 15;15 18];% Passbands
Rp=3;% Passband Ripple
Rs=40;% Stopband Ripple
for m=1:size(Wpm,1)
Wp=Wpm(m,:)/Fn;
Ws=Wp.*[0.9 1.05];
%% Design a bandpass filters
[n(m,:),Ws]=cheb2ord(Wp,Ws,Rp,Rs); % Determine filter Order
[b{m},a{m}]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass");
[z,p,k]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass"); % Transfer Function Coefficients
[sos{m},g{m}]=zp2sos(z,p,k);
[H{m},f]=freqz(sos{m},[],Fs);
[H1{m},f]=freqz(b{m},a{m},[],Fs);
subplot(size(Wpm,1),2,2*m-1)
plot(f,abs(H{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H{m}))]),xlabel(‘Hz’) , ylabel(‘Magnitude’)
grid on , xticks([Wp*Fn Fn])
subplot(size(Wpm,1),2,2*m)
plot(f,abs(H1{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H1{m}))]),xlabel(‘Hz’), ylabel(‘Magnitude’),
grid on , xticks([Wp*Fn Fn])
grid on , xticks([Wp*Fn Fn])
end chebyshev ii, bandpass filter, freqz, magnitude response MATLAB Answers — New Questions
Problem with design verifier options
When I have opened the Design Verifier-> Options I can’t able to access the fields of the options How to fix this?When I have opened the Design Verifier-> Options I can’t able to access the fields of the options How to fix this? When I have opened the Design Verifier-> Options I can’t able to access the fields of the options How to fix this? simulink, verifier MATLAB Answers — New Questions
How do I buy a MATLAB License on the Webstore?
What are my options for buying a MATLAB License? Can MATLAB be purchased online on the MathWorks website?What are my options for buying a MATLAB License? Can MATLAB be purchased online on the MathWorks website? What are my options for buying a MATLAB License? Can MATLAB be purchased online on the MathWorks website? MATLAB Answers — New Questions
Error in linking Claude with MATLAB using MCP server
I tried to link my claude with MATLAB using the MCP server. However there is some issue in the connection. I am receing these error messges in claude:
Could not attach to MCP server MATLAB
MCP MATLAB: Server disconnected.
Unable to connect to extension server. Please try disabling and re-enabling the extension.
I downloaded the MCP server from github and added it to the extensions in claude. I tried both – mcpb version (matlab-mcp-core-server.mcpb) and the win64 application (matlab-mcp-core-server-win64) method to try adding the extension. Still some command or settings is blocking the process.
I have also attached the screenshots of the extensions and developer tabs of claude for reference.
Is there any other setting or procedure I am missing? What might be the error here…I tried to link my claude with MATLAB using the MCP server. However there is some issue in the connection. I am receing these error messges in claude:
Could not attach to MCP server MATLAB
MCP MATLAB: Server disconnected.
Unable to connect to extension server. Please try disabling and re-enabling the extension.
I downloaded the MCP server from github and added it to the extensions in claude. I tried both – mcpb version (matlab-mcp-core-server.mcpb) and the win64 application (matlab-mcp-core-server-win64) method to try adding the extension. Still some command or settings is blocking the process.
I have also attached the screenshots of the extensions and developer tabs of claude for reference.
Is there any other setting or procedure I am missing? What might be the error here… I tried to link my claude with MATLAB using the MCP server. However there is some issue in the connection. I am receing these error messges in claude:
Could not attach to MCP server MATLAB
MCP MATLAB: Server disconnected.
Unable to connect to extension server. Please try disabling and re-enabling the extension.
I downloaded the MCP server from github and added it to the extensions in claude. I tried both – mcpb version (matlab-mcp-core-server.mcpb) and the win64 application (matlab-mcp-core-server-win64) method to try adding the extension. Still some command or settings is blocking the process.
I have also attached the screenshots of the extensions and developer tabs of claude for reference.
Is there any other setting or procedure I am missing? What might be the error here… mcp server, claude extensions MATLAB Answers — New Questions
Inconsistent pressure, enthalpy and entropy from thermodynamic properties sensor and pressure sensor compared with CoolProp
I’m looking at the reversible heat pump example found here:
https://www.mathworks.com/help/hydro/ug/ReversibleHeatPumpExample.html
I run the example as-is, and then look at results in Simscape results explorer, focusing on three values calculated within S1: pressure from the Saturation Properties Sensor and enthalpy and entropy from the Thermodynamic Properties Sensor. I then move those plots to a figure and highlight three values at a single time:
The simulink model results give P=0.845676 MPa, H=423.098kJ/kg and S=1.87762kJ/kgK
However, when I use CoolProp within matlab to calculate entropy at the pressure and enthalpy combination I get a different value than given by the saturation properties sensor:
py.CoolProp.CoolProp.PropsSI(‘S’, ‘P’, 0.845676e6, ‘H’, 423.098*1e3, ‘R410A’)/1000
ans =
1.8113
Why is CoolProp giving 1.8113kJ/kgK but the thermodynamic properties sensor is giving 1.87762kJ/kgK?I’m looking at the reversible heat pump example found here:
https://www.mathworks.com/help/hydro/ug/ReversibleHeatPumpExample.html
I run the example as-is, and then look at results in Simscape results explorer, focusing on three values calculated within S1: pressure from the Saturation Properties Sensor and enthalpy and entropy from the Thermodynamic Properties Sensor. I then move those plots to a figure and highlight three values at a single time:
The simulink model results give P=0.845676 MPa, H=423.098kJ/kg and S=1.87762kJ/kgK
However, when I use CoolProp within matlab to calculate entropy at the pressure and enthalpy combination I get a different value than given by the saturation properties sensor:
py.CoolProp.CoolProp.PropsSI(‘S’, ‘P’, 0.845676e6, ‘H’, 423.098*1e3, ‘R410A’)/1000
ans =
1.8113
Why is CoolProp giving 1.8113kJ/kgK but the thermodynamic properties sensor is giving 1.87762kJ/kgK? I’m looking at the reversible heat pump example found here:
https://www.mathworks.com/help/hydro/ug/ReversibleHeatPumpExample.html
I run the example as-is, and then look at results in Simscape results explorer, focusing on three values calculated within S1: pressure from the Saturation Properties Sensor and enthalpy and entropy from the Thermodynamic Properties Sensor. I then move those plots to a figure and highlight three values at a single time:
The simulink model results give P=0.845676 MPa, H=423.098kJ/kg and S=1.87762kJ/kgK
However, when I use CoolProp within matlab to calculate entropy at the pressure and enthalpy combination I get a different value than given by the saturation properties sensor:
py.CoolProp.CoolProp.PropsSI(‘S’, ‘P’, 0.845676e6, ‘H’, 423.098*1e3, ‘R410A’)/1000
ans =
1.8113
Why is CoolProp giving 1.8113kJ/kgK but the thermodynamic properties sensor is giving 1.87762kJ/kgK? simulink, fluid properties, saturation properties sensor, entropy MATLAB Answers — New Questions
Dependency analyzer refuses to work
I have tried to run the Dependency Analyzer from the Apps tab countless times and it has only worked once. I didn’t do anything differently from the previous and next attempt, it just randomly worked. I have tried selecting individual files and whole folders. It shows it’s analyzing each item, then throws an error and says it’s "Updating the graph" forever and all you can do is close the window.
I’ve tried reinstalling and updating Matlab, running as administrator, trying different file types, etc. all to no avail.I have tried to run the Dependency Analyzer from the Apps tab countless times and it has only worked once. I didn’t do anything differently from the previous and next attempt, it just randomly worked. I have tried selecting individual files and whole folders. It shows it’s analyzing each item, then throws an error and says it’s "Updating the graph" forever and all you can do is close the window.
I’ve tried reinstalling and updating Matlab, running as administrator, trying different file types, etc. all to no avail. I have tried to run the Dependency Analyzer from the Apps tab countless times and it has only worked once. I didn’t do anything differently from the previous and next attempt, it just randomly worked. I have tried selecting individual files and whole folders. It shows it’s analyzing each item, then throws an error and says it’s "Updating the graph" forever and all you can do is close the window.
I’ve tried reinstalling and updating Matlab, running as administrator, trying different file types, etc. all to no avail. error MATLAB Answers — New Questions
2 area bus system
I’m unable to find Kundur bus system file.I’m unable to find Kundur bus system file. I’m unable to find Kundur bus system file. kundur-two-area-bus-system MATLAB Answers — New Questions
File Exchange can’t use the publish functionality?
For the past two months at any time I haven’t been able to use FEX’s ‘publish’ feature. After clicking that button, a popup appears saying:
‘The application is currently unavailable.
We’ve been notified of the issue and are looking into it.’
Has anyone else had the same problem as me?
I’m currently in Mainland China; with or without VPN, switching regions, it always shows this error. The browser I’m using is the latest version of Microsoft Edge.”For the past two months at any time I haven’t been able to use FEX’s ‘publish’ feature. After clicking that button, a popup appears saying:
‘The application is currently unavailable.
We’ve been notified of the issue and are looking into it.’
Has anyone else had the same problem as me?
I’m currently in Mainland China; with or without VPN, switching regions, it always shows this error. The browser I’m using is the latest version of Microsoft Edge.” For the past two months at any time I haven’t been able to use FEX’s ‘publish’ feature. After clicking that button, a popup appears saying:
‘The application is currently unavailable.
We’ve been notified of the issue and are looking into it.’
Has anyone else had the same problem as me?
I’m currently in Mainland China; with or without VPN, switching regions, it always shows this error. The browser I’m using is the latest version of Microsoft Edge.” publish, fex, web MATLAB Answers — New Questions
LSTM network time series prediction error occurs at the initial time step
I have trained a LSTM network for time series regression. After training, I want to test its performance based on the test dataset. The testing result of one single sample (extracted from minibatch results) is shown as follows:
The prediction result has a transient response process. I think this issue is caused by the zero states (CellStates and HiddenStates) of LSTM netweok. How to resolve this zero states problem when predicting time sreries ?I have trained a LSTM network for time series regression. After training, I want to test its performance based on the test dataset. The testing result of one single sample (extracted from minibatch results) is shown as follows:
The prediction result has a transient response process. I think this issue is caused by the zero states (CellStates and HiddenStates) of LSTM netweok. How to resolve this zero states problem when predicting time sreries ? I have trained a LSTM network for time series regression. After training, I want to test its performance based on the test dataset. The testing result of one single sample (extracted from minibatch results) is shown as follows:
The prediction result has a transient response process. I think this issue is caused by the zero states (CellStates and HiddenStates) of LSTM netweok. How to resolve this zero states problem when predicting time sreries ? lstm, deep learning, time series MATLAB Answers — New Questions
How to approach iterative data reading?
I’m working with a dataset that has 3 different arrays I’m interested in plotting: time, accel, and gcamp. They are all of equal size.
I’m using the accel variable as a threshold detector, where I define an arbitrary threshold under which any data I ignore. Anything above that threshold I use the index of that data point to grab the equivalent data points from time and gcamp.
How can I store this data in one structure so that I can iterate through it and generate statistics/plots about only the thresholded data points?
Something like:
time = [rand(1, 5000)];
accel = [rand(1,5000)];
gcamp = [rand(1,5000)];
sd = std(accel);
threshold = sd;
dumb = [];
for i = 1:length(accel);
if accel(i) > threshold;
dumber = [time(i), gcamp(i)];
dumb = [dumb, dumber];
end
endI’m working with a dataset that has 3 different arrays I’m interested in plotting: time, accel, and gcamp. They are all of equal size.
I’m using the accel variable as a threshold detector, where I define an arbitrary threshold under which any data I ignore. Anything above that threshold I use the index of that data point to grab the equivalent data points from time and gcamp.
How can I store this data in one structure so that I can iterate through it and generate statistics/plots about only the thresholded data points?
Something like:
time = [rand(1, 5000)];
accel = [rand(1,5000)];
gcamp = [rand(1,5000)];
sd = std(accel);
threshold = sd;
dumb = [];
for i = 1:length(accel);
if accel(i) > threshold;
dumber = [time(i), gcamp(i)];
dumb = [dumb, dumber];
end
end I’m working with a dataset that has 3 different arrays I’m interested in plotting: time, accel, and gcamp. They are all of equal size.
I’m using the accel variable as a threshold detector, where I define an arbitrary threshold under which any data I ignore. Anything above that threshold I use the index of that data point to grab the equivalent data points from time and gcamp.
How can I store this data in one structure so that I can iterate through it and generate statistics/plots about only the thresholded data points?
Something like:
time = [rand(1, 5000)];
accel = [rand(1,5000)];
gcamp = [rand(1,5000)];
sd = std(accel);
threshold = sd;
dumb = [];
for i = 1:length(accel);
if accel(i) > threshold;
dumber = [time(i), gcamp(i)];
dumb = [dumb, dumber];
end
end for loop, storing data MATLAB Answers — New Questions
Data Processing in a Cell
Hello,
I have imported data into two tables T1 and T2 34243X4 and 1070X8. To Compare the two tables I have padded T2 with string ’empty’ in all columns to match rows of T1. I am comparing T2(:,2) with T1(:,1) and which ever matches I then automatically the that particular row element in 4th Col of T2 will match row element of 1st Col in T1 (This acts as Sanity Check).
All the info in both the table is in string format including numbers
when I tried to use ismember is not able to match.
Did String Compare is not working or not comaring correctly.
Please could someone guide me. I have attached my code/script and also screenshots of my data.
Thank you for your time
PN = importdata("Part Number Summary 20260220.xlsx");
opts = detectImportOptions("Sai_MFGParts_03202026_v2.xlsx", Sheet="Export Worksheet");
% Adjust options if needed, for example set data range:
opts.DataRange = "A2";
T1 = readtable("Sai_MFGParts_03202026_v2.xlsx",opts);
T2 = PN.Summary;
C = T2; % rename for clarity
headers = C(1,1:8);
data = C(2:end,1:8);
varNames = matlab.lang.makeValidName(headers);
T2 = cell2table(data, ‘VariableNames’, varNames);
Part_Number_Data_T2 = T2.PartNumber;
Product_Description_T2 = T2.ProductDescription;
Supplier_T2 = T2.Supplier;
Categoty_T2 = T2.Category;
idx = length(T1.BWC_PART);
Part_Number_Data_T2 = resize(Part_Number_Data_T2,idx); % resize to match T1(34243×4)
Product_Description_T2 = resize(Product_Description_T2,idx);
Supplier_T2 = resize(Supplier_T2,idx);
Categoty_T2 = resize(Categoty_T2,idx);
idx_2 = cellfun(‘isempty’,Part_Number_Data_T2);
idx_3 = cellfun(‘isempty’,Product_Description_T2);
idx_4 = cellfun(‘isempty’,Supplier_T2);
idx_5 = cellfun(‘isempty’,Categoty_T2);
%Replace empty entries in Product_Description_T2, Supplier_T2, and
%Categoty_T2 with string ’empty’.
Part_Number_Data_T2(idx_2) = {’empty’};
Product_Description_T2(idx_3) = {’empty’};
Supplier_T2(idx_4) = {’empty’};
Categoty_T2(idx_5) = {’empty’};
%Ensure T2 columns are column vectors
Part_Number_Data_T2 = Part_Number_Data_T2(:);
Product_Description_T2 = Product_Description_T2(:);
Supplier_T2 = Supplier_T2(:);
Categoty_T2 = Categoty_T2(:);
Ind = cell(size(T1.BWC_PART));
for k = 1:length(Ind)
Ind{k} = T1(strcmp(T1.BWC_PART,Part_Number_Data_T2{k}),:);
endHello,
I have imported data into two tables T1 and T2 34243X4 and 1070X8. To Compare the two tables I have padded T2 with string ’empty’ in all columns to match rows of T1. I am comparing T2(:,2) with T1(:,1) and which ever matches I then automatically the that particular row element in 4th Col of T2 will match row element of 1st Col in T1 (This acts as Sanity Check).
All the info in both the table is in string format including numbers
when I tried to use ismember is not able to match.
Did String Compare is not working or not comaring correctly.
Please could someone guide me. I have attached my code/script and also screenshots of my data.
Thank you for your time
PN = importdata("Part Number Summary 20260220.xlsx");
opts = detectImportOptions("Sai_MFGParts_03202026_v2.xlsx", Sheet="Export Worksheet");
% Adjust options if needed, for example set data range:
opts.DataRange = "A2";
T1 = readtable("Sai_MFGParts_03202026_v2.xlsx",opts);
T2 = PN.Summary;
C = T2; % rename for clarity
headers = C(1,1:8);
data = C(2:end,1:8);
varNames = matlab.lang.makeValidName(headers);
T2 = cell2table(data, ‘VariableNames’, varNames);
Part_Number_Data_T2 = T2.PartNumber;
Product_Description_T2 = T2.ProductDescription;
Supplier_T2 = T2.Supplier;
Categoty_T2 = T2.Category;
idx = length(T1.BWC_PART);
Part_Number_Data_T2 = resize(Part_Number_Data_T2,idx); % resize to match T1(34243×4)
Product_Description_T2 = resize(Product_Description_T2,idx);
Supplier_T2 = resize(Supplier_T2,idx);
Categoty_T2 = resize(Categoty_T2,idx);
idx_2 = cellfun(‘isempty’,Part_Number_Data_T2);
idx_3 = cellfun(‘isempty’,Product_Description_T2);
idx_4 = cellfun(‘isempty’,Supplier_T2);
idx_5 = cellfun(‘isempty’,Categoty_T2);
%Replace empty entries in Product_Description_T2, Supplier_T2, and
%Categoty_T2 with string ’empty’.
Part_Number_Data_T2(idx_2) = {’empty’};
Product_Description_T2(idx_3) = {’empty’};
Supplier_T2(idx_4) = {’empty’};
Categoty_T2(idx_5) = {’empty’};
%Ensure T2 columns are column vectors
Part_Number_Data_T2 = Part_Number_Data_T2(:);
Product_Description_T2 = Product_Description_T2(:);
Supplier_T2 = Supplier_T2(:);
Categoty_T2 = Categoty_T2(:);
Ind = cell(size(T1.BWC_PART));
for k = 1:length(Ind)
Ind{k} = T1(strcmp(T1.BWC_PART,Part_Number_Data_T2{k}),:);
end Hello,
I have imported data into two tables T1 and T2 34243X4 and 1070X8. To Compare the two tables I have padded T2 with string ’empty’ in all columns to match rows of T1. I am comparing T2(:,2) with T1(:,1) and which ever matches I then automatically the that particular row element in 4th Col of T2 will match row element of 1st Col in T1 (This acts as Sanity Check).
All the info in both the table is in string format including numbers
when I tried to use ismember is not able to match.
Did String Compare is not working or not comaring correctly.
Please could someone guide me. I have attached my code/script and also screenshots of my data.
Thank you for your time
PN = importdata("Part Number Summary 20260220.xlsx");
opts = detectImportOptions("Sai_MFGParts_03202026_v2.xlsx", Sheet="Export Worksheet");
% Adjust options if needed, for example set data range:
opts.DataRange = "A2";
T1 = readtable("Sai_MFGParts_03202026_v2.xlsx",opts);
T2 = PN.Summary;
C = T2; % rename for clarity
headers = C(1,1:8);
data = C(2:end,1:8);
varNames = matlab.lang.makeValidName(headers);
T2 = cell2table(data, ‘VariableNames’, varNames);
Part_Number_Data_T2 = T2.PartNumber;
Product_Description_T2 = T2.ProductDescription;
Supplier_T2 = T2.Supplier;
Categoty_T2 = T2.Category;
idx = length(T1.BWC_PART);
Part_Number_Data_T2 = resize(Part_Number_Data_T2,idx); % resize to match T1(34243×4)
Product_Description_T2 = resize(Product_Description_T2,idx);
Supplier_T2 = resize(Supplier_T2,idx);
Categoty_T2 = resize(Categoty_T2,idx);
idx_2 = cellfun(‘isempty’,Part_Number_Data_T2);
idx_3 = cellfun(‘isempty’,Product_Description_T2);
idx_4 = cellfun(‘isempty’,Supplier_T2);
idx_5 = cellfun(‘isempty’,Categoty_T2);
%Replace empty entries in Product_Description_T2, Supplier_T2, and
%Categoty_T2 with string ’empty’.
Part_Number_Data_T2(idx_2) = {’empty’};
Product_Description_T2(idx_3) = {’empty’};
Supplier_T2(idx_4) = {’empty’};
Categoty_T2(idx_5) = {’empty’};
%Ensure T2 columns are column vectors
Part_Number_Data_T2 = Part_Number_Data_T2(:);
Product_Description_T2 = Product_Description_T2(:);
Supplier_T2 = Supplier_T2(:);
Categoty_T2 = Categoty_T2(:);
Ind = cell(size(T1.BWC_PART));
for k = 1:length(Ind)
Ind{k} = T1(strcmp(T1.BWC_PART,Part_Number_Data_T2{k}),:);
end matlab, data processing MATLAB Answers — New Questions
How do I integrate MATLAB and Simulink Online Courses?
I would like to integrate the self-paced courses for MATLAB and Simulink with a Learning Management System (LMS), how can I do so?I would like to integrate the self-paced courses for MATLAB and Simulink with a Learning Management System (LMS), how can I do so? I would like to integrate the self-paced courses for MATLAB and Simulink with a Learning Management System (LMS), how can I do so? MATLAB Answers — New Questions
Why are my MATLAB preferences not included during compilation in R2022a and later?
I have code that relies on a proxy setting included in my MATLAB preferences. In R2021b and earlier releases, this would automatically be included in packaging when compiling this code with MATLAB Compiler or MATLAB Compiler SDK. However, in R2022a and later, this no longer seems to be the case.
Why are my MATLAB preferences no longer being included when compiling code for deployment?I have code that relies on a proxy setting included in my MATLAB preferences. In R2021b and earlier releases, this would automatically be included in packaging when compiling this code with MATLAB Compiler or MATLAB Compiler SDK. However, in R2022a and later, this no longer seems to be the case.
Why are my MATLAB preferences no longer being included when compiling code for deployment? I have code that relies on a proxy setting included in my MATLAB preferences. In R2021b and earlier releases, this would automatically be included in packaging when compiling this code with MATLAB Compiler or MATLAB Compiler SDK. However, in R2022a and later, this no longer seems to be the case.
Why are my MATLAB preferences no longer being included when compiling code for deployment? proxy MATLAB Answers — New Questions
How do I enable license borrowing for a network license?
How do I enable license borrowing for my network license?How do I enable license borrowing for my network license? How do I enable license borrowing for my network license? MATLAB Answers — New Questions
Why does MATLAB sporadically crash on my 13th or 14th generation Intel processor?
Why does MATLAB crash sporadically on my 13th or 14th generation Intel CPU but not on other machines? The crash log frequently is different each time, and the same code works fine on other computers.Why does MATLAB crash sporadically on my 13th or 14th generation Intel CPU but not on other machines? The crash log frequently is different each time, and the same code works fine on other computers. Why does MATLAB crash sporadically on my 13th or 14th generation Intel CPU but not on other machines? The crash log frequently is different each time, and the same code works fine on other computers. crash, intel, raptorlake MATLAB Answers — New Questions
Requirements toolbox : How to add custom attribute from new column import from Excel file.
Hi everybody,
I am using the Requirement toolbox (R2023b update 4), importing requirements from excel (.xlsx file).
I followed the Mathworks example to make a first import with custom import options (as custom attributes), then i used to update from the requirements GUI after modifying requirements in the excel file (Click on Import file, and click "Update" on Requirement Interchange tab).
My problem is I need to add a column inside my Excel file, and a new custom attribute corresponding inside the .slreq file.
I cannot find how to change the import options as the requirement file already exists without importing a hole new requirement set so I will loose every links and update changes traceability.
Could you help me to find a way to change those options si when I Update the requirement set, the new custom attribute is added from the new column without breaking all my links ?
Thank you so much in advance!
Hope this find you well.Hi everybody,
I am using the Requirement toolbox (R2023b update 4), importing requirements from excel (.xlsx file).
I followed the Mathworks example to make a first import with custom import options (as custom attributes), then i used to update from the requirements GUI after modifying requirements in the excel file (Click on Import file, and click "Update" on Requirement Interchange tab).
My problem is I need to add a column inside my Excel file, and a new custom attribute corresponding inside the .slreq file.
I cannot find how to change the import options as the requirement file already exists without importing a hole new requirement set so I will loose every links and update changes traceability.
Could you help me to find a way to change those options si when I Update the requirement set, the new custom attribute is added from the new column without breaking all my links ?
Thank you so much in advance!
Hope this find you well. Hi everybody,
I am using the Requirement toolbox (R2023b update 4), importing requirements from excel (.xlsx file).
I followed the Mathworks example to make a first import with custom import options (as custom attributes), then i used to update from the requirements GUI after modifying requirements in the excel file (Click on Import file, and click "Update" on Requirement Interchange tab).
My problem is I need to add a column inside my Excel file, and a new custom attribute corresponding inside the .slreq file.
I cannot find how to change the import options as the requirement file already exists without importing a hole new requirement set so I will loose every links and update changes traceability.
Could you help me to find a way to change those options si when I Update the requirement set, the new custom attribute is added from the new column without breaking all my links ?
Thank you so much in advance!
Hope this find you well. requirements, requirements toolbox, import options, matlab MATLAB Answers — New Questions
Open to Work: How to Get Ahead in the Age of AI
Today is the day. Open to Work: How to Get Ahead in the Age of AI is officially available!
At a time when technology dominates the headlines, the conversation I see most often on LinkedIn is deeply human: what does AI mean for my job and my career?
And that makes sense. Careers once felt more predictable. Titles defined what you did. Progress looked like a ladder. That model has been evolving for years, but AI is accelerating the shift.
The most important truth about this moment is that the outcome isn’t written yet. The new world of work is being assembled right now, task by task, policy by policy, business by business. It will reflect the choices of the people who show up to build it.
That’s why Aneesh Raman and I wrote this book.
Open to Work is a practical guide informed by what we see across the global labor market and insight into the tools millions of people use every day. It’s for every person asking what comes next for their job, their career, their company or their community.
With help from experts and everyday LinkedIn members, it shows you how to engage with AI before you have to, how to adapt by focusing on what you can control and how to become irreplaceable by leaning into what makes you uniquely you.
And those ideas don’t just apply to individuals, they guide how we as Microsoft and LinkedIn are building for this moment. At the intersection of how work gets done and how careers get built, our shared goal is to connect people to opportunity and turn the tools they use every day into a canvas for human and AI collaboration at scale. Done right, that’s how AI expands opportunity and helps people build confidence and momentum in their careers.
We’ve always believed technology should serve people. AI should help humans. Not the other way around. That doesn’t happen by accident. It happens when we all decide to make it true.
If you want to go deeper on Open to Work, listen to my conversation with Microsoft President and Vice Chair Brad Smith on his Tools and Weapons podcast.
Open to Work is available now at linkedin.com/opentowork.
Ryan Roslansky is the CEO of LinkedIn and Executive Vice President of Microsoft Office, where he leads engineering for products like Word, Excel, PowerPoint and Copilot. Through these roles, Ryan is shaping where work goes next to unleash greater economic opportunity for the global workforce.
The post Open to Work: How to Get Ahead in the Age of AI appeared first on The Official Microsoft Blog.
Today is the day. Open to Work: How to Get Ahead in the Age of AI is officially available! At a time when technology dominates the headlines, the conversation I see most often on LinkedIn is deeply human: what does AI mean for my job and my career? And that makes sense. Careers once felt…
The post Open to Work: How to Get Ahead in the Age of AI appeared first on The Official Microsoft Blog.Read More
Is it possible to switch MATLAB versions after launching via the MATLAB .NET Engine API?
I want to launch MATLAB via the .NET Engine API from a C# application to run my Simulink models. My Simulink models are created using a variety of MATLAB versions (e.g., R2023b and R2025b). Can my C# application launch an instance of R2023b using the MATLAB .NET Engine API, perform some processing, close R2023b, and then launch an R2025b instance?I want to launch MATLAB via the .NET Engine API from a C# application to run my Simulink models. My Simulink models are created using a variety of MATLAB versions (e.g., R2023b and R2025b). Can my C# application launch an instance of R2023b using the MATLAB .NET Engine API, perform some processing, close R2023b, and then launch an R2025b instance? I want to launch MATLAB via the .NET Engine API from a C# application to run my Simulink models. My Simulink models are created using a variety of MATLAB versions (e.g., R2023b and R2025b). Can my C# application launch an instance of R2023b using the MATLAB .NET Engine API, perform some processing, close R2023b, and then launch an R2025b instance? .net, c#, engine, api, multiple, multi MATLAB Answers — New Questions









