Tag Archives: matlab
Live Script Controls in (For) Loop
Hello,
Is there a way to create a dynamic input field using live script controls? I want to populate the livescript with N controls (ex. "Edit Field") inputs prior to the user providing input values. The user specifies N, and the live script then generates N controls.
I assume have to embed the control in a (for) loop. I am not hard coding any controls, at the moment. I prefer to have the controls embedded in the live script and not have to use a inputdlg box.
Thank You.
N = 2;
for i = 1:N
fprintf("Livescript Input %d n",i)
%LIVESCRIPT CONTROL HERE ("EDIT FIELD")
end
% N POPULATED CONTROLS HERE
% USER ENTERS N INPUTS HEREHello,
Is there a way to create a dynamic input field using live script controls? I want to populate the livescript with N controls (ex. "Edit Field") inputs prior to the user providing input values. The user specifies N, and the live script then generates N controls.
I assume have to embed the control in a (for) loop. I am not hard coding any controls, at the moment. I prefer to have the controls embedded in the live script and not have to use a inputdlg box.
Thank You.
N = 2;
for i = 1:N
fprintf("Livescript Input %d n",i)
%LIVESCRIPT CONTROL HERE ("EDIT FIELD")
end
% N POPULATED CONTROLS HERE
% USER ENTERS N INPUTS HERE Hello,
Is there a way to create a dynamic input field using live script controls? I want to populate the livescript with N controls (ex. "Edit Field") inputs prior to the user providing input values. The user specifies N, and the live script then generates N controls.
I assume have to embed the control in a (for) loop. I am not hard coding any controls, at the moment. I prefer to have the controls embedded in the live script and not have to use a inputdlg box.
Thank You.
N = 2;
for i = 1:N
fprintf("Livescript Input %d n",i)
%LIVESCRIPT CONTROL HERE ("EDIT FIELD")
end
% N POPULATED CONTROLS HERE
% USER ENTERS N INPUTS HERE live script, control, loop, user MATLAB Answers — New Questions
Blocking pixel label data for semantic segmentation DL training
I’m trying to block images and their pixel labels for training a unet. I can use a blockedImageDatastore for the input images, but I don’t know how to get this blocking behavior from the pixelLabelDatastore that holds the expected labels. I can get the behavior myself by splitting all the images beforehand and saving them to disk, but I’d rather not have to deal with the file cleanup or lose the dynamic changing of blocking. Does anyone know a way to achieve this?I’m trying to block images and their pixel labels for training a unet. I can use a blockedImageDatastore for the input images, but I don’t know how to get this blocking behavior from the pixelLabelDatastore that holds the expected labels. I can get the behavior myself by splitting all the images beforehand and saving them to disk, but I’d rather not have to deal with the file cleanup or lose the dynamic changing of blocking. Does anyone know a way to achieve this? I’m trying to block images and their pixel labels for training a unet. I can use a blockedImageDatastore for the input images, but I don’t know how to get this blocking behavior from the pixelLabelDatastore that holds the expected labels. I can get the behavior myself by splitting all the images beforehand and saving them to disk, but I’d rather not have to deal with the file cleanup or lose the dynamic changing of blocking. Does anyone know a way to achieve this? blockedimagedatastore, pixellabeldatastore, semantic segmentation MATLAB Answers — New Questions
Define a Linear Mixed-Effects Model with fitlme for a random effects model with a one fixed effect and one random intercept
I am trying to determine how to define the formula for the "fitlme" function, which will then be passed into the "randomEffects" function. I have read through the documentation for the "fitlme" function and the documentation on the webpage "Prepare Data for Linear Mixed-Effects Models." However, I am still unsure how to proceed.
Background:
Our laboratory performed volumetric optical imaging on 15 brain tissue samples (five samples were from disease A, five were from disease B, and five were from healthy controls). For each tissue sample, we virtually divided the volumetric optical images into uniform cubic sub samples. For each sub-sample, we calculated a single value for a particular vascular metric. This resulted in a vector of continuous values for each tissue sample.
Goal:
Now, I want to compare the vascular metrics between each disease group and the control group (i.e. disease A vs. control and disease B vs. control). My goal is to determine whether the vascular metric changes signficantly between the disease groups and the control group. I contacted a statistician, who recommended using a random effects model. They recommended defining the following:
response = array of values for the vascular metric
fixed effect = group (disease A, disease B, or control)
random effect = subject identifier
I am now trying to determine how to implement this in Matlab via the "fitlme" function.
Using the "fitlme" function:
Defining the table:
I created two separate tables, one for comparing disease A vs. the control group and a second for comparing disease B vs. the control group. The first column of the tables represents the group identifier (disease_A, disease_B, or control). The second column is the subject identifier (1-15). The third column is a concatenated vector of all of the subsamples across all of the subjects in the respective groups.
Defining the formula:
I am unsure how to define the formula that defines the linear mixed effects model. I would like to set the vector of subsamples as the response variable (y), the vector of groups as the fixed effect, and the subject identifier as the random effect. From reading the documentatoin, I believe this would correspond to the following:
fml = ‘subsamples ~ subID + (subID|groups)’;
I implemented this and then ran the following code to obtain the estimates of random effects and related statistics:
lme = fitlme(tbl,fml);
[B, Bnames, stats] = randomEffects(lme);
The code ran successfully, and now I am trying to determine whether I correctly initialized the formula. The contents of the "stats" struct for comparing one of the disease groups to control are shown below. The group labels are "AD" and "HC". The value ‘subID’ refers to the subject ID.
Questions:
Am I correctly defining the formula (fml) for fitting the LME model? I am also open to using the "fitlmematrix" if that is more straightforward. I also attempted to use "fitlmematrix," but I got even more confused on how to define the respective matrices, so I figured I would not include details in this post.
If the p-value (from the "stats" object) is less than my alpha, does this signify that the random effect (subject) does not significantly affect the response (vascular metrics)?
How do I test whether the fixed effect (group) has a significant affect on the response? Would this require defining a different formula for the fitlme function?I am trying to determine how to define the formula for the "fitlme" function, which will then be passed into the "randomEffects" function. I have read through the documentation for the "fitlme" function and the documentation on the webpage "Prepare Data for Linear Mixed-Effects Models." However, I am still unsure how to proceed.
Background:
Our laboratory performed volumetric optical imaging on 15 brain tissue samples (five samples were from disease A, five were from disease B, and five were from healthy controls). For each tissue sample, we virtually divided the volumetric optical images into uniform cubic sub samples. For each sub-sample, we calculated a single value for a particular vascular metric. This resulted in a vector of continuous values for each tissue sample.
Goal:
Now, I want to compare the vascular metrics between each disease group and the control group (i.e. disease A vs. control and disease B vs. control). My goal is to determine whether the vascular metric changes signficantly between the disease groups and the control group. I contacted a statistician, who recommended using a random effects model. They recommended defining the following:
response = array of values for the vascular metric
fixed effect = group (disease A, disease B, or control)
random effect = subject identifier
I am now trying to determine how to implement this in Matlab via the "fitlme" function.
Using the "fitlme" function:
Defining the table:
I created two separate tables, one for comparing disease A vs. the control group and a second for comparing disease B vs. the control group. The first column of the tables represents the group identifier (disease_A, disease_B, or control). The second column is the subject identifier (1-15). The third column is a concatenated vector of all of the subsamples across all of the subjects in the respective groups.
Defining the formula:
I am unsure how to define the formula that defines the linear mixed effects model. I would like to set the vector of subsamples as the response variable (y), the vector of groups as the fixed effect, and the subject identifier as the random effect. From reading the documentatoin, I believe this would correspond to the following:
fml = ‘subsamples ~ subID + (subID|groups)’;
I implemented this and then ran the following code to obtain the estimates of random effects and related statistics:
lme = fitlme(tbl,fml);
[B, Bnames, stats] = randomEffects(lme);
The code ran successfully, and now I am trying to determine whether I correctly initialized the formula. The contents of the "stats" struct for comparing one of the disease groups to control are shown below. The group labels are "AD" and "HC". The value ‘subID’ refers to the subject ID.
Questions:
Am I correctly defining the formula (fml) for fitting the LME model? I am also open to using the "fitlmematrix" if that is more straightforward. I also attempted to use "fitlmematrix," but I got even more confused on how to define the respective matrices, so I figured I would not include details in this post.
If the p-value (from the "stats" object) is less than my alpha, does this signify that the random effect (subject) does not significantly affect the response (vascular metrics)?
How do I test whether the fixed effect (group) has a significant affect on the response? Would this require defining a different formula for the fitlme function? I am trying to determine how to define the formula for the "fitlme" function, which will then be passed into the "randomEffects" function. I have read through the documentation for the "fitlme" function and the documentation on the webpage "Prepare Data for Linear Mixed-Effects Models." However, I am still unsure how to proceed.
Background:
Our laboratory performed volumetric optical imaging on 15 brain tissue samples (five samples were from disease A, five were from disease B, and five were from healthy controls). For each tissue sample, we virtually divided the volumetric optical images into uniform cubic sub samples. For each sub-sample, we calculated a single value for a particular vascular metric. This resulted in a vector of continuous values for each tissue sample.
Goal:
Now, I want to compare the vascular metrics between each disease group and the control group (i.e. disease A vs. control and disease B vs. control). My goal is to determine whether the vascular metric changes signficantly between the disease groups and the control group. I contacted a statistician, who recommended using a random effects model. They recommended defining the following:
response = array of values for the vascular metric
fixed effect = group (disease A, disease B, or control)
random effect = subject identifier
I am now trying to determine how to implement this in Matlab via the "fitlme" function.
Using the "fitlme" function:
Defining the table:
I created two separate tables, one for comparing disease A vs. the control group and a second for comparing disease B vs. the control group. The first column of the tables represents the group identifier (disease_A, disease_B, or control). The second column is the subject identifier (1-15). The third column is a concatenated vector of all of the subsamples across all of the subjects in the respective groups.
Defining the formula:
I am unsure how to define the formula that defines the linear mixed effects model. I would like to set the vector of subsamples as the response variable (y), the vector of groups as the fixed effect, and the subject identifier as the random effect. From reading the documentatoin, I believe this would correspond to the following:
fml = ‘subsamples ~ subID + (subID|groups)’;
I implemented this and then ran the following code to obtain the estimates of random effects and related statistics:
lme = fitlme(tbl,fml);
[B, Bnames, stats] = randomEffects(lme);
The code ran successfully, and now I am trying to determine whether I correctly initialized the formula. The contents of the "stats" struct for comparing one of the disease groups to control are shown below. The group labels are "AD" and "HC". The value ‘subID’ refers to the subject ID.
Questions:
Am I correctly defining the formula (fml) for fitting the LME model? I am also open to using the "fitlmematrix" if that is more straightforward. I also attempted to use "fitlmematrix," but I got even more confused on how to define the respective matrices, so I figured I would not include details in this post.
If the p-value (from the "stats" object) is less than my alpha, does this signify that the random effect (subject) does not significantly affect the response (vascular metrics)?
How do I test whether the fixed effect (group) has a significant affect on the response? Would this require defining a different formula for the fitlme function? fitlme, fitlmematrix, randomeffects MATLAB Answers — New Questions
Trouble using Loadlibrary with the qhy camera SDK for Windows
I am trying to connect MatLab to control my QHY550P camera. I have installed the SDK for windows, which includes several header files, as well as the SDK library, which I am trying to load.
if ~libisloaded("C:UsersElinaDocumentsMATLABpkg_winx64qhyccd.dll")
loadlibrary(‘C:UsersElinaDocumentsMATLABpkg_winx64qhyccd.dll’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccd.h",’addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccderr.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccdcamdef.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccdstruct.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeconfig.h", ‘addheader’, …
"C:UsersElinaDownloadsmingw81x86_64-w64-mingw32includestdint.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeCyAPI.h")
end
(pkg_win is the sdk folder which I downloaded)
When I try using loadlibrary with the specified h files, I receive an error message:
Error using loadlibrary
Failed to preprocess the input file.
Output from preprocessor is:C:UsersElinaDocumentsMATLABpkg_winincludeqhyccd.h:7:22: fatal error: functional: No such
file or directory
#include <functional>
^
compilation terminated.
I know that this preprocessing error may have to do with the MinGW compiler, which I have downloaded and configured multiple times, but I still receive this same error message. It also may have to do with not including all the required h files(?).
Any help to resolve this would be appreciated,
Thanks in advanceI am trying to connect MatLab to control my QHY550P camera. I have installed the SDK for windows, which includes several header files, as well as the SDK library, which I am trying to load.
if ~libisloaded("C:UsersElinaDocumentsMATLABpkg_winx64qhyccd.dll")
loadlibrary(‘C:UsersElinaDocumentsMATLABpkg_winx64qhyccd.dll’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccd.h",’addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccderr.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccdcamdef.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccdstruct.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeconfig.h", ‘addheader’, …
"C:UsersElinaDownloadsmingw81x86_64-w64-mingw32includestdint.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeCyAPI.h")
end
(pkg_win is the sdk folder which I downloaded)
When I try using loadlibrary with the specified h files, I receive an error message:
Error using loadlibrary
Failed to preprocess the input file.
Output from preprocessor is:C:UsersElinaDocumentsMATLABpkg_winincludeqhyccd.h:7:22: fatal error: functional: No such
file or directory
#include <functional>
^
compilation terminated.
I know that this preprocessing error may have to do with the MinGW compiler, which I have downloaded and configured multiple times, but I still receive this same error message. It also may have to do with not including all the required h files(?).
Any help to resolve this would be appreciated,
Thanks in advance I am trying to connect MatLab to control my QHY550P camera. I have installed the SDK for windows, which includes several header files, as well as the SDK library, which I am trying to load.
if ~libisloaded("C:UsersElinaDocumentsMATLABpkg_winx64qhyccd.dll")
loadlibrary(‘C:UsersElinaDocumentsMATLABpkg_winx64qhyccd.dll’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccd.h",’addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccderr.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccdcamdef.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeqhyccdstruct.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeconfig.h", ‘addheader’, …
"C:UsersElinaDownloadsmingw81x86_64-w64-mingw32includestdint.h", ‘addheader’, …
"C:UsersElinaDocumentsMATLABpkg_winincludeCyAPI.h")
end
(pkg_win is the sdk folder which I downloaded)
When I try using loadlibrary with the specified h files, I receive an error message:
Error using loadlibrary
Failed to preprocess the input file.
Output from preprocessor is:C:UsersElinaDocumentsMATLABpkg_winincludeqhyccd.h:7:22: fatal error: functional: No such
file or directory
#include <functional>
^
compilation terminated.
I know that this preprocessing error may have to do with the MinGW compiler, which I have downloaded and configured multiple times, but I still receive this same error message. It also may have to do with not including all the required h files(?).
Any help to resolve this would be appreciated,
Thanks in advance loadlibrary, qhy sdk, h files, mingw compiler, preprocessing error MATLAB Answers — New Questions
Rust Support for generated Matlab Models
Is it already possible or planned and on the roadmap to have Rust as native output of code generated model from Matlab Simulink?
https://www.nsa.gov/Press-Room/News-Highlights/Article/Article/3215760/nsa-releases-guidance-on-how-to-protect-against-software-memory-safety-issues/Is it already possible or planned and on the roadmap to have Rust as native output of code generated model from Matlab Simulink?
https://www.nsa.gov/Press-Room/News-Highlights/Article/Article/3215760/nsa-releases-guidance-on-how-to-protect-against-software-memory-safety-issues/ Is it already possible or planned and on the roadmap to have Rust as native output of code generated model from Matlab Simulink?
https://www.nsa.gov/Press-Room/News-Highlights/Article/Article/3215760/nsa-releases-guidance-on-how-to-protect-against-software-memory-safety-issues/ simulink, rust, memory safety MATLAB Answers — New Questions
Designing an Induction motor from AC-DC-AC, I am not sure what code to enter for the function block. I want to check the speed and torque response with the change of frequency
Designing an AC-DC-AC induction motor so far I have:
AC source – rectifier – Inverter with the function block – Induction motor and – constant block (load). I want to check the speed and torque responce with the change of frequency.
I am not sure what code do I need to enter in the function block so that I can check the speed and toque responce with the change of frequency.
Can anyone assist please?
RegardsDesigning an AC-DC-AC induction motor so far I have:
AC source – rectifier – Inverter with the function block – Induction motor and – constant block (load). I want to check the speed and torque responce with the change of frequency.
I am not sure what code do I need to enter in the function block so that I can check the speed and toque responce with the change of frequency.
Can anyone assist please?
Regards Designing an AC-DC-AC induction motor so far I have:
AC source – rectifier – Inverter with the function block – Induction motor and – constant block (load). I want to check the speed and torque responce with the change of frequency.
I am not sure what code do I need to enter in the function block so that I can check the speed and toque responce with the change of frequency.
Can anyone assist please?
Regards induction motor, matlab, function block, function, inverter, asynchronous motor, dc-ac circuit, pwm controller, pwm generator, ac-dc-ac MATLAB Answers — New Questions
problem with the patcht-test model and load distribution on nodes
I’m running the patch test on the model (steel plate) my prof gave to me. I´m confused about the load distribution on the plate. The middle node loads in x and y directions seem too large, and the corner loads don’t match my calculations.
I posted the boundary conditions and Forces on the nodes(the one the professor provided me). I thought the corner loads should be: 150,4 (the load) *5(length between the 2 nodes) /2 with the middle node receiving double this. Despite this, the patch test results look correct. Can someone clarify or verify the load distribution?
q0=150,4 constant load / node 20 and 18 are the middle ones and the rest are corner nodes.I’m running the patch test on the model (steel plate) my prof gave to me. I´m confused about the load distribution on the plate. The middle node loads in x and y directions seem too large, and the corner loads don’t match my calculations.
I posted the boundary conditions and Forces on the nodes(the one the professor provided me). I thought the corner loads should be: 150,4 (the load) *5(length between the 2 nodes) /2 with the middle node receiving double this. Despite this, the patch test results look correct. Can someone clarify or verify the load distribution?
q0=150,4 constant load / node 20 and 18 are the middle ones and the rest are corner nodes. I’m running the patch test on the model (steel plate) my prof gave to me. I´m confused about the load distribution on the plate. The middle node loads in x and y directions seem too large, and the corner loads don’t match my calculations.
I posted the boundary conditions and Forces on the nodes(the one the professor provided me). I thought the corner loads should be: 150,4 (the load) *5(length between the 2 nodes) /2 with the middle node receiving double this. Despite this, the patch test results look correct. Can someone clarify or verify the load distribution?
q0=150,4 constant load / node 20 and 18 are the middle ones and the rest are corner nodes. patchttest, nodes distribution MATLAB Answers — New Questions
How do I properly install Matlab Engine using the anaconda package manager for Python?
At the moment, I’m running Python 3.5 and Matlab R2015a on a 64-bit Windows 10 laptop. I’m using Anaconda as my Python package manager and want to run some Matlab scripts from Python using . I’ve used the classic Anaconda command to install Matlab engine:
conda install matlab_engine
However, even after Matlab engine has supposedly been installed, I get an error message whenever I type in the following command to Python.
import matlab.engine
The error just reads "no module called matlab". I’m really unsure of what to do. Am I doing something blatantly incorrect or is there another way I can install Matlab engine.
Thank you for your help.At the moment, I’m running Python 3.5 and Matlab R2015a on a 64-bit Windows 10 laptop. I’m using Anaconda as my Python package manager and want to run some Matlab scripts from Python using . I’ve used the classic Anaconda command to install Matlab engine:
conda install matlab_engine
However, even after Matlab engine has supposedly been installed, I get an error message whenever I type in the following command to Python.
import matlab.engine
The error just reads "no module called matlab". I’m really unsure of what to do. Am I doing something blatantly incorrect or is there another way I can install Matlab engine.
Thank you for your help. At the moment, I’m running Python 3.5 and Matlab R2015a on a 64-bit Windows 10 laptop. I’m using Anaconda as my Python package manager and want to run some Matlab scripts from Python using . I’ve used the classic Anaconda command to install Matlab engine:
conda install matlab_engine
However, even after Matlab engine has supposedly been installed, I get an error message whenever I type in the following command to Python.
import matlab.engine
The error just reads "no module called matlab". I’m really unsure of what to do. Am I doing something blatantly incorrect or is there another way I can install Matlab engine.
Thank you for your help. matlab engine MATLAB Answers — New Questions
Message usage reset anniversary date?
I received an email stating my free message limit of 3M would be reached in mid July at the current rate. I have shut off 2 channels temporarily and changed the update frequency to 5 minutes but I need to know what the reset date is? Is it January 1st or the date the first channel was built or ??
Thank you.I received an email stating my free message limit of 3M would be reached in mid July at the current rate. I have shut off 2 channels temporarily and changed the update frequency to 5 minutes but I need to know what the reset date is? Is it January 1st or the date the first channel was built or ??
Thank you. I received an email stating my free message limit of 3M would be reached in mid July at the current rate. I have shut off 2 channels temporarily and changed the update frequency to 5 minutes but I need to know what the reset date is? Is it January 1st or the date the first channel was built or ??
Thank you. thingspeak MATLAB Answers — New Questions
Set breakpoint is not working in Method function file.
Hi
I would like set break point at reduce function in PDEtoobox. How can I achieve that.
Below is minimum viable code.
How can I add break point reduce function?
Thanks for help!
clc
clear all
open reduce
modelT = createpde("structural","transient-solid");
gm = multicuboid(0.05,0.003,0.003);
modelT.Geometry = gm;
figure
pdegplot(modelT,"FaceLabels","on","FaceAlpha",0.5)
view([71 4])
structuralProperties(modelT,"YoungsModulus",210E9, …
"PoissonsRatio",0.3, …
"MassDensity",7800);
structuralBC(modelT,"Edge",[2 8 11 12],"Constraint","fixed");
loadedVertex = addVertex(gm,"Coordinates",[0.025 0.0 0.0015]);
generateMesh(modelT);
structuralBoundaryLoad(modelT,"Vertex",loadedVertex, …
"Force",[0;0;10],"Frequency",6000);
structuralIC(modelT,"Velocity",[0 0 0],"Displacement",[0 0 0]);
structuralSEInterface(modelT,"Edge",[2 8 11 12]);
structuralSEInterface(modelT,"Vertex",loadedVertex);
rom = reduce(modelT,"FrequencyRange",[-0.1,5e5]);Hi
I would like set break point at reduce function in PDEtoobox. How can I achieve that.
Below is minimum viable code.
How can I add break point reduce function?
Thanks for help!
clc
clear all
open reduce
modelT = createpde("structural","transient-solid");
gm = multicuboid(0.05,0.003,0.003);
modelT.Geometry = gm;
figure
pdegplot(modelT,"FaceLabels","on","FaceAlpha",0.5)
view([71 4])
structuralProperties(modelT,"YoungsModulus",210E9, …
"PoissonsRatio",0.3, …
"MassDensity",7800);
structuralBC(modelT,"Edge",[2 8 11 12],"Constraint","fixed");
loadedVertex = addVertex(gm,"Coordinates",[0.025 0.0 0.0015]);
generateMesh(modelT);
structuralBoundaryLoad(modelT,"Vertex",loadedVertex, …
"Force",[0;0;10],"Frequency",6000);
structuralIC(modelT,"Velocity",[0 0 0],"Displacement",[0 0 0]);
structuralSEInterface(modelT,"Edge",[2 8 11 12]);
structuralSEInterface(modelT,"Vertex",loadedVertex);
rom = reduce(modelT,"FrequencyRange",[-0.1,5e5]); Hi
I would like set break point at reduce function in PDEtoobox. How can I achieve that.
Below is minimum viable code.
How can I add break point reduce function?
Thanks for help!
clc
clear all
open reduce
modelT = createpde("structural","transient-solid");
gm = multicuboid(0.05,0.003,0.003);
modelT.Geometry = gm;
figure
pdegplot(modelT,"FaceLabels","on","FaceAlpha",0.5)
view([71 4])
structuralProperties(modelT,"YoungsModulus",210E9, …
"PoissonsRatio",0.3, …
"MassDensity",7800);
structuralBC(modelT,"Edge",[2 8 11 12],"Constraint","fixed");
loadedVertex = addVertex(gm,"Coordinates",[0.025 0.0 0.0015]);
generateMesh(modelT);
structuralBoundaryLoad(modelT,"Vertex",loadedVertex, …
"Force",[0;0;10],"Frequency",6000);
structuralIC(modelT,"Velocity",[0 0 0],"Displacement",[0 0 0]);
structuralSEInterface(modelT,"Edge",[2 8 11 12]);
structuralSEInterface(modelT,"Vertex",loadedVertex);
rom = reduce(modelT,"FrequencyRange",[-0.1,5e5]); pdetoolbox, method MATLAB Answers — New Questions
MATLAB CST Interface in Linux
Hlw I was using the following command "cst = actxserver(‘CSTStudio.application’);
mws = cst.invoke(‘NewMWS’);";
to incorporate MATLAB with CST in Windows and it worked perfectly.However when I was trying to do it in linux it is showing error.Would you please suggest how I can I do it in Linux or is it possible to do it Linux.Hlw I was using the following command "cst = actxserver(‘CSTStudio.application’);
mws = cst.invoke(‘NewMWS’);";
to incorporate MATLAB with CST in Windows and it worked perfectly.However when I was trying to do it in linux it is showing error.Would you please suggest how I can I do it in Linux or is it possible to do it Linux. Hlw I was using the following command "cst = actxserver(‘CSTStudio.application’);
mws = cst.invoke(‘NewMWS’);";
to incorporate MATLAB with CST in Windows and it worked perfectly.However when I was trying to do it in linux it is showing error.Would you please suggest how I can I do it in Linux or is it possible to do it Linux. matlab cst interface MATLAB Answers — New Questions
Reading Clinical EEG (.ezdata) file IN MATLAB
how can we read a clinical EEG that is in .ezdata file format in Matlab. Following is the data from one subject and it shows the Ezdata in the name.i have searched alot but i am unable to find any sort of converter for this format.i have also attached the file which i am trying to read in Matlab in compressed folder.how can we read this file in matlab or convert it to some format that is supported by MATLAB.THANKS.The machine used for recording this data is Cadwell Arc Essentia.how can we read a clinical EEG that is in .ezdata file format in Matlab. Following is the data from one subject and it shows the Ezdata in the name.i have searched alot but i am unable to find any sort of converter for this format.i have also attached the file which i am trying to read in Matlab in compressed folder.how can we read this file in matlab or convert it to some format that is supported by MATLAB.THANKS.The machine used for recording this data is Cadwell Arc Essentia. how can we read a clinical EEG that is in .ezdata file format in Matlab. Following is the data from one subject and it shows the Ezdata in the name.i have searched alot but i am unable to find any sort of converter for this format.i have also attached the file which i am trying to read in Matlab in compressed folder.how can we read this file in matlab or convert it to some format that is supported by MATLAB.THANKS.The machine used for recording this data is Cadwell Arc Essentia. eeg, reading file in matlab MATLAB Answers — New Questions
Initial angular position of a mechanical system in SimScape
Dears,
I am working on a SimScape model that includes a rotating mechanical system. The model uses an ideal angular velocity source to generate a (fixed) rotation speed, and an ideal rotational motion sensor to measure both the speed and the angular position. Now, when solving the model, it seems that the initial angle of the system (at t = 0) is not equal to zero, but rather some high value (in the order of 1e10). I’ve tried setting the initial angle in the ideal rotational motion sensor block to 0 but that does not help. Moreover, it seems that the initial angle of the system changes based on the requested speed (I would not expect such a dependency).
I have included a simplified example of the model that includes the components and issues described above. The model is created in Matlab 2020b (the version which I am currently using).
I would like to understand how I can set the initial angle of the mechanical system to zero (at t = 0). Could you help me solve the issue?
Thanks in advance for your help!Dears,
I am working on a SimScape model that includes a rotating mechanical system. The model uses an ideal angular velocity source to generate a (fixed) rotation speed, and an ideal rotational motion sensor to measure both the speed and the angular position. Now, when solving the model, it seems that the initial angle of the system (at t = 0) is not equal to zero, but rather some high value (in the order of 1e10). I’ve tried setting the initial angle in the ideal rotational motion sensor block to 0 but that does not help. Moreover, it seems that the initial angle of the system changes based on the requested speed (I would not expect such a dependency).
I have included a simplified example of the model that includes the components and issues described above. The model is created in Matlab 2020b (the version which I am currently using).
I would like to understand how I can set the initial angle of the mechanical system to zero (at t = 0). Could you help me solve the issue?
Thanks in advance for your help! Dears,
I am working on a SimScape model that includes a rotating mechanical system. The model uses an ideal angular velocity source to generate a (fixed) rotation speed, and an ideal rotational motion sensor to measure both the speed and the angular position. Now, when solving the model, it seems that the initial angle of the system (at t = 0) is not equal to zero, but rather some high value (in the order of 1e10). I’ve tried setting the initial angle in the ideal rotational motion sensor block to 0 but that does not help. Moreover, it seems that the initial angle of the system changes based on the requested speed (I would not expect such a dependency).
I have included a simplified example of the model that includes the components and issues described above. The model is created in Matlab 2020b (the version which I am currently using).
I would like to understand how I can set the initial angle of the mechanical system to zero (at t = 0). Could you help me solve the issue?
Thanks in advance for your help! simscape, rotational-motion-sensor MATLAB Answers — New Questions
actxserver makes a word document with a table of contents and i want to the table of contents to be a hyperlink to each section
I have created a matlab file that takes in a series of .xlsx files and using the actxserver functions creates a word docuement and fills it with a bunch of sections that each contain some number of graphs created using the .xlsx data. I have got it so that the MATLAB script creates the word document with a Table of Contents as there are quite a few sections. What i want now is to make each section listed in the table of contents a hyperlink to that section. I have used the UseHyperlink = True code but that has made no change. The Word document created is saved as both a word file and a PDF. I would like to have the hyperlinks working in both the Word and the PDF if possible.I have created a matlab file that takes in a series of .xlsx files and using the actxserver functions creates a word docuement and fills it with a bunch of sections that each contain some number of graphs created using the .xlsx data. I have got it so that the MATLAB script creates the word document with a Table of Contents as there are quite a few sections. What i want now is to make each section listed in the table of contents a hyperlink to that section. I have used the UseHyperlink = True code but that has made no change. The Word document created is saved as both a word file and a PDF. I would like to have the hyperlinks working in both the Word and the PDF if possible. I have created a matlab file that takes in a series of .xlsx files and using the actxserver functions creates a word docuement and fills it with a bunch of sections that each contain some number of graphs created using the .xlsx data. I have got it so that the MATLAB script creates the word document with a Table of Contents as there are quite a few sections. What i want now is to make each section listed in the table of contents a hyperlink to that section. I have used the UseHyperlink = True code but that has made no change. The Word document created is saved as both a word file and a PDF. I would like to have the hyperlinks working in both the Word and the PDF if possible. word, importing excel data, export to word MATLAB Answers — New Questions
Raspberry Pi Zero W Connection Issue
I am going through the hardware setup instructions for the raspberry pi zero w while using the matlab support package for rapsberry pi. However, when I go to download the libraries that are not yet installed on my raspberry pi, it continues to say that multiple of the libraries and some of the pakcages have failed to download. I have reset my raspberry pi’s by reflashing the OS onto it, but nothing is working. This is all in Matlab 2023a.I am going through the hardware setup instructions for the raspberry pi zero w while using the matlab support package for rapsberry pi. However, when I go to download the libraries that are not yet installed on my raspberry pi, it continues to say that multiple of the libraries and some of the pakcages have failed to download. I have reset my raspberry pi’s by reflashing the OS onto it, but nothing is working. This is all in Matlab 2023a. I am going through the hardware setup instructions for the raspberry pi zero w while using the matlab support package for rapsberry pi. However, when I go to download the libraries that are not yet installed on my raspberry pi, it continues to say that multiple of the libraries and some of the pakcages have failed to download. I have reset my raspberry pi’s by reflashing the OS onto it, but nothing is working. This is all in Matlab 2023a. rapsberry pi MATLAB Answers — New Questions
MATLAB variables to running python script
I can clarify better if need be, but essentially I am attempting to run a python script to control a gimble. I would like to continuosly feed variables from the MATLAB script, where the user is inputting values, into the python script without executing another pyrunfile command. I have done a lot of research, but cannot find a suitable solution to this. Any help is greatly appreciated.I can clarify better if need be, but essentially I am attempting to run a python script to control a gimble. I would like to continuosly feed variables from the MATLAB script, where the user is inputting values, into the python script without executing another pyrunfile command. I have done a lot of research, but cannot find a suitable solution to this. Any help is greatly appreciated. I can clarify better if need be, but essentially I am attempting to run a python script to control a gimble. I would like to continuosly feed variables from the MATLAB script, where the user is inputting values, into the python script without executing another pyrunfile command. I have done a lot of research, but cannot find a suitable solution to this. Any help is greatly appreciated. pyrunfile, python MATLAB Answers — New Questions
How to plot a slice of the focal point in the radial direction.
I have energy intensity data from an FDTD simulation of a multilevel diffractive lens. Below is the MATLAB code I use to create a normalized intensity distribution, showing how the intensity of light varies with distance from a reference point (MDL) and radial distance:
dataset_er_r = ‘/er.r’; % Select dataset within the selected h5 file
dataset_er_i = ‘/er.i’; % Select dataset within the selected h5 file
data_er_r = h5read(‘/pathto/fdtd_wvl_0.532_1-er-000200.00.h5’, dataset_er_r); % Read HDF5 file
data_er_i = h5read(‘/pathto/fdtd_wvl_0.532_1-out/fdtd_wvl_0.532_1-er-000200.00.h5’, dataset_er_i); % Read HDF5 file
data_er = abs(sqrt((data_er_r).^2+(data_er_i).^2));
data_Ir = (data_er.^2)/2;
data_Ir_norm = data_Ir./max(max(data_Ir));
data_Ir_norm2 = vertcat(flipud(data_Ir_norm),data_Ir_norm);
% Show intensity distribution
imagesc(data_Ir_norm2); colormap jet; colorbar; clim([0 1]);
set(gcf,’Position’,[300,300,1000,1000]);
title(‘wavelength = 532 nm’, ‘FontSize’, 80);
xlabel(‘Distance from FZP (um)’, ‘FontSize’, 40);
ylabel(‘R (um)’, ‘FontSize’, 40);
set(gca, ‘FontSize’, 40); % Set axis font size
set(gca, ‘TickLabelInterpreter’, ‘none’, ‘FontSize’, 20); % Increase tick label font size
num_points = size(data_Ir_norm2, 2);
xticks(linspace(1, num_points, 5)); % 7 tick marks for 0, 10, 20, 30, 40, 50, 60
xticklabels({‘0′,’5′, ’10’, ’15’, ’20’});
yticks(linspace(1, size(data_Ir_norm2, 1), 6));
yticklabels(linspace(-50, 50, 6));
This creates this plot:
This code creates a plot to show the focal points. I would like to alter the code so that it shows a slice in the radial direction where the focal point is brightest. Being new to MATLAB, I’m unsure how to achieve this or if there is a specific function that can identify the brightest point and plot a slice in the radial direction, similar to the provided example plot.
Any advice or help would be greatly appreciated!I have energy intensity data from an FDTD simulation of a multilevel diffractive lens. Below is the MATLAB code I use to create a normalized intensity distribution, showing how the intensity of light varies with distance from a reference point (MDL) and radial distance:
dataset_er_r = ‘/er.r’; % Select dataset within the selected h5 file
dataset_er_i = ‘/er.i’; % Select dataset within the selected h5 file
data_er_r = h5read(‘/pathto/fdtd_wvl_0.532_1-er-000200.00.h5’, dataset_er_r); % Read HDF5 file
data_er_i = h5read(‘/pathto/fdtd_wvl_0.532_1-out/fdtd_wvl_0.532_1-er-000200.00.h5’, dataset_er_i); % Read HDF5 file
data_er = abs(sqrt((data_er_r).^2+(data_er_i).^2));
data_Ir = (data_er.^2)/2;
data_Ir_norm = data_Ir./max(max(data_Ir));
data_Ir_norm2 = vertcat(flipud(data_Ir_norm),data_Ir_norm);
% Show intensity distribution
imagesc(data_Ir_norm2); colormap jet; colorbar; clim([0 1]);
set(gcf,’Position’,[300,300,1000,1000]);
title(‘wavelength = 532 nm’, ‘FontSize’, 80);
xlabel(‘Distance from FZP (um)’, ‘FontSize’, 40);
ylabel(‘R (um)’, ‘FontSize’, 40);
set(gca, ‘FontSize’, 40); % Set axis font size
set(gca, ‘TickLabelInterpreter’, ‘none’, ‘FontSize’, 20); % Increase tick label font size
num_points = size(data_Ir_norm2, 2);
xticks(linspace(1, num_points, 5)); % 7 tick marks for 0, 10, 20, 30, 40, 50, 60
xticklabels({‘0′,’5′, ’10’, ’15’, ’20’});
yticks(linspace(1, size(data_Ir_norm2, 1), 6));
yticklabels(linspace(-50, 50, 6));
This creates this plot:
This code creates a plot to show the focal points. I would like to alter the code so that it shows a slice in the radial direction where the focal point is brightest. Being new to MATLAB, I’m unsure how to achieve this or if there is a specific function that can identify the brightest point and plot a slice in the radial direction, similar to the provided example plot.
Any advice or help would be greatly appreciated! I have energy intensity data from an FDTD simulation of a multilevel diffractive lens. Below is the MATLAB code I use to create a normalized intensity distribution, showing how the intensity of light varies with distance from a reference point (MDL) and radial distance:
dataset_er_r = ‘/er.r’; % Select dataset within the selected h5 file
dataset_er_i = ‘/er.i’; % Select dataset within the selected h5 file
data_er_r = h5read(‘/pathto/fdtd_wvl_0.532_1-er-000200.00.h5’, dataset_er_r); % Read HDF5 file
data_er_i = h5read(‘/pathto/fdtd_wvl_0.532_1-out/fdtd_wvl_0.532_1-er-000200.00.h5’, dataset_er_i); % Read HDF5 file
data_er = abs(sqrt((data_er_r).^2+(data_er_i).^2));
data_Ir = (data_er.^2)/2;
data_Ir_norm = data_Ir./max(max(data_Ir));
data_Ir_norm2 = vertcat(flipud(data_Ir_norm),data_Ir_norm);
% Show intensity distribution
imagesc(data_Ir_norm2); colormap jet; colorbar; clim([0 1]);
set(gcf,’Position’,[300,300,1000,1000]);
title(‘wavelength = 532 nm’, ‘FontSize’, 80);
xlabel(‘Distance from FZP (um)’, ‘FontSize’, 40);
ylabel(‘R (um)’, ‘FontSize’, 40);
set(gca, ‘FontSize’, 40); % Set axis font size
set(gca, ‘TickLabelInterpreter’, ‘none’, ‘FontSize’, 20); % Increase tick label font size
num_points = size(data_Ir_norm2, 2);
xticks(linspace(1, num_points, 5)); % 7 tick marks for 0, 10, 20, 30, 40, 50, 60
xticklabels({‘0′,’5′, ’10’, ’15’, ’20’});
yticks(linspace(1, size(data_Ir_norm2, 1), 6));
yticklabels(linspace(-50, 50, 6));
This creates this plot:
This code creates a plot to show the focal points. I would like to alter the code so that it shows a slice in the radial direction where the focal point is brightest. Being new to MATLAB, I’m unsure how to achieve this or if there is a specific function that can identify the brightest point and plot a slice in the radial direction, similar to the provided example plot.
Any advice or help would be greatly appreciated! fdtd, diffractive lenses, data visualization, intensity distribution, radial slice, point spread function, plotting, image processing MATLAB Answers — New Questions
Generated MEX function from a custom C code, but gives empty output.
Hello, I’m trying to generate a MEX function based on the line segment detector (LSD) that is available in this repository: theWorldCreator/LSD: a Line Segment Detector (github.com). The function I’d like to convert looks like below:
double * lsd(int * n_out, double * img, int X, int Y);
Here are short descriptions for the input and output of the function:
n_out: Pointer to an int where LSD will store the number of line segments detected.
img: Pointer to input image data. It must be an array of doubles of size X x Y, and the pixel at coordinates (x,y) is obtained by img[x+y*X].
X: the number of columns of a given image
Y: the number of rows of a given image.
Returns: A double array of size 7 x n_out, containing the list of line segments detected.
The arguments n_out, X, and Y are needed to preallocate arrays in C, but we don’t necessarily need it when running it on MATLAB. Therefore, I created an entry point function that calls the LSD function but with img as an only input argument:
function out = m_lsd(img) %#codegen
% Entry point function
% Some parameters
n_out = int32(5000); % number of detected segments will be around 5000 at most.
imsize = int32(size(img));
X = imsize(1);
Y = imsize(2);
% Pre-allocate output array
out = coder.nullcopy(zeros(7, n_out));
% Generate C Code using existing C Code:
coder.updateBuildInfo(‘addSourceFiles’, ‘lsd.c’);
coder.updateBuildInfo(‘addIncludePaths’, ‘/path/to/my/folder’);
fprintf(‘Running LSD code written in C … nn’);
coder.ceval(‘lsd’, coder.ref(n_out), coder.ref(img), X, Y);
end
I also wrote a build function that looks like below:
function build(target)
% Entry-point function
entryPoint = ‘m_lsd’; % using a MATLAB function "m_lsd.m"
% Input is an array of type double with variable size
arg = coder.typeof(double(0), [Inf, Inf]);
% Configuration object
cfg = coder.config(target);
% Custom source files and source code
cfg.CustomSource = ‘lsd.c’;
cfg.CustomSourceCode = sprintf(‘%snr%snr%snr%snr%snr%s’, …
‘#include <stdio.h>’,…
‘#include <math.h>’,…
‘#include <limits.h>’,…
‘#include <float.h>’,…
‘#include "lsd.h"’);
% Generate and launch report
cfg.GenerateReport = true;
cfg.LaunchReport = false;
% Generate code
codegen(entryPoint, ‘-args’, {arg}, ‘-config’, cfg);
end
I built the mex function by running "build mex" and I got a MEX function without any error message. However, when I apply it to an example image, the MEX function only returns a zero matrix. Here is an example application of the mex function:
grayImg = double(imread(‘cameraman.tif’));
segs = m_lsd_mex(grayImg); % –> Gives a zero matrix, even though lsd.c returned meaningful reuslts
Could anyone advise me where I’m doing wrong? Thank you for your help…!Hello, I’m trying to generate a MEX function based on the line segment detector (LSD) that is available in this repository: theWorldCreator/LSD: a Line Segment Detector (github.com). The function I’d like to convert looks like below:
double * lsd(int * n_out, double * img, int X, int Y);
Here are short descriptions for the input and output of the function:
n_out: Pointer to an int where LSD will store the number of line segments detected.
img: Pointer to input image data. It must be an array of doubles of size X x Y, and the pixel at coordinates (x,y) is obtained by img[x+y*X].
X: the number of columns of a given image
Y: the number of rows of a given image.
Returns: A double array of size 7 x n_out, containing the list of line segments detected.
The arguments n_out, X, and Y are needed to preallocate arrays in C, but we don’t necessarily need it when running it on MATLAB. Therefore, I created an entry point function that calls the LSD function but with img as an only input argument:
function out = m_lsd(img) %#codegen
% Entry point function
% Some parameters
n_out = int32(5000); % number of detected segments will be around 5000 at most.
imsize = int32(size(img));
X = imsize(1);
Y = imsize(2);
% Pre-allocate output array
out = coder.nullcopy(zeros(7, n_out));
% Generate C Code using existing C Code:
coder.updateBuildInfo(‘addSourceFiles’, ‘lsd.c’);
coder.updateBuildInfo(‘addIncludePaths’, ‘/path/to/my/folder’);
fprintf(‘Running LSD code written in C … nn’);
coder.ceval(‘lsd’, coder.ref(n_out), coder.ref(img), X, Y);
end
I also wrote a build function that looks like below:
function build(target)
% Entry-point function
entryPoint = ‘m_lsd’; % using a MATLAB function "m_lsd.m"
% Input is an array of type double with variable size
arg = coder.typeof(double(0), [Inf, Inf]);
% Configuration object
cfg = coder.config(target);
% Custom source files and source code
cfg.CustomSource = ‘lsd.c’;
cfg.CustomSourceCode = sprintf(‘%snr%snr%snr%snr%snr%s’, …
‘#include <stdio.h>’,…
‘#include <math.h>’,…
‘#include <limits.h>’,…
‘#include <float.h>’,…
‘#include "lsd.h"’);
% Generate and launch report
cfg.GenerateReport = true;
cfg.LaunchReport = false;
% Generate code
codegen(entryPoint, ‘-args’, {arg}, ‘-config’, cfg);
end
I built the mex function by running "build mex" and I got a MEX function without any error message. However, when I apply it to an example image, the MEX function only returns a zero matrix. Here is an example application of the mex function:
grayImg = double(imread(‘cameraman.tif’));
segs = m_lsd_mex(grayImg); % –> Gives a zero matrix, even though lsd.c returned meaningful reuslts
Could anyone advise me where I’m doing wrong? Thank you for your help…! Hello, I’m trying to generate a MEX function based on the line segment detector (LSD) that is available in this repository: theWorldCreator/LSD: a Line Segment Detector (github.com). The function I’d like to convert looks like below:
double * lsd(int * n_out, double * img, int X, int Y);
Here are short descriptions for the input and output of the function:
n_out: Pointer to an int where LSD will store the number of line segments detected.
img: Pointer to input image data. It must be an array of doubles of size X x Y, and the pixel at coordinates (x,y) is obtained by img[x+y*X].
X: the number of columns of a given image
Y: the number of rows of a given image.
Returns: A double array of size 7 x n_out, containing the list of line segments detected.
The arguments n_out, X, and Y are needed to preallocate arrays in C, but we don’t necessarily need it when running it on MATLAB. Therefore, I created an entry point function that calls the LSD function but with img as an only input argument:
function out = m_lsd(img) %#codegen
% Entry point function
% Some parameters
n_out = int32(5000); % number of detected segments will be around 5000 at most.
imsize = int32(size(img));
X = imsize(1);
Y = imsize(2);
% Pre-allocate output array
out = coder.nullcopy(zeros(7, n_out));
% Generate C Code using existing C Code:
coder.updateBuildInfo(‘addSourceFiles’, ‘lsd.c’);
coder.updateBuildInfo(‘addIncludePaths’, ‘/path/to/my/folder’);
fprintf(‘Running LSD code written in C … nn’);
coder.ceval(‘lsd’, coder.ref(n_out), coder.ref(img), X, Y);
end
I also wrote a build function that looks like below:
function build(target)
% Entry-point function
entryPoint = ‘m_lsd’; % using a MATLAB function "m_lsd.m"
% Input is an array of type double with variable size
arg = coder.typeof(double(0), [Inf, Inf]);
% Configuration object
cfg = coder.config(target);
% Custom source files and source code
cfg.CustomSource = ‘lsd.c’;
cfg.CustomSourceCode = sprintf(‘%snr%snr%snr%snr%snr%s’, …
‘#include <stdio.h>’,…
‘#include <math.h>’,…
‘#include <limits.h>’,…
‘#include <float.h>’,…
‘#include "lsd.h"’);
% Generate and launch report
cfg.GenerateReport = true;
cfg.LaunchReport = false;
% Generate code
codegen(entryPoint, ‘-args’, {arg}, ‘-config’, cfg);
end
I built the mex function by running "build mex" and I got a MEX function without any error message. However, when I apply it to an example image, the MEX function only returns a zero matrix. Here is an example application of the mex function:
grayImg = double(imread(‘cameraman.tif’));
segs = m_lsd_mex(grayImg); % –> Gives a zero matrix, even though lsd.c returned meaningful reuslts
Could anyone advise me where I’m doing wrong? Thank you for your help…! image processing, mex compiler, matlab coder MATLAB Answers — New Questions
How to find fitting optimized parameters to fit a system of non-linear ODEs to experiment.
Hi
I have a set of ODEs (attached), I have been able to solve them using ode45, however, my issue now is my experimental results don’t match the integrated values of the equations. So, I am looking to fit only the solution for epsilon with it’s experimental results to find the best parameters A, B, (A0/alpha), k0, Q, and QG. Attached is my code based on an answer from another thread, but it just runs continuously but I couln’t figure out what the problem is. Could it be that the there are too many parameters to fit? Any help is greatly appreciated. Thank you.Hi
I have a set of ODEs (attached), I have been able to solve them using ode45, however, my issue now is my experimental results don’t match the integrated values of the equations. So, I am looking to fit only the solution for epsilon with it’s experimental results to find the best parameters A, B, (A0/alpha), k0, Q, and QG. Attached is my code based on an answer from another thread, but it just runs continuously but I couln’t figure out what the problem is. Could it be that the there are too many parameters to fit? Any help is greatly appreciated. Thank you. Hi
I have a set of ODEs (attached), I have been able to solve them using ode45, however, my issue now is my experimental results don’t match the integrated values of the equations. So, I am looking to fit only the solution for epsilon with it’s experimental results to find the best parameters A, B, (A0/alpha), k0, Q, and QG. Attached is my code based on an answer from another thread, but it just runs continuously but I couln’t figure out what the problem is. Could it be that the there are too many parameters to fit? Any help is greatly appreciated. Thank you. parameter estimation nonlinear curve fitting ode MATLAB Answers — New Questions
The first CIC Decimator output is always zero
It seems that the first CIC Decimator output is always zero and I don’t understand its behavior.
I generated the input data and construct signed 12-bit data.
len_data = 100;
in = randi([-2048 2047], len_data, 1);
a = fi(in,1,12,0)
Then I created CIC filter object with decimation factor of 20, number of stages of 4, and internal bit width of 30-bit, and output bit width of 30-bit.
cicDecimOut = dsp.CICDecimator(DecimationFactor=20,…
NumSections=4,…
FixedPointDataType="Specify word lengths",…
SectionWordLengths=30,…
OutputWordLength=30)
Then I checked the output of the CIC filter.
out = cicDecimOut(a)
My question is the first output of the CIC filter is always zero no matter the input is and I don’t know why.It seems that the first CIC Decimator output is always zero and I don’t understand its behavior.
I generated the input data and construct signed 12-bit data.
len_data = 100;
in = randi([-2048 2047], len_data, 1);
a = fi(in,1,12,0)
Then I created CIC filter object with decimation factor of 20, number of stages of 4, and internal bit width of 30-bit, and output bit width of 30-bit.
cicDecimOut = dsp.CICDecimator(DecimationFactor=20,…
NumSections=4,…
FixedPointDataType="Specify word lengths",…
SectionWordLengths=30,…
OutputWordLength=30)
Then I checked the output of the CIC filter.
out = cicDecimOut(a)
My question is the first output of the CIC filter is always zero no matter the input is and I don’t know why. It seems that the first CIC Decimator output is always zero and I don’t understand its behavior.
I generated the input data and construct signed 12-bit data.
len_data = 100;
in = randi([-2048 2047], len_data, 1);
a = fi(in,1,12,0)
Then I created CIC filter object with decimation factor of 20, number of stages of 4, and internal bit width of 30-bit, and output bit width of 30-bit.
cicDecimOut = dsp.CICDecimator(DecimationFactor=20,…
NumSections=4,…
FixedPointDataType="Specify word lengths",…
SectionWordLengths=30,…
OutputWordLength=30)
Then I checked the output of the CIC filter.
out = cicDecimOut(a)
My question is the first output of the CIC filter is always zero no matter the input is and I don’t know why. cic decimator, cic MATLAB Answers — New Questions