Category: Matlab
Category Archives: Matlab
Why did I get duplicate variables in my workspace after changing their names?
(I did solve this problem but I haven’t been able to repeat it. I hope it’s okay to ask here anyway because I am curious if anyone has an explanation. I will describe below what solved it and how I have tried to repeat it. Couldn’t find any threads describing this anywhere.)
I had a few variables in my script with names starting with capital letters that I wanted to change to lowercase first letters. For example I wanted to change "Flux_th" to "flux_th". See code example below with only the relevant lines from my script.
load(‘dataNucGlobal_nuc.mat’)
load(‘dataNucGlobal_reac.mat’)
Flux_th = 42078172084928.6; % [neutrons/cm2/s]
I used the shift+enter function in matlab to change "Flux_th" to "flux_th" (same with the other variables).
I cleared my workspace, I ran the script (like below) and got BOTH "Flux_th" and "flux_th" in my workspace (they have the same value).
load(‘dataNucGlobal_nuc.mat’)
load(‘dataNucGlobal_reac.mat’)
flux_th = 42078172084928.6; % [neutrons/cm2/s]
I tried changing back to capital letters on "Flux_th" and doing the same thing again but it still gave me duplicates.
I am pretty sure that I tried manually deleting the duplicates with capital letters in the workspace and then running the script, but that also gave me duplicates.
It happened again even after restarting matlab.
What DID actually solve the problem is the following sequence:
I cleared the workspace, then I ran this separate script that creates and saves the .mat files, that script looks like this:
%% Global nuclear data
%data for reactions
dataNucGlobal_reac = table(‘Size’,[0,3], ‘VariableTypes’,["double", "double", "string"],’VariableNames’,["barn";"isotopefrac";"reference"]);
dataNucGlobal_reac(‘O16 (n,p) N16: s-f’, 🙂 = {2.026e-5, 99.76, "ENDL"};
save(‘dataNucGlobal_reac’)
%data for nuclides
dataNucGlobal_nuc = table(‘Size’,[0,3], ‘VariableTypes’,["double", "double", "string"],’VariableNames’,["halflife_s"; "decayconst"; "reference"]);
dataNucGlobal_nuc(‘N16’, 🙂 = {7.12, log(2)/7.12, "?"};
save(‘dataNucGlobal_nuc’)
Then I ran my original script without the load lines like this:
% load(‘dataNucGlobal_nuc.mat’)
% load(‘dataNucGlobal_reac.mat’)
flux_th = 42078172084928.6; % [neutrons/cm2/s]
This time I did not get any duplicates, so I cleared my workspace again and reinserted the load lines and finally ran the script like this:
load(‘dataNucGlobal_nuc.mat’)
load(‘dataNucGlobal_reac.mat’)
flux_th = 42078172084928.6; % [neutrons/cm2/s]
Now everything is working and I can’t reproduce what happened by changing variable names from capital to lowercase letters.
I am super confused because as you can see, the .mat-files DO NOT contain any of the variables that became duplicates, so it doesn’t make any sense that this would help. I have no idea what happened so that is why I am asking here.(I did solve this problem but I haven’t been able to repeat it. I hope it’s okay to ask here anyway because I am curious if anyone has an explanation. I will describe below what solved it and how I have tried to repeat it. Couldn’t find any threads describing this anywhere.)
I had a few variables in my script with names starting with capital letters that I wanted to change to lowercase first letters. For example I wanted to change "Flux_th" to "flux_th". See code example below with only the relevant lines from my script.
load(‘dataNucGlobal_nuc.mat’)
load(‘dataNucGlobal_reac.mat’)
Flux_th = 42078172084928.6; % [neutrons/cm2/s]
I used the shift+enter function in matlab to change "Flux_th" to "flux_th" (same with the other variables).
I cleared my workspace, I ran the script (like below) and got BOTH "Flux_th" and "flux_th" in my workspace (they have the same value).
load(‘dataNucGlobal_nuc.mat’)
load(‘dataNucGlobal_reac.mat’)
flux_th = 42078172084928.6; % [neutrons/cm2/s]
I tried changing back to capital letters on "Flux_th" and doing the same thing again but it still gave me duplicates.
I am pretty sure that I tried manually deleting the duplicates with capital letters in the workspace and then running the script, but that also gave me duplicates.
It happened again even after restarting matlab.
What DID actually solve the problem is the following sequence:
I cleared the workspace, then I ran this separate script that creates and saves the .mat files, that script looks like this:
%% Global nuclear data
%data for reactions
dataNucGlobal_reac = table(‘Size’,[0,3], ‘VariableTypes’,["double", "double", "string"],’VariableNames’,["barn";"isotopefrac";"reference"]);
dataNucGlobal_reac(‘O16 (n,p) N16: s-f’, 🙂 = {2.026e-5, 99.76, "ENDL"};
save(‘dataNucGlobal_reac’)
%data for nuclides
dataNucGlobal_nuc = table(‘Size’,[0,3], ‘VariableTypes’,["double", "double", "string"],’VariableNames’,["halflife_s"; "decayconst"; "reference"]);
dataNucGlobal_nuc(‘N16’, 🙂 = {7.12, log(2)/7.12, "?"};
save(‘dataNucGlobal_nuc’)
Then I ran my original script without the load lines like this:
% load(‘dataNucGlobal_nuc.mat’)
% load(‘dataNucGlobal_reac.mat’)
flux_th = 42078172084928.6; % [neutrons/cm2/s]
This time I did not get any duplicates, so I cleared my workspace again and reinserted the load lines and finally ran the script like this:
load(‘dataNucGlobal_nuc.mat’)
load(‘dataNucGlobal_reac.mat’)
flux_th = 42078172084928.6; % [neutrons/cm2/s]
Now everything is working and I can’t reproduce what happened by changing variable names from capital to lowercase letters.
I am super confused because as you can see, the .mat-files DO NOT contain any of the variables that became duplicates, so it doesn’t make any sense that this would help. I have no idea what happened so that is why I am asking here. (I did solve this problem but I haven’t been able to repeat it. I hope it’s okay to ask here anyway because I am curious if anyone has an explanation. I will describe below what solved it and how I have tried to repeat it. Couldn’t find any threads describing this anywhere.)
I had a few variables in my script with names starting with capital letters that I wanted to change to lowercase first letters. For example I wanted to change "Flux_th" to "flux_th". See code example below with only the relevant lines from my script.
load(‘dataNucGlobal_nuc.mat’)
load(‘dataNucGlobal_reac.mat’)
Flux_th = 42078172084928.6; % [neutrons/cm2/s]
I used the shift+enter function in matlab to change "Flux_th" to "flux_th" (same with the other variables).
I cleared my workspace, I ran the script (like below) and got BOTH "Flux_th" and "flux_th" in my workspace (they have the same value).
load(‘dataNucGlobal_nuc.mat’)
load(‘dataNucGlobal_reac.mat’)
flux_th = 42078172084928.6; % [neutrons/cm2/s]
I tried changing back to capital letters on "Flux_th" and doing the same thing again but it still gave me duplicates.
I am pretty sure that I tried manually deleting the duplicates with capital letters in the workspace and then running the script, but that also gave me duplicates.
It happened again even after restarting matlab.
What DID actually solve the problem is the following sequence:
I cleared the workspace, then I ran this separate script that creates and saves the .mat files, that script looks like this:
%% Global nuclear data
%data for reactions
dataNucGlobal_reac = table(‘Size’,[0,3], ‘VariableTypes’,["double", "double", "string"],’VariableNames’,["barn";"isotopefrac";"reference"]);
dataNucGlobal_reac(‘O16 (n,p) N16: s-f’, 🙂 = {2.026e-5, 99.76, "ENDL"};
save(‘dataNucGlobal_reac’)
%data for nuclides
dataNucGlobal_nuc = table(‘Size’,[0,3], ‘VariableTypes’,["double", "double", "string"],’VariableNames’,["halflife_s"; "decayconst"; "reference"]);
dataNucGlobal_nuc(‘N16’, 🙂 = {7.12, log(2)/7.12, "?"};
save(‘dataNucGlobal_nuc’)
Then I ran my original script without the load lines like this:
% load(‘dataNucGlobal_nuc.mat’)
% load(‘dataNucGlobal_reac.mat’)
flux_th = 42078172084928.6; % [neutrons/cm2/s]
This time I did not get any duplicates, so I cleared my workspace again and reinserted the load lines and finally ran the script like this:
load(‘dataNucGlobal_nuc.mat’)
load(‘dataNucGlobal_reac.mat’)
flux_th = 42078172084928.6; % [neutrons/cm2/s]
Now everything is working and I can’t reproduce what happened by changing variable names from capital to lowercase letters.
I am super confused because as you can see, the .mat-files DO NOT contain any of the variables that became duplicates, so it doesn’t make any sense that this would help. I have no idea what happened so that is why I am asking here. variable-names, duplicates MATLAB Answers — New Questions
Field-Oriented Control of PMSM Using Reinforcement Learning code
Does anyone know where to find that Matlab code for the example presented
Field-Oriented Control of PMSM Using Reinforcement Learning
the is shown below but Matlab does not seem to have this code:
https://www.mathworks.com/help/mcb/gs/foc-of-pmsm-using-reinforcement-learning.htmlDoes anyone know where to find that Matlab code for the example presented
Field-Oriented Control of PMSM Using Reinforcement Learning
the is shown below but Matlab does not seem to have this code:
https://www.mathworks.com/help/mcb/gs/foc-of-pmsm-using-reinforcement-learning.html Does anyone know where to find that Matlab code for the example presented
Field-Oriented Control of PMSM Using Reinforcement Learning
the is shown below but Matlab does not seem to have this code:
https://www.mathworks.com/help/mcb/gs/foc-of-pmsm-using-reinforcement-learning.html @john MATLAB Answers — New Questions
Unrecognized property Value for class Axes?
Hi all,
I have been trying to create a CT scan viewer through Matlab.
It is up and running, however, I am getting the error Unrecognized property Value for class Axes whenever I change and image.
It hightlights these two lines of code for me.
% Add listener to the slider to call a function when its value changes
addlistener(hSlider, ‘Value’, ‘PostSet’, @(src, event) updateImage(src, event, hAxes, dicomImages));
and
% Get the current value of the slider
sliderValue = round(get(hAxes.Parent.Children(2), ‘Value’)); % hAxes.Parent.Children(2) is the slider handle
Would anyone know where I went wrong?Hi all,
I have been trying to create a CT scan viewer through Matlab.
It is up and running, however, I am getting the error Unrecognized property Value for class Axes whenever I change and image.
It hightlights these two lines of code for me.
% Add listener to the slider to call a function when its value changes
addlistener(hSlider, ‘Value’, ‘PostSet’, @(src, event) updateImage(src, event, hAxes, dicomImages));
and
% Get the current value of the slider
sliderValue = round(get(hAxes.Parent.Children(2), ‘Value’)); % hAxes.Parent.Children(2) is the slider handle
Would anyone know where I went wrong? Hi all,
I have been trying to create a CT scan viewer through Matlab.
It is up and running, however, I am getting the error Unrecognized property Value for class Axes whenever I change and image.
It hightlights these two lines of code for me.
% Add listener to the slider to call a function when its value changes
addlistener(hSlider, ‘Value’, ‘PostSet’, @(src, event) updateImage(src, event, hAxes, dicomImages));
and
% Get the current value of the slider
sliderValue = round(get(hAxes.Parent.Children(2), ‘Value’)); % hAxes.Parent.Children(2) is the slider handle
Would anyone know where I went wrong? dicom, slider, matlab gui, image processing MATLAB Answers — New Questions
How do I save each response in an excel file every time I click the submit button?
It currently only saves the recent response and not the previous response as well.
function SubmitButtonPushed(app, event)
data = {firstName, lastName, dob, email, nationality, sex, mobileNumber, type};
passengerData = cell2table(data, ‘VariableNames’, {‘First Name’, ‘Last Name’, ‘Date of Birth’, ‘Email’, ‘Nationality’, ‘Sex’, ‘Mobile Number’, ‘Type’});
disp(‘New Passenger Data: ‘)
disp(passengerData)
filename = ‘passengerDetails.xlsx’;
if isfile(filename)
existingData = readtable(filename);
combinedData = [existingData; passengerData];
else
combinedData = passengerData;
end
writetable(combinedData,filename, ‘WriteMode’,’append’);
disp(‘Combined Data: ‘)
disp(combinedData)
new_line = randn(1,9);
sheetName = sprintf(‘Submission_%d’, submissionCount);
writematrix(new_line, filename, ‘Sheet’, sheetName, ‘WriteMode’, ‘overwrite’);
submissionCount = submissionCount + 1;
msgbox(‘Successfully submitted’,’Success’);
delete(app);It currently only saves the recent response and not the previous response as well.
function SubmitButtonPushed(app, event)
data = {firstName, lastName, dob, email, nationality, sex, mobileNumber, type};
passengerData = cell2table(data, ‘VariableNames’, {‘First Name’, ‘Last Name’, ‘Date of Birth’, ‘Email’, ‘Nationality’, ‘Sex’, ‘Mobile Number’, ‘Type’});
disp(‘New Passenger Data: ‘)
disp(passengerData)
filename = ‘passengerDetails.xlsx’;
if isfile(filename)
existingData = readtable(filename);
combinedData = [existingData; passengerData];
else
combinedData = passengerData;
end
writetable(combinedData,filename, ‘WriteMode’,’append’);
disp(‘Combined Data: ‘)
disp(combinedData)
new_line = randn(1,9);
sheetName = sprintf(‘Submission_%d’, submissionCount);
writematrix(new_line, filename, ‘Sheet’, sheetName, ‘WriteMode’, ‘overwrite’);
submissionCount = submissionCount + 1;
msgbox(‘Successfully submitted’,’Success’);
delete(app); It currently only saves the recent response and not the previous response as well.
function SubmitButtonPushed(app, event)
data = {firstName, lastName, dob, email, nationality, sex, mobileNumber, type};
passengerData = cell2table(data, ‘VariableNames’, {‘First Name’, ‘Last Name’, ‘Date of Birth’, ‘Email’, ‘Nationality’, ‘Sex’, ‘Mobile Number’, ‘Type’});
disp(‘New Passenger Data: ‘)
disp(passengerData)
filename = ‘passengerDetails.xlsx’;
if isfile(filename)
existingData = readtable(filename);
combinedData = [existingData; passengerData];
else
combinedData = passengerData;
end
writetable(combinedData,filename, ‘WriteMode’,’append’);
disp(‘Combined Data: ‘)
disp(combinedData)
new_line = randn(1,9);
sheetName = sprintf(‘Submission_%d’, submissionCount);
writematrix(new_line, filename, ‘Sheet’, sheetName, ‘WriteMode’, ‘overwrite’);
submissionCount = submissionCount + 1;
msgbox(‘Successfully submitted’,’Success’);
delete(app); matlab, excel, table MATLAB Answers — New Questions
How can you use MATLAB Grader in Moodle Quizzes?
MATLAB Grader can be integrated into Moodle as an external tool. How can you use MATLAB Grader in Moodle Quizzes, to implement MATLAB Grader as a quiz question?MATLAB Grader can be integrated into Moodle as an external tool. How can you use MATLAB Grader in Moodle Quizzes, to implement MATLAB Grader as a quiz question? MATLAB Grader can be integrated into Moodle as an external tool. How can you use MATLAB Grader in Moodle Quizzes, to implement MATLAB Grader as a quiz question? distance_learning, moodle, matlab grader MATLAB Answers — New Questions
How to use all cores for running a Simulink model?
Hi,
I modeled a thermal-fluid network in Simulink with Simscape modules and I want to use all cores in order to speed up my simulation.
I am using a workstation with 64 physical cores and 128 logical cores, but I get the same run-time as when I run the model on my Laptop with 6 physical cores and 12 logical cores. What should I do that Simulink uses all the capacity of my workstation for running a model?
I would appreciate if you could help me.Hi,
I modeled a thermal-fluid network in Simulink with Simscape modules and I want to use all cores in order to speed up my simulation.
I am using a workstation with 64 physical cores and 128 logical cores, but I get the same run-time as when I run the model on my Laptop with 6 physical cores and 12 logical cores. What should I do that Simulink uses all the capacity of my workstation for running a model?
I would appreciate if you could help me. Hi,
I modeled a thermal-fluid network in Simulink with Simscape modules and I want to use all cores in order to speed up my simulation.
I am using a workstation with 64 physical cores and 128 logical cores, but I get the same run-time as when I run the model on my Laptop with 6 physical cores and 12 logical cores. What should I do that Simulink uses all the capacity of my workstation for running a model?
I would appreciate if you could help me. parallel computing in simulink MATLAB Answers — New Questions
Trend Micro’s security software prevents MATLAB’s access to “MATLABWindow.exe” file, inhibiting web-based applications from running.
Why am I unable to use web-based applications such as Simulink, App Designer, Simscape, etc.?Why am I unable to use web-based applications such as Simulink, App Designer, Simscape, etc.? Why am I unable to use web-based applications such as Simulink, App Designer, Simscape, etc.? trendmicro, antivirus, exit, code, 1073741819, matlab.internal.cef.webwindow MATLAB Answers — New Questions
Accessing parameters in encrypted models
I have an encrypted Simulink model with some tunable parameters. I can change them by right-clicking on the model and choosing ‘Block Parameters (ModelReference)’. However, unlike other (nonencrypted) blocks, I can’t change them by using ‘set_param’. Is there any way of accessing these parameters from the command line? I’m using Simulink R2015b.I have an encrypted Simulink model with some tunable parameters. I can change them by right-clicking on the model and choosing ‘Block Parameters (ModelReference)’. However, unlike other (nonencrypted) blocks, I can’t change them by using ‘set_param’. Is there any way of accessing these parameters from the command line? I’m using Simulink R2015b. I have an encrypted Simulink model with some tunable parameters. I can change them by right-clicking on the model and choosing ‘Block Parameters (ModelReference)’. However, unlike other (nonencrypted) blocks, I can’t change them by using ‘set_param’. Is there any way of accessing these parameters from the command line? I’m using Simulink R2015b. encrypted model, parameters, set_param MATLAB Answers — New Questions
App designer generated app freezes in function “createComponents(app)”
Hi
I’ve written an application using App Designer with 100s of components. When I start the app it freezes during the build of the components in the App Designer generated function createComponents. This happens before my own code starts to execute. The way to avoid this freeze is to add a breakpont far down in the createComponents function. createComponents is called before registerApp and runStartupFcn is called. All the mentioned functions are generated before my own code start to execute and are generated by App Designer and are therefore grayed out which means I can’t do any edits.
Is this freeze problem known to this community and is there a fix for this?
Is there any way for me to edit the App Designer generated functions? I would like to add a pause instead of a breakpoint as a possible way to solve the freeze in createComponents function…
I’m running Matlab R2022a Update 8.
Most grateful for your hints and tipsHi
I’ve written an application using App Designer with 100s of components. When I start the app it freezes during the build of the components in the App Designer generated function createComponents. This happens before my own code starts to execute. The way to avoid this freeze is to add a breakpont far down in the createComponents function. createComponents is called before registerApp and runStartupFcn is called. All the mentioned functions are generated before my own code start to execute and are generated by App Designer and are therefore grayed out which means I can’t do any edits.
Is this freeze problem known to this community and is there a fix for this?
Is there any way for me to edit the App Designer generated functions? I would like to add a pause instead of a breakpoint as a possible way to solve the freeze in createComponents function…
I’m running Matlab R2022a Update 8.
Most grateful for your hints and tips Hi
I’ve written an application using App Designer with 100s of components. When I start the app it freezes during the build of the components in the App Designer generated function createComponents. This happens before my own code starts to execute. The way to avoid this freeze is to add a breakpont far down in the createComponents function. createComponents is called before registerApp and runStartupFcn is called. All the mentioned functions are generated before my own code start to execute and are generated by App Designer and are therefore grayed out which means I can’t do any edits.
Is this freeze problem known to this community and is there a fix for this?
Is there any way for me to edit the App Designer generated functions? I would like to add a pause instead of a breakpoint as a possible way to solve the freeze in createComponents function…
I’m running Matlab R2022a Update 8.
Most grateful for your hints and tips appdesigner, createcomponents MATLAB Answers — New Questions
Fit data to lagged custom function
Hello,
I would like to ask if you can advice the correct approach I can follow to estimate the parameters of a custom lagged function
(1) y(t)=c^2*a+y(t-1)*(a-1)
where c is a known constant.
to a time series data (I can use the symbilic function to create (1) )
Thank you.
Best regards
PaoloHello,
I would like to ask if you can advice the correct approach I can follow to estimate the parameters of a custom lagged function
(1) y(t)=c^2*a+y(t-1)*(a-1)
where c is a known constant.
to a time series data (I can use the symbilic function to create (1) )
Thank you.
Best regards
Paolo Hello,
I would like to ask if you can advice the correct approach I can follow to estimate the parameters of a custom lagged function
(1) y(t)=c^2*a+y(t-1)*(a-1)
where c is a known constant.
to a time series data (I can use the symbilic function to create (1) )
Thank you.
Best regards
Paolo curve fitting, time series MATLAB Answers — New Questions
Simulink mask: show/hide the port of a custom Simulink block
Hi guys,
I am creating a mask for my custom block and I want add a checkbox with the following behaviour:
checked: it shows a new port the the block
unhecked: it hides the new port for the block
The integrator block has the same behaviour (see the belows images to understand):
I am struggling how to implement this feature in the Checkbox callback because I can’t find the parameter to show/hide the port.Hi guys,
I am creating a mask for my custom block and I want add a checkbox with the following behaviour:
checked: it shows a new port the the block
unhecked: it hides the new port for the block
The integrator block has the same behaviour (see the belows images to understand):
I am struggling how to implement this feature in the Checkbox callback because I can’t find the parameter to show/hide the port. Hi guys,
I am creating a mask for my custom block and I want add a checkbox with the following behaviour:
checked: it shows a new port the the block
unhecked: it hides the new port for the block
The integrator block has the same behaviour (see the belows images to understand):
I am struggling how to implement this feature in the Checkbox callback because I can’t find the parameter to show/hide the port. simulink, mask, integrator, custom MATLAB Answers — New Questions
Compilation Error encountered while running Polyspace Bug Finder.
Version : R2021a
language : C
C version : C11
Compiler : ti
Target : C28x
Project : TMS320F28374s
Error :
—
File D:CCS_workspacePolyspace testPatriotSafetyMonitor_SL1_SL2_20240710_058.000_Gen3C2000_18_12_2_LTS_Includestdlib.h line 294
Error: declaration is incompatible with "long __euclidean_div_i32byu32(long, unsigned long, unsigned long)" (declared at line 50 of "C:Program FilesPolyspaceR2021apolyspaceverifierextensionstitmw_builtinsc28x.h")
__euclidean_div_i32byu32(long numerator, unsigned long denominator);
^
When performing Bug Finder analysis, an incompatibility occurs between Polyspace’s C28x.h and my .h file. However, the same program does not exhibit these issues on some computers. I hope to identify the true cause to ensure the program is error-free. Could you please explain the role of C28x.h in the analysis? Additionally, is it reasonable to modify C28x.h?Version : R2021a
language : C
C version : C11
Compiler : ti
Target : C28x
Project : TMS320F28374s
Error :
—
File D:CCS_workspacePolyspace testPatriotSafetyMonitor_SL1_SL2_20240710_058.000_Gen3C2000_18_12_2_LTS_Includestdlib.h line 294
Error: declaration is incompatible with "long __euclidean_div_i32byu32(long, unsigned long, unsigned long)" (declared at line 50 of "C:Program FilesPolyspaceR2021apolyspaceverifierextensionstitmw_builtinsc28x.h")
__euclidean_div_i32byu32(long numerator, unsigned long denominator);
^
When performing Bug Finder analysis, an incompatibility occurs between Polyspace’s C28x.h and my .h file. However, the same program does not exhibit these issues on some computers. I hope to identify the true cause to ensure the program is error-free. Could you please explain the role of C28x.h in the analysis? Additionally, is it reasonable to modify C28x.h? Version : R2021a
language : C
C version : C11
Compiler : ti
Target : C28x
Project : TMS320F28374s
Error :
—
File D:CCS_workspacePolyspace testPatriotSafetyMonitor_SL1_SL2_20240710_058.000_Gen3C2000_18_12_2_LTS_Includestdlib.h line 294
Error: declaration is incompatible with "long __euclidean_div_i32byu32(long, unsigned long, unsigned long)" (declared at line 50 of "C:Program FilesPolyspaceR2021apolyspaceverifierextensionstitmw_builtinsc28x.h")
__euclidean_div_i32byu32(long numerator, unsigned long denominator);
^
When performing Bug Finder analysis, an incompatibility occurs between Polyspace’s C28x.h and my .h file. However, the same program does not exhibit these issues on some computers. I hope to identify the true cause to ensure the program is error-free. Could you please explain the role of C28x.h in the analysis? Additionally, is it reasonable to modify C28x.h? polyspace, bug finder MATLAB Answers — New Questions
Effect size, statistical power of the test, and confidence interval (of hypothesis testing)
I am using the following two-sample tests for non-normal distributions:
chi2gof
kstest2
ranksum
kruskalwallis
All of them return a p-value, i.e. a p-value for chi2gof, a p-value for kstest2, a p-value for ranksum, and a p-value for kruskalwallis.
Since the p-value is not enough to understand the data/distributions (for example, please see Sullivan & Feinn (2012), Dunkler et al.(2020), Greenland (2016), and du Prel et al. (2009)), I would like to calculate the effect size, the statistical power of the test, and the confidence interval (of hypothesis testing).
I would use the following MATLAB functions:
meanEffectSize (two-sample effect size computations)
sampsizepwr (power of the test)
not found anything about the confidence interval..
However:
I am not sure if both functions, meanEffectSize and sampsizepwr, can be "compatible" with (i) non-normal distributions and (ii) with the 4 previously mentioned tests.
According to the documentation I found on sampsizepwr, it looks like that the calculation of the statistical power of the test works only with normal distributions, but I am not sure.
Those 4 mentioned tests do not provide the confidence interval. Maybe other MATLAB function do, but I was not able to find them.
I have then 2 questions:
Question 1. Is there anyone who could kindly enlighten me on the "compatibility" of meanEffectSize and sampsizepw with with (i) non-normal distributions and (ii) with the 4 previously mentioned tests?
Question 2. Is there anyone who could kindly tell me if there are MATLAB functions to calculate the confidence intervals for the 4 mentioned statistical tests?I am using the following two-sample tests for non-normal distributions:
chi2gof
kstest2
ranksum
kruskalwallis
All of them return a p-value, i.e. a p-value for chi2gof, a p-value for kstest2, a p-value for ranksum, and a p-value for kruskalwallis.
Since the p-value is not enough to understand the data/distributions (for example, please see Sullivan & Feinn (2012), Dunkler et al.(2020), Greenland (2016), and du Prel et al. (2009)), I would like to calculate the effect size, the statistical power of the test, and the confidence interval (of hypothesis testing).
I would use the following MATLAB functions:
meanEffectSize (two-sample effect size computations)
sampsizepwr (power of the test)
not found anything about the confidence interval..
However:
I am not sure if both functions, meanEffectSize and sampsizepwr, can be "compatible" with (i) non-normal distributions and (ii) with the 4 previously mentioned tests.
According to the documentation I found on sampsizepwr, it looks like that the calculation of the statistical power of the test works only with normal distributions, but I am not sure.
Those 4 mentioned tests do not provide the confidence interval. Maybe other MATLAB function do, but I was not able to find them.
I have then 2 questions:
Question 1. Is there anyone who could kindly enlighten me on the "compatibility" of meanEffectSize and sampsizepw with with (i) non-normal distributions and (ii) with the 4 previously mentioned tests?
Question 2. Is there anyone who could kindly tell me if there are MATLAB functions to calculate the confidence intervals for the 4 mentioned statistical tests? I am using the following two-sample tests for non-normal distributions:
chi2gof
kstest2
ranksum
kruskalwallis
All of them return a p-value, i.e. a p-value for chi2gof, a p-value for kstest2, a p-value for ranksum, and a p-value for kruskalwallis.
Since the p-value is not enough to understand the data/distributions (for example, please see Sullivan & Feinn (2012), Dunkler et al.(2020), Greenland (2016), and du Prel et al. (2009)), I would like to calculate the effect size, the statistical power of the test, and the confidence interval (of hypothesis testing).
I would use the following MATLAB functions:
meanEffectSize (two-sample effect size computations)
sampsizepwr (power of the test)
not found anything about the confidence interval..
However:
I am not sure if both functions, meanEffectSize and sampsizepwr, can be "compatible" with (i) non-normal distributions and (ii) with the 4 previously mentioned tests.
According to the documentation I found on sampsizepwr, it looks like that the calculation of the statistical power of the test works only with normal distributions, but I am not sure.
Those 4 mentioned tests do not provide the confidence interval. Maybe other MATLAB function do, but I was not able to find them.
I have then 2 questions:
Question 1. Is there anyone who could kindly enlighten me on the "compatibility" of meanEffectSize and sampsizepw with with (i) non-normal distributions and (ii) with the 4 previously mentioned tests?
Question 2. Is there anyone who could kindly tell me if there are MATLAB functions to calculate the confidence intervals for the 4 mentioned statistical tests? effect size, statistical power, confidence interval, chi2gof, kstest2, ranksum, kruskalwallis MATLAB Answers — New Questions
Tuning ExperienceHorizon hyperparamter for PPO agent (Reinforcement Learning)
Hello everyone,
I’m trying to train a PPO agent, and I would like to change the value for the ExperienceHorizon hyperparameter (Options for PPO agent – MATLAB – MathWorks Switzerland)
When I try another value than the default, the agent wait for the end of the episode to update its policy. For example, ExperienceHorizon=1024 don’t work for me, dispite the episode’s lenght of more than 1024 steps. I’m also not using Parallel training.
I also get the same issue if I change the MiniBatchSize from its default value.
Is there anything I’ve missed about this parameter?
More infos on PPO algorithms: Proximal Policy Optimization (PPO) Agents – MATLAB & Simulink – MathWorks Switzerland
If anyone could help, that would be very nice!
Thanks a lot in advance,
NicolasHello everyone,
I’m trying to train a PPO agent, and I would like to change the value for the ExperienceHorizon hyperparameter (Options for PPO agent – MATLAB – MathWorks Switzerland)
When I try another value than the default, the agent wait for the end of the episode to update its policy. For example, ExperienceHorizon=1024 don’t work for me, dispite the episode’s lenght of more than 1024 steps. I’m also not using Parallel training.
I also get the same issue if I change the MiniBatchSize from its default value.
Is there anything I’ve missed about this parameter?
More infos on PPO algorithms: Proximal Policy Optimization (PPO) Agents – MATLAB & Simulink – MathWorks Switzerland
If anyone could help, that would be very nice!
Thanks a lot in advance,
Nicolas Hello everyone,
I’m trying to train a PPO agent, and I would like to change the value for the ExperienceHorizon hyperparameter (Options for PPO agent – MATLAB – MathWorks Switzerland)
When I try another value than the default, the agent wait for the end of the episode to update its policy. For example, ExperienceHorizon=1024 don’t work for me, dispite the episode’s lenght of more than 1024 steps. I’m also not using Parallel training.
I also get the same issue if I change the MiniBatchSize from its default value.
Is there anything I’ve missed about this parameter?
More infos on PPO algorithms: Proximal Policy Optimization (PPO) Agents – MATLAB & Simulink – MathWorks Switzerland
If anyone could help, that would be very nice!
Thanks a lot in advance,
Nicolas ppo agents, reinforcement learning, experience horizon MATLAB Answers — New Questions
is it possible to see what variables and functions affecting a certain variable ?
hello everyone,
i am having a little problem, i need to figure out what affects one variable. that variable is in a for loop, which is in a function, which is also in a function and several values are also calculated by several other functions…
i do know i can have a chart what functions are involved and how they are affect each other, when i have a project. however, i cant see the variables there, or if i dont know how.
so thats my question, how can i see the functions AND variables that affect one variable.hello everyone,
i am having a little problem, i need to figure out what affects one variable. that variable is in a for loop, which is in a function, which is also in a function and several values are also calculated by several other functions…
i do know i can have a chart what functions are involved and how they are affect each other, when i have a project. however, i cant see the variables there, or if i dont know how.
so thats my question, how can i see the functions AND variables that affect one variable. hello everyone,
i am having a little problem, i need to figure out what affects one variable. that variable is in a for loop, which is in a function, which is also in a function and several values are also calculated by several other functions…
i do know i can have a chart what functions are involved and how they are affect each other, when i have a project. however, i cant see the variables there, or if i dont know how.
so thats my question, how can i see the functions AND variables that affect one variable. variable, function MATLAB Answers — New Questions
lung segmentation in MR-Dataset
Hello,
does anybody know a way to segment Lungs from mri-dataset? I foud many ways to segment them in CT, but not in MR.
I tried the otsu and the k-means methods, but the heart is alway segmented with the lungsHello,
does anybody know a way to segment Lungs from mri-dataset? I foud many ways to segment them in CT, but not in MR.
I tried the otsu and the k-means methods, but the heart is alway segmented with the lungs Hello,
does anybody know a way to segment Lungs from mri-dataset? I foud many ways to segment them in CT, but not in MR.
I tried the otsu and the k-means methods, but the heart is alway segmented with the lungs image segmentation, image processing, lung, mri MATLAB Answers — New Questions
error about MATLAB Runtime 7.5 download
I want to download the MATLAB Runtime (MCR) 7.5 version.
However, when I run the .exe file, I get the following warning.
"Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support or package vendor"
Is there a solution to this?I want to download the MATLAB Runtime (MCR) 7.5 version.
However, when I run the .exe file, I get the following warning.
"Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support or package vendor"
Is there a solution to this? I want to download the MATLAB Runtime (MCR) 7.5 version.
However, when I run the .exe file, I get the following warning.
"Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support or package vendor"
Is there a solution to this? mcr MATLAB Answers — New Questions
How to use modern features (notably std::unique_ptr) in the C++ code of my S-functions while using the linaro v4.8 toolchain in embedded coder?
Background
I am using simulink with S-functions containing custom C++ code. My simulink model runs on an ARM board running Linux, using embedded coder. My C++ code uses unique pointers (std::unique_ptr). The toolchain I use is Linaro v4.8.
The error
I get the following error when building the Linux executable using the simulink ‘build’ button:
C:/my_path/cpp/src/my_class.h:13:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
My idea
I suspect that the C++ version being compiled to is < c++11, and I would like to force the g++ compiler to compile the code using c++11. I can’t change compiler flags in the simulink menu, it is grayed out.
I found the linaro toolchain xml file and changed compiler flags there, but when I look at the compiler command generated in simulink I do not see the -std=c++11 compiler flag anywhere.
The question
How can I use modern features (notably std::unique_ptr) in the C++ code of my S-functions while using the linaro v4.8 toolchain in simulink embedded coder?Background
I am using simulink with S-functions containing custom C++ code. My simulink model runs on an ARM board running Linux, using embedded coder. My C++ code uses unique pointers (std::unique_ptr). The toolchain I use is Linaro v4.8.
The error
I get the following error when building the Linux executable using the simulink ‘build’ button:
C:/my_path/cpp/src/my_class.h:13:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
My idea
I suspect that the C++ version being compiled to is < c++11, and I would like to force the g++ compiler to compile the code using c++11. I can’t change compiler flags in the simulink menu, it is grayed out.
I found the linaro toolchain xml file and changed compiler flags there, but when I look at the compiler command generated in simulink I do not see the -std=c++11 compiler flag anywhere.
The question
How can I use modern features (notably std::unique_ptr) in the C++ code of my S-functions while using the linaro v4.8 toolchain in simulink embedded coder? Background
I am using simulink with S-functions containing custom C++ code. My simulink model runs on an ARM board running Linux, using embedded coder. My C++ code uses unique pointers (std::unique_ptr). The toolchain I use is Linaro v4.8.
The error
I get the following error when building the Linux executable using the simulink ‘build’ button:
C:/my_path/cpp/src/my_class.h:13:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
My idea
I suspect that the C++ version being compiled to is < c++11, and I would like to force the g++ compiler to compile the code using c++11. I can’t change compiler flags in the simulink menu, it is grayed out.
I found the linaro toolchain xml file and changed compiler flags there, but when I look at the compiler command generated in simulink I do not see the -std=c++11 compiler flag anywhere.
The question
How can I use modern features (notably std::unique_ptr) in the C++ code of my S-functions while using the linaro v4.8 toolchain in simulink embedded coder? embedded coder, s-function, simulink, linux MATLAB Answers — New Questions
copping grayscale image and remove any other borders or details
could you please help me to get only the gray scale images without any borders and without any written words or letters created by the device . i want a general code to do this beause i have other images with other border thickness and other written , and i want the gray image entire only
@Image Analyst
Image Analystcould you please help me to get only the gray scale images without any borders and without any written words or letters created by the device . i want a general code to do this beause i have other images with other border thickness and other written , and i want the gray image entire only
@Image Analyst
Image Analyst could you please help me to get only the gray scale images without any borders and without any written words or letters created by the device . i want a general code to do this beause i have other images with other border thickness and other written , and i want the gray image entire only
@Image Analyst
Image Analyst image analyst MATLAB Answers — New Questions
Design a feedback controller to control pH value of a non linear system
Hi all!.
I am working on a question where we calculate an optimal dosage using multiple sensor inputs. Then we send the calculated dosage to the plant and we monitor the pH value. Right now we have an open loop system. I want to maintain the output pH value in a range of 5.2 to 5.8 by introducing a feedback and a PID controller.
I have previous data about the dosage we calculated and the resulted pH values.Hi all!.
I am working on a question where we calculate an optimal dosage using multiple sensor inputs. Then we send the calculated dosage to the plant and we monitor the pH value. Right now we have an open loop system. I want to maintain the output pH value in a range of 5.2 to 5.8 by introducing a feedback and a PID controller.
I have previous data about the dosage we calculated and the resulted pH values. Hi all!.
I am working on a question where we calculate an optimal dosage using multiple sensor inputs. Then we send the calculated dosage to the plant and we monitor the pH value. Right now we have an open loop system. I want to maintain the output pH value in a range of 5.2 to 5.8 by introducing a feedback and a PID controller.
I have previous data about the dosage we calculated and the resulted pH values. pid, ph, feedback control MATLAB Answers — New Questions