Author: PuTI
Why does my prediction always show high risk?
Hello everyone.
I want to ask a question regarding my final year project.
I’m currently doing a prediction system using:
UCI heart disease dataset.
Ensemble method (Subspace Discriminant) trained model from Classifier Learner App.
a GUI from app designer.
The system shown no problem when detecting a high parameter for high risk patient data and correctly shows ‘Heart Disease Detected’ but for a low parameter for a normal patient data it still shows the output as ‘Heart Disease Detected’. It is because of the dataset’s value comes from patients that already suspect with heart disease or the model used is sensitive. The GUI screenshot is suppose to be a normal patient data.
If you have an insight about this please share with me. Thank you.
I’ll share the coding used in the app designer and the GUI with some of the patient attribute data where the target is suppose to be the outcome of this system prediction.
properties (Access = private)
modelData = load(‘HeartModel.mat’,’trainedModel’);
end
methods (Access = private)
function startupFcn(app)
% Set DropDown items and ItemsData for numerical values
% Sex
app.SexDropDown.Items = {‘Female’, ‘Male’};
app.SexDropDown.ItemsData = [0, 1];
% Chest Pain (cp)
app.ChestPainDropDown.Items = {‘Normal’,’Typical Angina’, ‘Atypical Angina’, ‘Non-anginal Pain’, ‘Asymptomatic’};
app.ChestPainDropDown.ItemsData = [0, 1, 2, 3, 4];
% Fasting Blood Sugar (fbs)
app.FastingBloodSugarDropDown.Items = {‘<= 120 mg/dL’, ‘> 120 mg/dL’};
app.FastingBloodSugarDropDown.ItemsData = [0, 1];
% Rest ECG (restecg)
app.RestECGDropDown.Items = {‘Normal’, ‘ST-T Wave Abnormality’, ‘LV Hypertrophy’};
app.RestECGDropDown.ItemsData = [0, 1, 2];
% Slope
app.SlopeDropDown.Items = {‘Upsloping’, ‘Flat’, ‘Downsloping’};
app.SlopeDropDown.ItemsData = [1, 2, 3];
% Exercise Angina (exang)
app.ExerciseAnginaDropDown.Items = {‘No’, ‘Yes’};
app.ExerciseAnginaDropDown.ItemsData = [0, 1];
% CA
app.CADropDown.Items = {‘0’, ‘1’, ‘2’, ‘3’};
app.CADropDown.ItemsData = [0, 1, 2, 3];
% Thal
app.ThalDropDown.Items = {‘Normal’, ‘Fixed Defect’, ‘Reversible Defect’};
app.ThalDropDown.ItemsData = [3, 6, 7];
end
end
% Button pushed function: PredictButton
function PredictButtonPushed(app, event)
% Collect all inputs (convert to double to be safe)
age = double(app.AgeEditField.Value);
sex = double(app.SexDropDown.Value);
cp = double(app.ChestPainDropDown.Value);
trestbps = double(app.RestingBPEditField.Value);
chol = double(app.CholesterolEditField.Value);
fbs = double(app.FastingBloodSugarDropDown.Value);
restecg = double(app.RestECGDropDown.Value);
thalach = double(app.MaxHeartRateEditField.Value);
exang = double(app.ExerciseAnginaDropDown.Value);
oldpeak = double(app.OldpeakEditField.Value);
slope = double(app.SlopeDropDown.Value);
ca = double(app.CADropDown.Value);
thal = double(app.ThalDropDown.Value);
% Create input table
T = table(age, sex, cp, trestbps, chol, fbs, restecg, thalach, …
exang, oldpeak, slope, ca, thal, …
‘VariableNames’, {‘age’,’sex’,’cp’,’trestbps’,’chol’,’fbs’,…
‘restecg’,’thalach’,’exang’,’oldpeak’,…
‘slope’,’ca’,’thal’});
%Prediction
label = app.modelData.trainedModel.predictFcn(T);
% Display result
if label == 0
app.ResultLabel.Text = ‘No Heart Disease’;
app.ResultLabel.FontColor = [0 1 0]; % Green
else
app.ResultLabel.Text = ‘Heart Disease Detected’;
app.ResultLabel.FontColor = [1 0 0]; % Red
endHello everyone.
I want to ask a question regarding my final year project.
I’m currently doing a prediction system using:
UCI heart disease dataset.
Ensemble method (Subspace Discriminant) trained model from Classifier Learner App.
a GUI from app designer.
The system shown no problem when detecting a high parameter for high risk patient data and correctly shows ‘Heart Disease Detected’ but for a low parameter for a normal patient data it still shows the output as ‘Heart Disease Detected’. It is because of the dataset’s value comes from patients that already suspect with heart disease or the model used is sensitive. The GUI screenshot is suppose to be a normal patient data.
If you have an insight about this please share with me. Thank you.
I’ll share the coding used in the app designer and the GUI with some of the patient attribute data where the target is suppose to be the outcome of this system prediction.
properties (Access = private)
modelData = load(‘HeartModel.mat’,’trainedModel’);
end
methods (Access = private)
function startupFcn(app)
% Set DropDown items and ItemsData for numerical values
% Sex
app.SexDropDown.Items = {‘Female’, ‘Male’};
app.SexDropDown.ItemsData = [0, 1];
% Chest Pain (cp)
app.ChestPainDropDown.Items = {‘Normal’,’Typical Angina’, ‘Atypical Angina’, ‘Non-anginal Pain’, ‘Asymptomatic’};
app.ChestPainDropDown.ItemsData = [0, 1, 2, 3, 4];
% Fasting Blood Sugar (fbs)
app.FastingBloodSugarDropDown.Items = {‘<= 120 mg/dL’, ‘> 120 mg/dL’};
app.FastingBloodSugarDropDown.ItemsData = [0, 1];
% Rest ECG (restecg)
app.RestECGDropDown.Items = {‘Normal’, ‘ST-T Wave Abnormality’, ‘LV Hypertrophy’};
app.RestECGDropDown.ItemsData = [0, 1, 2];
% Slope
app.SlopeDropDown.Items = {‘Upsloping’, ‘Flat’, ‘Downsloping’};
app.SlopeDropDown.ItemsData = [1, 2, 3];
% Exercise Angina (exang)
app.ExerciseAnginaDropDown.Items = {‘No’, ‘Yes’};
app.ExerciseAnginaDropDown.ItemsData = [0, 1];
% CA
app.CADropDown.Items = {‘0’, ‘1’, ‘2’, ‘3’};
app.CADropDown.ItemsData = [0, 1, 2, 3];
% Thal
app.ThalDropDown.Items = {‘Normal’, ‘Fixed Defect’, ‘Reversible Defect’};
app.ThalDropDown.ItemsData = [3, 6, 7];
end
end
% Button pushed function: PredictButton
function PredictButtonPushed(app, event)
% Collect all inputs (convert to double to be safe)
age = double(app.AgeEditField.Value);
sex = double(app.SexDropDown.Value);
cp = double(app.ChestPainDropDown.Value);
trestbps = double(app.RestingBPEditField.Value);
chol = double(app.CholesterolEditField.Value);
fbs = double(app.FastingBloodSugarDropDown.Value);
restecg = double(app.RestECGDropDown.Value);
thalach = double(app.MaxHeartRateEditField.Value);
exang = double(app.ExerciseAnginaDropDown.Value);
oldpeak = double(app.OldpeakEditField.Value);
slope = double(app.SlopeDropDown.Value);
ca = double(app.CADropDown.Value);
thal = double(app.ThalDropDown.Value);
% Create input table
T = table(age, sex, cp, trestbps, chol, fbs, restecg, thalach, …
exang, oldpeak, slope, ca, thal, …
‘VariableNames’, {‘age’,’sex’,’cp’,’trestbps’,’chol’,’fbs’,…
‘restecg’,’thalach’,’exang’,’oldpeak’,…
‘slope’,’ca’,’thal’});
%Prediction
label = app.modelData.trainedModel.predictFcn(T);
% Display result
if label == 0
app.ResultLabel.Text = ‘No Heart Disease’;
app.ResultLabel.FontColor = [0 1 0]; % Green
else
app.ResultLabel.Text = ‘Heart Disease Detected’;
app.ResultLabel.FontColor = [1 0 0]; % Red
end Hello everyone.
I want to ask a question regarding my final year project.
I’m currently doing a prediction system using:
UCI heart disease dataset.
Ensemble method (Subspace Discriminant) trained model from Classifier Learner App.
a GUI from app designer.
The system shown no problem when detecting a high parameter for high risk patient data and correctly shows ‘Heart Disease Detected’ but for a low parameter for a normal patient data it still shows the output as ‘Heart Disease Detected’. It is because of the dataset’s value comes from patients that already suspect with heart disease or the model used is sensitive. The GUI screenshot is suppose to be a normal patient data.
If you have an insight about this please share with me. Thank you.
I’ll share the coding used in the app designer and the GUI with some of the patient attribute data where the target is suppose to be the outcome of this system prediction.
properties (Access = private)
modelData = load(‘HeartModel.mat’,’trainedModel’);
end
methods (Access = private)
function startupFcn(app)
% Set DropDown items and ItemsData for numerical values
% Sex
app.SexDropDown.Items = {‘Female’, ‘Male’};
app.SexDropDown.ItemsData = [0, 1];
% Chest Pain (cp)
app.ChestPainDropDown.Items = {‘Normal’,’Typical Angina’, ‘Atypical Angina’, ‘Non-anginal Pain’, ‘Asymptomatic’};
app.ChestPainDropDown.ItemsData = [0, 1, 2, 3, 4];
% Fasting Blood Sugar (fbs)
app.FastingBloodSugarDropDown.Items = {‘<= 120 mg/dL’, ‘> 120 mg/dL’};
app.FastingBloodSugarDropDown.ItemsData = [0, 1];
% Rest ECG (restecg)
app.RestECGDropDown.Items = {‘Normal’, ‘ST-T Wave Abnormality’, ‘LV Hypertrophy’};
app.RestECGDropDown.ItemsData = [0, 1, 2];
% Slope
app.SlopeDropDown.Items = {‘Upsloping’, ‘Flat’, ‘Downsloping’};
app.SlopeDropDown.ItemsData = [1, 2, 3];
% Exercise Angina (exang)
app.ExerciseAnginaDropDown.Items = {‘No’, ‘Yes’};
app.ExerciseAnginaDropDown.ItemsData = [0, 1];
% CA
app.CADropDown.Items = {‘0’, ‘1’, ‘2’, ‘3’};
app.CADropDown.ItemsData = [0, 1, 2, 3];
% Thal
app.ThalDropDown.Items = {‘Normal’, ‘Fixed Defect’, ‘Reversible Defect’};
app.ThalDropDown.ItemsData = [3, 6, 7];
end
end
% Button pushed function: PredictButton
function PredictButtonPushed(app, event)
% Collect all inputs (convert to double to be safe)
age = double(app.AgeEditField.Value);
sex = double(app.SexDropDown.Value);
cp = double(app.ChestPainDropDown.Value);
trestbps = double(app.RestingBPEditField.Value);
chol = double(app.CholesterolEditField.Value);
fbs = double(app.FastingBloodSugarDropDown.Value);
restecg = double(app.RestECGDropDown.Value);
thalach = double(app.MaxHeartRateEditField.Value);
exang = double(app.ExerciseAnginaDropDown.Value);
oldpeak = double(app.OldpeakEditField.Value);
slope = double(app.SlopeDropDown.Value);
ca = double(app.CADropDown.Value);
thal = double(app.ThalDropDown.Value);
% Create input table
T = table(age, sex, cp, trestbps, chol, fbs, restecg, thalach, …
exang, oldpeak, slope, ca, thal, …
‘VariableNames’, {‘age’,’sex’,’cp’,’trestbps’,’chol’,’fbs’,…
‘restecg’,’thalach’,’exang’,’oldpeak’,…
‘slope’,’ca’,’thal’});
%Prediction
label = app.modelData.trainedModel.predictFcn(T);
% Display result
if label == 0
app.ResultLabel.Text = ‘No Heart Disease’;
app.ResultLabel.FontColor = [0 1 0]; % Green
else
app.ResultLabel.Text = ‘Heart Disease Detected’;
app.ResultLabel.FontColor = [1 0 0]; % Red
end app designer, appdesigner MATLAB Answers — New Questions
Simscape License Checkout failed using Simulink Online in self-paced Online Course “Power Electronics Simulation Onramp”
When using "simulink online" in the Browser window for my self-paced online course "Power Electronics Simulation Onramp", I get a "license manager error -5, Cannot find a license for simscape." message. I am aware, that I do not possess a simscape license, but this should only matter when using my local matlab installation. In simulink online, all required licenses to complete a self-paced online course should be available.
Complete error message copied from command window:
License checkout failed.
License Manager Error -5
Cannot find a license for power_system_blocks.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/5
Diagnostic Information:
Feature: power_system_blocks
License path: 13501@10.168.81.22:13501@10.168.115.247:13501@10.168.145.231:13501@10.168.84.206:13501@10.168.101.121:13501@10.168.131.14:/home/matlab/.matlab/R2023a_licenses:/MATLAB/licenses/license.dat:/MATLAB/licenses
Licensing error: -5,0.
License checkout failed.
License Manager Error -5
Cannot find a license for simscape.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/5
Diagnostic Information:
Feature: simscape
License path: 13501@10.168.81.22:13501@10.168.115.247:13501@10.168.145.231:13501@10.168.84.206:13501@10.168.101.121:13501@10.168.131.14:/home/matlab/.matlab/R2023a_licenses:/MATLAB/licenses/license.dat:/MATLAB/licenses
Licensing error: -5,0.
Error using learning.simulink.launchOnramp
Unable to check out a Simscape Electrical license, which is required by Power Electronics Simulation Onramp.
Alternatively, you can take the course on the MathWorks Self-Paced Online Courses website.When using "simulink online" in the Browser window for my self-paced online course "Power Electronics Simulation Onramp", I get a "license manager error -5, Cannot find a license for simscape." message. I am aware, that I do not possess a simscape license, but this should only matter when using my local matlab installation. In simulink online, all required licenses to complete a self-paced online course should be available.
Complete error message copied from command window:
License checkout failed.
License Manager Error -5
Cannot find a license for power_system_blocks.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/5
Diagnostic Information:
Feature: power_system_blocks
License path: 13501@10.168.81.22:13501@10.168.115.247:13501@10.168.145.231:13501@10.168.84.206:13501@10.168.101.121:13501@10.168.131.14:/home/matlab/.matlab/R2023a_licenses:/MATLAB/licenses/license.dat:/MATLAB/licenses
Licensing error: -5,0.
License checkout failed.
License Manager Error -5
Cannot find a license for simscape.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/5
Diagnostic Information:
Feature: simscape
License path: 13501@10.168.81.22:13501@10.168.115.247:13501@10.168.145.231:13501@10.168.84.206:13501@10.168.101.121:13501@10.168.131.14:/home/matlab/.matlab/R2023a_licenses:/MATLAB/licenses/license.dat:/MATLAB/licenses
Licensing error: -5,0.
Error using learning.simulink.launchOnramp
Unable to check out a Simscape Electrical license, which is required by Power Electronics Simulation Onramp.
Alternatively, you can take the course on the MathWorks Self-Paced Online Courses website. When using "simulink online" in the Browser window for my self-paced online course "Power Electronics Simulation Onramp", I get a "license manager error -5, Cannot find a license for simscape." message. I am aware, that I do not possess a simscape license, but this should only matter when using my local matlab installation. In simulink online, all required licenses to complete a self-paced online course should be available.
Complete error message copied from command window:
License checkout failed.
License Manager Error -5
Cannot find a license for power_system_blocks.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/5
Diagnostic Information:
Feature: power_system_blocks
License path: 13501@10.168.81.22:13501@10.168.115.247:13501@10.168.145.231:13501@10.168.84.206:13501@10.168.101.121:13501@10.168.131.14:/home/matlab/.matlab/R2023a_licenses:/MATLAB/licenses/license.dat:/MATLAB/licenses
Licensing error: -5,0.
License checkout failed.
License Manager Error -5
Cannot find a license for simscape.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/5
Diagnostic Information:
Feature: simscape
License path: 13501@10.168.81.22:13501@10.168.115.247:13501@10.168.145.231:13501@10.168.84.206:13501@10.168.101.121:13501@10.168.131.14:/home/matlab/.matlab/R2023a_licenses:/MATLAB/licenses/license.dat:/MATLAB/licenses
Licensing error: -5,0.
Error using learning.simulink.launchOnramp
Unable to check out a Simscape Electrical license, which is required by Power Electronics Simulation Onramp.
Alternatively, you can take the course on the MathWorks Self-Paced Online Courses website. simulink online, license checkout failed, simscape, online course MATLAB Answers — New Questions
Adding a class-related function to appdesigner app
Is there a way, in appdesigner, to create a class-related function, i.e., a function that is local to the app’s classdef file, but which is not a class method?Is there a way, in appdesigner, to create a class-related function, i.e., a function that is local to the app’s classdef file, but which is not a class method? Is there a way, in appdesigner, to create a class-related function, i.e., a function that is local to the app’s classdef file, but which is not a class method? appdesigner, classdef, class-related, app MATLAB Answers — New Questions
arduino BLE send/receive simulink problem
Hello,
I am trying to send /receive BLE data from the sensors on an arduino board in simulink using some predifined BLE peripheral blocks. Then I upload the code on the arduino hardware and run it. So far this works with arduino nano iot 33 as all characteristics are visible.
It does not with BLE, BLE sense, and BLE sense rev2 boards. With the latter, the BLE service does not show up, for example in matlab calling blelist.
I tried with an ESP32 board as well. Here characteristics appear, but it depends on how many have been defined in simulink. Some of them are not accesible and some carry the same uuid although they have been given a different characteristic uuid in Simulink. It gives a erratic impression.
I’ve looked around on the forum but can’t find a solution. This seems to be a simulink incompatability issue…?
Is there perhaps a workaround for this problem ?
Thanks for any helpHello,
I am trying to send /receive BLE data from the sensors on an arduino board in simulink using some predifined BLE peripheral blocks. Then I upload the code on the arduino hardware and run it. So far this works with arduino nano iot 33 as all characteristics are visible.
It does not with BLE, BLE sense, and BLE sense rev2 boards. With the latter, the BLE service does not show up, for example in matlab calling blelist.
I tried with an ESP32 board as well. Here characteristics appear, but it depends on how many have been defined in simulink. Some of them are not accesible and some carry the same uuid although they have been given a different characteristic uuid in Simulink. It gives a erratic impression.
I’ve looked around on the forum but can’t find a solution. This seems to be a simulink incompatability issue…?
Is there perhaps a workaround for this problem ?
Thanks for any help Hello,
I am trying to send /receive BLE data from the sensors on an arduino board in simulink using some predifined BLE peripheral blocks. Then I upload the code on the arduino hardware and run it. So far this works with arduino nano iot 33 as all characteristics are visible.
It does not with BLE, BLE sense, and BLE sense rev2 boards. With the latter, the BLE service does not show up, for example in matlab calling blelist.
I tried with an ESP32 board as well. Here characteristics appear, but it depends on how many have been defined in simulink. Some of them are not accesible and some carry the same uuid although they have been given a different characteristic uuid in Simulink. It gives a erratic impression.
I’ve looked around on the forum but can’t find a solution. This seems to be a simulink incompatability issue…?
Is there perhaps a workaround for this problem ?
Thanks for any help simulink, ble, arduino MATLAB Answers — New Questions
Design FDMA using simulink
Hello,
I am working on a FDMA project using Simulink and I am facing technical issues with the following blocks:
– Sine Wave (Discrete Time)
– Product (BPSK × Carrier)
– Bandpass Filter
– AWGN Channel
**Problem:**
1. When using AWGN Channel with mode "Signal to Noise Ratio", I get:
"Input and output must be discrete when mode set to Signal to Noise Ratio".
2. After the Filter, sometimes complex signals appear causing errors in Integrator or Decision blocks.
**Current settings for User 1 example:**
– Sine Wave: Discrete, Sample time = 0.0001 s
– Filter: Bandpass, Filter order = 4, Lower passband = 900 Hz, Upper passband = 1100 Hz
– Stopband 1 = 800 Hz, Stopband 2 = 1200 Hz, Stopband attenuation = 40 dB
– AWGN Channel: Mode = Signal to Noise Ratio
**Goal:**
– Run FDMA for two users (User1 = 1 kHz, User2 = 2 kHz)
– Avoid any complex signals
– Make AWGN Channel work correctly with specified SNR
**Request:**
– How to set up the blocks (Sine Wave, Product, Filter, AWGN) so that no complex signals appear and AWGN works correctly?
– How to choose the correct Sample time and Filter type for each block?
**Attachments:**
– Simulink screenshots
– Simulink file (.slx) if possible
Thank you very much for your help.
<<
<</matlabcentral/answers/uploaded_files/1845240/IMG_20260101_225640_567.jpg>>
>>Hello,
I am working on a FDMA project using Simulink and I am facing technical issues with the following blocks:
– Sine Wave (Discrete Time)
– Product (BPSK × Carrier)
– Bandpass Filter
– AWGN Channel
**Problem:**
1. When using AWGN Channel with mode "Signal to Noise Ratio", I get:
"Input and output must be discrete when mode set to Signal to Noise Ratio".
2. After the Filter, sometimes complex signals appear causing errors in Integrator or Decision blocks.
**Current settings for User 1 example:**
– Sine Wave: Discrete, Sample time = 0.0001 s
– Filter: Bandpass, Filter order = 4, Lower passband = 900 Hz, Upper passband = 1100 Hz
– Stopband 1 = 800 Hz, Stopband 2 = 1200 Hz, Stopband attenuation = 40 dB
– AWGN Channel: Mode = Signal to Noise Ratio
**Goal:**
– Run FDMA for two users (User1 = 1 kHz, User2 = 2 kHz)
– Avoid any complex signals
– Make AWGN Channel work correctly with specified SNR
**Request:**
– How to set up the blocks (Sine Wave, Product, Filter, AWGN) so that no complex signals appear and AWGN works correctly?
– How to choose the correct Sample time and Filter type for each block?
**Attachments:**
– Simulink screenshots
– Simulink file (.slx) if possible
Thank you very much for your help.
<<
<</matlabcentral/answers/uploaded_files/1845240/IMG_20260101_225640_567.jpg>>
>> Hello,
I am working on a FDMA project using Simulink and I am facing technical issues with the following blocks:
– Sine Wave (Discrete Time)
– Product (BPSK × Carrier)
– Bandpass Filter
– AWGN Channel
**Problem:**
1. When using AWGN Channel with mode "Signal to Noise Ratio", I get:
"Input and output must be discrete when mode set to Signal to Noise Ratio".
2. After the Filter, sometimes complex signals appear causing errors in Integrator or Decision blocks.
**Current settings for User 1 example:**
– Sine Wave: Discrete, Sample time = 0.0001 s
– Filter: Bandpass, Filter order = 4, Lower passband = 900 Hz, Upper passband = 1100 Hz
– Stopband 1 = 800 Hz, Stopband 2 = 1200 Hz, Stopband attenuation = 40 dB
– AWGN Channel: Mode = Signal to Noise Ratio
**Goal:**
– Run FDMA for two users (User1 = 1 kHz, User2 = 2 kHz)
– Avoid any complex signals
– Make AWGN Channel work correctly with specified SNR
**Request:**
– How to set up the blocks (Sine Wave, Product, Filter, AWGN) so that no complex signals appear and AWGN works correctly?
– How to choose the correct Sample time and Filter type for each block?
**Attachments:**
– Simulink screenshots
– Simulink file (.slx) if possible
Thank you very much for your help.
<<
<</matlabcentral/answers/uploaded_files/1845240/IMG_20260101_225640_567.jpg>>
>> #fdma#simulink MATLAB Answers — New Questions
FontSize different for numbers and strings in table object of mlreportgen.ppt.Table class
I have a standard MATLAB table with numeric and string values in different columns to integrate into pptx file
I create table object of mlreportgen.ppt.Table, set FontSize to 8 on the table and add it to the slide like this:
vt_table_obj = mlreportgen.ppt.Table(vt_table);
vt_table_obj.FontSize = ‘8pt’;
add(vt_slide, vt_table_obj);
But in presentation size 8 is applied only to text values, while numeric have size 10:
Why it doesn’t apply to the numbers?Or it need to be set further in children entities – TableRow, TableEntry, Paragpaph, Text – levels?I have a standard MATLAB table with numeric and string values in different columns to integrate into pptx file
I create table object of mlreportgen.ppt.Table, set FontSize to 8 on the table and add it to the slide like this:
vt_table_obj = mlreportgen.ppt.Table(vt_table);
vt_table_obj.FontSize = ‘8pt’;
add(vt_slide, vt_table_obj);
But in presentation size 8 is applied only to text values, while numeric have size 10:
Why it doesn’t apply to the numbers?Or it need to be set further in children entities – TableRow, TableEntry, Paragpaph, Text – levels? I have a standard MATLAB table with numeric and string values in different columns to integrate into pptx file
I create table object of mlreportgen.ppt.Table, set FontSize to 8 on the table and add it to the slide like this:
vt_table_obj = mlreportgen.ppt.Table(vt_table);
vt_table_obj.FontSize = ‘8pt’;
add(vt_slide, vt_table_obj);
But in presentation size 8 is applied only to text values, while numeric have size 10:
Why it doesn’t apply to the numbers?Or it need to be set further in children entities – TableRow, TableEntry, Paragpaph, Text – levels? table, mlreportgen, ppt MATLAB Answers — New Questions
Effect Size in fitglme
Hey, I am using a model which I have estimated with fitglme. I want to report effect sizes and confidence intervals. Would the best way be to report OR terms and their respective intervals?
I am calculating them the following way:
[beta,~,stats] = fixedEffects(glme_best);
CI = coefCI(glme_best);
names = glme_best.CoefficientNames(:);
OR = exp(beta);
CI_OR = exp(CI);
Is that correct or is there a better way to directly get OR terms in Matlab?
Best!Hey, I am using a model which I have estimated with fitglme. I want to report effect sizes and confidence intervals. Would the best way be to report OR terms and their respective intervals?
I am calculating them the following way:
[beta,~,stats] = fixedEffects(glme_best);
CI = coefCI(glme_best);
names = glme_best.CoefficientNames(:);
OR = exp(beta);
CI_OR = exp(CI);
Is that correct or is there a better way to directly get OR terms in Matlab?
Best! Hey, I am using a model which I have estimated with fitglme. I want to report effect sizes and confidence intervals. Would the best way be to report OR terms and their respective intervals?
I am calculating them the following way:
[beta,~,stats] = fixedEffects(glme_best);
CI = coefCI(glme_best);
names = glme_best.CoefficientNames(:);
OR = exp(beta);
CI_OR = exp(CI);
Is that correct or is there a better way to directly get OR terms in Matlab?
Best! fitglme, oddsratio MATLAB Answers — New Questions
Does split screen work in R2025b?
In MATLAB R2025b, in the Editor, I can’t get the split screen option to work at all. In R2024b and R2025a I can right-click on my code, select Split Screen | Top/Bottom, and the screen is split. Alternatively, I can select VIEW | Split Document | Top/Bottom, and I get the same thing. In R2025b these methods don’t seem to do anything for me. It’s not split and there are no error messages. However, if I open the Design App and go to the Code View, the split screen works ok.
Are there any settings that would affect this? Does anyone else have this issue?In MATLAB R2025b, in the Editor, I can’t get the split screen option to work at all. In R2024b and R2025a I can right-click on my code, select Split Screen | Top/Bottom, and the screen is split. Alternatively, I can select VIEW | Split Document | Top/Bottom, and I get the same thing. In R2025b these methods don’t seem to do anything for me. It’s not split and there are no error messages. However, if I open the Design App and go to the Code View, the split screen works ok.
Are there any settings that would affect this? Does anyone else have this issue? In MATLAB R2025b, in the Editor, I can’t get the split screen option to work at all. In R2024b and R2025a I can right-click on my code, select Split Screen | Top/Bottom, and the screen is split. Alternatively, I can select VIEW | Split Document | Top/Bottom, and I get the same thing. In R2025b these methods don’t seem to do anything for me. It’s not split and there are no error messages. However, if I open the Design App and go to the Code View, the split screen works ok.
Are there any settings that would affect this? Does anyone else have this issue? split screen, r2025b MATLAB Answers — New Questions
fitlm returns pvalues equal to NaN without zscoring
I can not understand which is the reason why the fitlm using variables without zscoring returns pvalues equal to NaN, whereas this does not happen using zscored variables. Below you can find the code I used:
medians_var1_scored = nanzscore(medians_var1);
medians_var2_scored = nanzscore(medians_var2);
medians_var1_scored_tr = medians_var1_scored’;
medians_var2_scored_tr = medians_var2_scored’;
tbl=table(medians_var1_scored_tr,medians_var2_scored_tr,’VariableNames’, …
{‘var1′,’var2’});
%build your model
mdl=fitlm(tbl,’var1 ~ var2′,’RobustOpts’,’on’)
which gives this result:
mdl =
Linear regression model (robust fit):
var1 ~ 1 + var2
Estimated Coefficients:
Estimate SE tStat pValue
_________ ________ ________ _______
(Intercept) 0.028674 0.094595 0.30312 0.76234
var2 -0.072919 0.094998 -0.76758 0.44429
Number of observations: 118, Error degrees of freedom: 116
Root Mean Squared Error: 1.03
R-squared: 0.00584, Adjusted R-Squared: -0.00273
F-statistic vs. constant model: 0.681, p-value = 0.411
If instead I use the original variables, I do:
tbl=table(medians_var1′,medians_var2′,’VariableNames’, …
{‘var1′,’var2’});
%build your model
mdl=fitlm(tbl,’var1 ~ var2′,’RobustOpts’,’on’)
and obtain:
mdl =
Linear regression model (robust fit):
var1 ~ 1 + var2
Estimated Coefficients:
Estimate SE tStat pValue
__________ __________ ______ __________
(Intercept) 0 0 NaN NaN
var2 8.6386e-13 2.1087e-14 40.966 7.8796e-71
Number of observations: 118, Error degrees of freedom: 117
Root Mean Squared Error: 31.4
R-squared: 0.263, Adjusted R-Squared: 0.263
F-statistic vs. constant model: Inf, p-value = NaN
I can’t understand why this happens. You can find attached both the original var1 and var2 variables and the zscored ones. But If I plot both of them, I obtain the same plot (just rescaled). Hence, there shouldn’t be a problem in the nanzscore function which is "hand written".I can not understand which is the reason why the fitlm using variables without zscoring returns pvalues equal to NaN, whereas this does not happen using zscored variables. Below you can find the code I used:
medians_var1_scored = nanzscore(medians_var1);
medians_var2_scored = nanzscore(medians_var2);
medians_var1_scored_tr = medians_var1_scored’;
medians_var2_scored_tr = medians_var2_scored’;
tbl=table(medians_var1_scored_tr,medians_var2_scored_tr,’VariableNames’, …
{‘var1′,’var2’});
%build your model
mdl=fitlm(tbl,’var1 ~ var2′,’RobustOpts’,’on’)
which gives this result:
mdl =
Linear regression model (robust fit):
var1 ~ 1 + var2
Estimated Coefficients:
Estimate SE tStat pValue
_________ ________ ________ _______
(Intercept) 0.028674 0.094595 0.30312 0.76234
var2 -0.072919 0.094998 -0.76758 0.44429
Number of observations: 118, Error degrees of freedom: 116
Root Mean Squared Error: 1.03
R-squared: 0.00584, Adjusted R-Squared: -0.00273
F-statistic vs. constant model: 0.681, p-value = 0.411
If instead I use the original variables, I do:
tbl=table(medians_var1′,medians_var2′,’VariableNames’, …
{‘var1′,’var2’});
%build your model
mdl=fitlm(tbl,’var1 ~ var2′,’RobustOpts’,’on’)
and obtain:
mdl =
Linear regression model (robust fit):
var1 ~ 1 + var2
Estimated Coefficients:
Estimate SE tStat pValue
__________ __________ ______ __________
(Intercept) 0 0 NaN NaN
var2 8.6386e-13 2.1087e-14 40.966 7.8796e-71
Number of observations: 118, Error degrees of freedom: 117
Root Mean Squared Error: 31.4
R-squared: 0.263, Adjusted R-Squared: 0.263
F-statistic vs. constant model: Inf, p-value = NaN
I can’t understand why this happens. You can find attached both the original var1 and var2 variables and the zscored ones. But If I plot both of them, I obtain the same plot (just rescaled). Hence, there shouldn’t be a problem in the nanzscore function which is "hand written". I can not understand which is the reason why the fitlm using variables without zscoring returns pvalues equal to NaN, whereas this does not happen using zscored variables. Below you can find the code I used:
medians_var1_scored = nanzscore(medians_var1);
medians_var2_scored = nanzscore(medians_var2);
medians_var1_scored_tr = medians_var1_scored’;
medians_var2_scored_tr = medians_var2_scored’;
tbl=table(medians_var1_scored_tr,medians_var2_scored_tr,’VariableNames’, …
{‘var1′,’var2’});
%build your model
mdl=fitlm(tbl,’var1 ~ var2′,’RobustOpts’,’on’)
which gives this result:
mdl =
Linear regression model (robust fit):
var1 ~ 1 + var2
Estimated Coefficients:
Estimate SE tStat pValue
_________ ________ ________ _______
(Intercept) 0.028674 0.094595 0.30312 0.76234
var2 -0.072919 0.094998 -0.76758 0.44429
Number of observations: 118, Error degrees of freedom: 116
Root Mean Squared Error: 1.03
R-squared: 0.00584, Adjusted R-Squared: -0.00273
F-statistic vs. constant model: 0.681, p-value = 0.411
If instead I use the original variables, I do:
tbl=table(medians_var1′,medians_var2′,’VariableNames’, …
{‘var1′,’var2’});
%build your model
mdl=fitlm(tbl,’var1 ~ var2′,’RobustOpts’,’on’)
and obtain:
mdl =
Linear regression model (robust fit):
var1 ~ 1 + var2
Estimated Coefficients:
Estimate SE tStat pValue
__________ __________ ______ __________
(Intercept) 0 0 NaN NaN
var2 8.6386e-13 2.1087e-14 40.966 7.8796e-71
Number of observations: 118, Error degrees of freedom: 117
Root Mean Squared Error: 31.4
R-squared: 0.263, Adjusted R-Squared: 0.263
F-statistic vs. constant model: Inf, p-value = NaN
I can’t understand why this happens. You can find attached both the original var1 and var2 variables and the zscored ones. But If I plot both of them, I obtain the same plot (just rescaled). Hence, there shouldn’t be a problem in the nanzscore function which is "hand written". fitlm, zscore, pvalue MATLAB Answers — New Questions
How do I uninstall the Network License Manager?
How do I uninstall the Network License Manager?How do I uninstall the Network License Manager? How do I uninstall the Network License Manager? MATLAB Answers — New Questions
How do I download a specific update level of MATLAB into a Docker container?
I’m trying to create a Docker container that has MATLAB installed in it. The images on Docker Hub seem to only download MATLAB at the latest update level. How can I put, for example, R2022b Update 3 into a container?I’m trying to create a Docker container that has MATLAB installed in it. The images on Docker Hub seem to only download MATLAB at the latest update level. How can I put, for example, R2022b Update 3 into a container? I’m trying to create a Docker container that has MATLAB installed in it. The images on Docker Hub seem to only download MATLAB at the latest update level. How can I put, for example, R2022b Update 3 into a container? MATLAB Answers — New Questions
How do I declare a multiline array?
Hello, I have a following problem:
I have to declare an array that is very long and splits into multiple lines. How can I divide it, so that Matlab knows it’s one array? Are there any separators I can use at the end of the line?
if true
y = [180 183 188 191 195 199 201 195 207 210 212 216 220 221 224
221 225 229 234 237 239 242 242 244 245 244 246 245 246 247 249
251 252 257 260 263 268 271 272 275 277 279 283 286 291 296 302
306 311 316]
endHello, I have a following problem:
I have to declare an array that is very long and splits into multiple lines. How can I divide it, so that Matlab knows it’s one array? Are there any separators I can use at the end of the line?
if true
y = [180 183 188 191 195 199 201 195 207 210 212 216 220 221 224
221 225 229 234 237 239 242 242 244 245 244 246 245 246 247 249
251 252 257 260 263 268 271 272 275 277 279 283 286 291 296 302
306 311 316]
end Hello, I have a following problem:
I have to declare an array that is very long and splits into multiple lines. How can I divide it, so that Matlab knows it’s one array? Are there any separators I can use at the end of the line?
if true
y = [180 183 188 191 195 199 201 195 207 210 212 216 220 221 224
221 225 229 234 237 239 242 242 244 245 244 246 245 246 247 249
251 252 257 260 263 268 271 272 275 277 279 283 286 291 296 302
306 311 316]
end multiline, array, split, separator MATLAB Answers — New Questions
Building Toolbox in cI with matlab runtime
Hello experts
I am trying to automate my toolbox creation in gitlab ci and trying to find the best way to do this.
I looked at using the matlab runtime docker for my purpose, looking at the documentation it says matlab runtime docker is used for executing matlab apps, can i also use it to build the toolbox?
Do i need to use the matlab docker with license to build the toolbox?
Is there a lighter matlab installation that serves the purpose?
Any guidance will be appreciated.
ThanksHello experts
I am trying to automate my toolbox creation in gitlab ci and trying to find the best way to do this.
I looked at using the matlab runtime docker for my purpose, looking at the documentation it says matlab runtime docker is used for executing matlab apps, can i also use it to build the toolbox?
Do i need to use the matlab docker with license to build the toolbox?
Is there a lighter matlab installation that serves the purpose?
Any guidance will be appreciated.
Thanks Hello experts
I am trying to automate my toolbox creation in gitlab ci and trying to find the best way to do this.
I looked at using the matlab runtime docker for my purpose, looking at the documentation it says matlab runtime docker is used for executing matlab apps, can i also use it to build the toolbox?
Do i need to use the matlab docker with license to build the toolbox?
Is there a lighter matlab installation that serves the purpose?
Any guidance will be appreciated.
Thanks toolbox, cli MATLAB Answers — New Questions
How to read Audio File into Vector?
Hello, I have to read a Audio File (.wav) into a vector.
I know how to plot it:
info = audioinfo(‘sound.wav’);
[y, Fs] = audioread(‘sound.wav’);
t = 0:1/Fs:info.Duration;
t = t(1:end-1);
plot(t,y);
xlabel(‘Time’);
ylabel(‘Audio Signal’);
But this Sript does not read the Audio into a Vector.
I also tried to read every single Sample, but this is to complex and I get error after error. Is there a simple way to do this?Hello, I have to read a Audio File (.wav) into a vector.
I know how to plot it:
info = audioinfo(‘sound.wav’);
[y, Fs] = audioread(‘sound.wav’);
t = 0:1/Fs:info.Duration;
t = t(1:end-1);
plot(t,y);
xlabel(‘Time’);
ylabel(‘Audio Signal’);
But this Sript does not read the Audio into a Vector.
I also tried to read every single Sample, but this is to complex and I get error after error. Is there a simple way to do this? Hello, I have to read a Audio File (.wav) into a vector.
I know how to plot it:
info = audioinfo(‘sound.wav’);
[y, Fs] = audioread(‘sound.wav’);
t = 0:1/Fs:info.Duration;
t = t(1:end-1);
plot(t,y);
xlabel(‘Time’);
ylabel(‘Audio Signal’);
But this Sript does not read the Audio into a Vector.
I also tried to read every single Sample, but this is to complex and I get error after error. Is there a simple way to do this? vector, audio, sound MATLAB Answers — New Questions
How do I turn this Simulink model with Gain Control to Pole Placement?
Hi All
I have already calculated the gains for acceleration and velocity but my block is state space and gives displacement and velocity. I just dont know , what should I do with displacement, or should I leave disp and vel and only control acceleration with one gain or acc and vel ?? I have added 2 Zero pole blocks, which defined the new gains. but then It seems like State Space is not coincident with this methodHi All
I have already calculated the gains for acceleration and velocity but my block is state space and gives displacement and velocity. I just dont know , what should I do with displacement, or should I leave disp and vel and only control acceleration with one gain or acc and vel ?? I have added 2 Zero pole blocks, which defined the new gains. but then It seems like State Space is not coincident with this method Hi All
I have already calculated the gains for acceleration and velocity but my block is state space and gives displacement and velocity. I just dont know , what should I do with displacement, or should I leave disp and vel and only control acceleration with one gain or acc and vel ?? I have added 2 Zero pole blocks, which defined the new gains. but then It seems like State Space is not coincident with this method simulink, control MATLAB Answers — New Questions
What are the “CA” and “CB” ports in the “Hybrid Stepper Motor” block for the Specialized Power Systems in Simscape R2024b?
I am trying to set up a 4-phase "Hybrid Stepper Motor". When I use a two-phase motor, I am able to connect it according to the documentation. However, when I try to use the four-phase variant, I see two additional ports "CA" and "CB" appear. However, I cannot find references on these ports or how to connect them in the "Stepper Motor" documentation. What is the physical interpretation of these ports?I am trying to set up a 4-phase "Hybrid Stepper Motor". When I use a two-phase motor, I am able to connect it according to the documentation. However, when I try to use the four-phase variant, I see two additional ports "CA" and "CB" appear. However, I cannot find references on these ports or how to connect them in the "Stepper Motor" documentation. What is the physical interpretation of these ports? I am trying to set up a 4-phase "Hybrid Stepper Motor". When I use a two-phase motor, I am able to connect it according to the documentation. However, when I try to use the four-phase variant, I see two additional ports "CA" and "CB" appear. However, I cannot find references on these ports or how to connect them in the "Stepper Motor" documentation. What is the physical interpretation of these ports? phasewinding, specializedpowersystems, simscapeelectrical, steppermotor MATLAB Answers — New Questions
Appdesigner specific file edition issue
After opening a specific .mlapp, each time I go back to the file tab inside appdesigner, I receive an dialog window : "The file has been modified outside of MATLAB Editor. Do you want to reload it?"
I have this problem only with one specific mlapp file. I have other mlapp files in the same directory for which this issue does not appear.
All these mlapp files are saved locally. They were created from guide apps, using Matlab migration tool.
This issue appears since the mlapp file creation with all the different Matlab releases I used since (R2025a on Linux now).After opening a specific .mlapp, each time I go back to the file tab inside appdesigner, I receive an dialog window : "The file has been modified outside of MATLAB Editor. Do you want to reload it?"
I have this problem only with one specific mlapp file. I have other mlapp files in the same directory for which this issue does not appear.
All these mlapp files are saved locally. They were created from guide apps, using Matlab migration tool.
This issue appears since the mlapp file creation with all the different Matlab releases I used since (R2025a on Linux now). After opening a specific .mlapp, each time I go back to the file tab inside appdesigner, I receive an dialog window : "The file has been modified outside of MATLAB Editor. Do you want to reload it?"
I have this problem only with one specific mlapp file. I have other mlapp files in the same directory for which this issue does not appear.
All these mlapp files are saved locally. They were created from guide apps, using Matlab migration tool.
This issue appears since the mlapp file creation with all the different Matlab releases I used since (R2025a on Linux now). appdesigner MATLAB Answers — New Questions
matlab -batch on SLURM prints errors when HOME is shared across many nodes
When launching MATLAB in batch mode on a SLURM cluster, stderr shows:
terminate called after throwing an instance of ‘matlabconnector::installationsregistry::InstallationsRegistryError’
what(): InstallationsRegistry:getMatlabConnectorVersion: More than one MATLAB Connector records were found
This appears during startup (even for a simple command like matlab -batch "disp(version); exit").
sbatch command (PROGLIST=/work/share/…/matlab2024a/bin/matlab):
srun "$PROGLIST" -batch "$CMD"
Find files in ~/.MATLABConnector as below:
~/.MATLABConnector/b01r2n13/LatestInstall.info
~/.MATLABConnector/b01r2n13/UpdatePending.json
~/.MATLABConnector/b01r2n13/locks
~/.MATLABConnector/b02r2n01/LatestInstall.info
~/.MATLABConnector/b02r2n01/UpdatePending.json
~/.MATLABConnector/b02r2n01/locks
…
Questions
Is this a known issue with MATLAB Connector on HPC systems where $HOME is shared across many nodes?
How to prevent MATLAB from throwing this error at startup?When launching MATLAB in batch mode on a SLURM cluster, stderr shows:
terminate called after throwing an instance of ‘matlabconnector::installationsregistry::InstallationsRegistryError’
what(): InstallationsRegistry:getMatlabConnectorVersion: More than one MATLAB Connector records were found
This appears during startup (even for a simple command like matlab -batch "disp(version); exit").
sbatch command (PROGLIST=/work/share/…/matlab2024a/bin/matlab):
srun "$PROGLIST" -batch "$CMD"
Find files in ~/.MATLABConnector as below:
~/.MATLABConnector/b01r2n13/LatestInstall.info
~/.MATLABConnector/b01r2n13/UpdatePending.json
~/.MATLABConnector/b01r2n13/locks
~/.MATLABConnector/b02r2n01/LatestInstall.info
~/.MATLABConnector/b02r2n01/UpdatePending.json
~/.MATLABConnector/b02r2n01/locks
…
Questions
Is this a known issue with MATLAB Connector on HPC systems where $HOME is shared across many nodes?
How to prevent MATLAB from throwing this error at startup? When launching MATLAB in batch mode on a SLURM cluster, stderr shows:
terminate called after throwing an instance of ‘matlabconnector::installationsregistry::InstallationsRegistryError’
what(): InstallationsRegistry:getMatlabConnectorVersion: More than one MATLAB Connector records were found
This appears during startup (even for a simple command like matlab -batch "disp(version); exit").
sbatch command (PROGLIST=/work/share/…/matlab2024a/bin/matlab):
srun "$PROGLIST" -batch "$CMD"
Find files in ~/.MATLABConnector as below:
~/.MATLABConnector/b01r2n13/LatestInstall.info
~/.MATLABConnector/b01r2n13/UpdatePending.json
~/.MATLABConnector/b01r2n13/locks
~/.MATLABConnector/b02r2n01/LatestInstall.info
~/.MATLABConnector/b02r2n01/UpdatePending.json
~/.MATLABConnector/b02r2n01/locks
…
Questions
Is this a known issue with MATLAB Connector on HPC systems where $HOME is shared across many nodes?
How to prevent MATLAB from throwing this error at startup? linux, batch MATLAB Answers — New Questions
Construct voronoi diagram on a point cloud
I have a point cloud file in the .pcd format. I want to calculate a Voronoi diagram for this .pcd file. I also have a set of points with x and y coordinates that were extracted from the .pcd file. I want to calculate the Voronoi diagram based on these x and y coordinates. My objective is to divide the point cloud into zones corresponding to these points (x, y). So far, I have written the following code but it seems like there is no connection between the point cloud and x-y coordinates. How can I relate the point cloud and the co ordinates?
ptCloud = pcread("test_obj6.pcd");
x = [ 7.0267 4.8436 4.8767 2.8000];
y = [ 4.2001 4.5947 2.1412 3.2000];
voronoi(x,y)I have a point cloud file in the .pcd format. I want to calculate a Voronoi diagram for this .pcd file. I also have a set of points with x and y coordinates that were extracted from the .pcd file. I want to calculate the Voronoi diagram based on these x and y coordinates. My objective is to divide the point cloud into zones corresponding to these points (x, y). So far, I have written the following code but it seems like there is no connection between the point cloud and x-y coordinates. How can I relate the point cloud and the co ordinates?
ptCloud = pcread("test_obj6.pcd");
x = [ 7.0267 4.8436 4.8767 2.8000];
y = [ 4.2001 4.5947 2.1412 3.2000];
voronoi(x,y) I have a point cloud file in the .pcd format. I want to calculate a Voronoi diagram for this .pcd file. I also have a set of points with x and y coordinates that were extracted from the .pcd file. I want to calculate the Voronoi diagram based on these x and y coordinates. My objective is to divide the point cloud into zones corresponding to these points (x, y). So far, I have written the following code but it seems like there is no connection between the point cloud and x-y coordinates. How can I relate the point cloud and the co ordinates?
ptCloud = pcread("test_obj6.pcd");
x = [ 7.0267 4.8436 4.8767 2.8000];
y = [ 4.2001 4.5947 2.1412 3.2000];
voronoi(x,y) matlab MATLAB Answers — New Questions
This simulation is given from website but i am unable to understand how these blocks and subsystem works togather , can anyone explain briefly
Post Content Post Content dfig npc converter MATLAB Answers — New Questions









