Tag Archives: matlab
Is it possible to change the tab color and font of a uitabgroup’s tabs?
Is it possible to change the color of a uitabgroup’s tabs as well as the font and font color? If not, is it possible to adjust the border color of the uitabgroup?
It is possible to change the background color of each tab’s pane, but I do not see a way to adjust the color or font/font color of the bar or the tab name elements on it. I am on R2023b.Is it possible to change the color of a uitabgroup’s tabs as well as the font and font color? If not, is it possible to adjust the border color of the uitabgroup?
It is possible to change the background color of each tab’s pane, but I do not see a way to adjust the color or font/font color of the bar or the tab name elements on it. I am on R2023b. Is it possible to change the color of a uitabgroup’s tabs as well as the font and font color? If not, is it possible to adjust the border color of the uitabgroup?
It is possible to change the background color of each tab’s pane, but I do not see a way to adjust the color or font/font color of the bar or the tab name elements on it. I am on R2023b. uitabgroup MATLAB Answers — New Questions
Smallest Alignment Index (SALI)
*Can any one help me to get the matlab code to compute the Smallest Alignment Index(SALI(t),as function of time) of the orbits in a phase space of a time series signal?**Can any one help me to get the matlab code to compute the Smallest Alignment Index(SALI(t),as function of time) of the orbits in a phase space of a time series signal?* *Can any one help me to get the matlab code to compute the Smallest Alignment Index(SALI(t),as function of time) of the orbits in a phase space of a time series signal?* nonlinear dynamics, chaos, time series analysis MATLAB Answers — New Questions
How to save app.Tab as image (.png for example)
I have five app.Tabs.
First Tab is named app.Cooling.
Content of this app.Cooling:
1) picture of cooling system
2) app. fields with temperature value
3) plots of 4 diagrams (app.UIAxes) and legends
This app.Cooling I want to save as image (.png).
I try exportgraphics, saveas etc., but it doesn’t work.
Schema of my example:
How I can save this whole tab as image?I have five app.Tabs.
First Tab is named app.Cooling.
Content of this app.Cooling:
1) picture of cooling system
2) app. fields with temperature value
3) plots of 4 diagrams (app.UIAxes) and legends
This app.Cooling I want to save as image (.png).
I try exportgraphics, saveas etc., but it doesn’t work.
Schema of my example:
How I can save this whole tab as image? I have five app.Tabs.
First Tab is named app.Cooling.
Content of this app.Cooling:
1) picture of cooling system
2) app. fields with temperature value
3) plots of 4 diagrams (app.UIAxes) and legends
This app.Cooling I want to save as image (.png).
I try exportgraphics, saveas etc., but it doesn’t work.
Schema of my example:
How I can save this whole tab as image? image, app designer, save, tab MATLAB Answers — New Questions
How does the “RL external action” is supposed to work?
Hi all,
As some of you may already know, I have been working for a while with a 3DOF model of a business jet. This model is successfully controlled by the TECS algorithm that gives actions to reach some speed and altitude setpoints. The original idea was to train a DDPG agent to emulate these actions, rewarding it appropriately using the specifications of the TECS algorithm. After many weeks of failures, I would like to abandon this path and make one last test using the external action port of the RL block. The idea would be to run the same system with the TECS in parallel with the agent. The latter receives commands from the TECS directly. So I was wondering how learning with external actions works. Do neural networks update their weights and biases by observing the actions of the external agent? Also, can the action be injected continuously or is it better to proceed with an "on-off" approach? For example, I can start with external actions, then after a certain number of seconds they turn off and there is the agent alone. Are there any documents I can consult on this? ThanksHi all,
As some of you may already know, I have been working for a while with a 3DOF model of a business jet. This model is successfully controlled by the TECS algorithm that gives actions to reach some speed and altitude setpoints. The original idea was to train a DDPG agent to emulate these actions, rewarding it appropriately using the specifications of the TECS algorithm. After many weeks of failures, I would like to abandon this path and make one last test using the external action port of the RL block. The idea would be to run the same system with the TECS in parallel with the agent. The latter receives commands from the TECS directly. So I was wondering how learning with external actions works. Do neural networks update their weights and biases by observing the actions of the external agent? Also, can the action be injected continuously or is it better to proceed with an "on-off" approach? For example, I can start with external actions, then after a certain number of seconds they turn off and there is the agent alone. Are there any documents I can consult on this? Thanks Hi all,
As some of you may already know, I have been working for a while with a 3DOF model of a business jet. This model is successfully controlled by the TECS algorithm that gives actions to reach some speed and altitude setpoints. The original idea was to train a DDPG agent to emulate these actions, rewarding it appropriately using the specifications of the TECS algorithm. After many weeks of failures, I would like to abandon this path and make one last test using the external action port of the RL block. The idea would be to run the same system with the TECS in parallel with the agent. The latter receives commands from the TECS directly. So I was wondering how learning with external actions works. Do neural networks update their weights and biases by observing the actions of the external agent? Also, can the action be injected continuously or is it better to proceed with an "on-off" approach? For example, I can start with external actions, then after a certain number of seconds they turn off and there is the agent alone. Are there any documents I can consult on this? Thanks rl, reinfrocement learning, machine learning, control theory MATLAB Answers — New Questions
islocalmax(‘flat selection’) selecting 0 value points
I am trying to select these ‘flat’ peaks from a set of data and as I need the range of index values I am using islocalmax(data,’FlatSelection’,’all’) and for most of my data it does a good job as shown in the picture above but others end up looking like this.
Was wondering if there is a way to fix this? I have tried altering things like minprominence and such.I am trying to select these ‘flat’ peaks from a set of data and as I need the range of index values I am using islocalmax(data,’FlatSelection’,’all’) and for most of my data it does a good job as shown in the picture above but others end up looking like this.
Was wondering if there is a way to fix this? I have tried altering things like minprominence and such. I am trying to select these ‘flat’ peaks from a set of data and as I need the range of index values I am using islocalmax(data,’FlatSelection’,’all’) and for most of my data it does a good job as shown in the picture above but others end up looking like this.
Was wondering if there is a way to fix this? I have tried altering things like minprominence and such. matlab, graph MATLAB Answers — New Questions
How to plot system of fractional delay differential equations
Let us consdier the system of fractional order delay differential equation
D^[alpha} x(t)= a*x(t) ( 1- x(t)/k ) – (b* x(t)* y(t-tau) ) / ( 1+c* x(t) );
D^[alpha} y(t)= ( b* x(t)* y(t-tau) ) / ( 1+c* x(t) )-d y(t);
tau=0.5; a=1; k=2; b=0.5; c=1.5; [x(t), y(t)]=[2,1] for all t in [-0.5, 0].
How to plot the above system?Let us consdier the system of fractional order delay differential equation
D^[alpha} x(t)= a*x(t) ( 1- x(t)/k ) – (b* x(t)* y(t-tau) ) / ( 1+c* x(t) );
D^[alpha} y(t)= ( b* x(t)* y(t-tau) ) / ( 1+c* x(t) )-d y(t);
tau=0.5; a=1; k=2; b=0.5; c=1.5; [x(t), y(t)]=[2,1] for all t in [-0.5, 0].
How to plot the above system? Let us consdier the system of fractional order delay differential equation
D^[alpha} x(t)= a*x(t) ( 1- x(t)/k ) – (b* x(t)* y(t-tau) ) / ( 1+c* x(t) );
D^[alpha} y(t)= ( b* x(t)* y(t-tau) ) / ( 1+c* x(t) )-d y(t);
tau=0.5; a=1; k=2; b=0.5; c=1.5; [x(t), y(t)]=[2,1] for all t in [-0.5, 0].
How to plot the above system? fractional delay MATLAB Answers — New Questions
Is parallel processing possible in optimization with App Designer
I have an app that I developed in App Designer which performs optimization with the aid of the Matlab function lsqnonlin. A snippet:
methods (access = private)
function x=doOptimize(app,x0,lb,ub,options)
f=@(xx)Fun(app,xx);
x=lsqnonlin(f,x0,lb,ub,options);
end
function ff=Fun(app,x)
ff=someFunction(app,x);
end
end
The “someFunction” is a very complex function which utilizes many app properties and methods. The app works fine. However, I would like to take advantage of parallel processing by setting options.UseParallel = true. Doing this causes all kinds of warnings and errors, evidently in accordance with previous posts that stated that the save and load performed by the parallel workers are incompatible with app objects. My question is this: Is there any work-around for this problem? Of course, if app could be excluded altogether from the function Fun, then access=Static can be used. But in this case app is completely intertwined in the calculations. On the other hand, for the parallel processing, why should it be necessary to save the app variable? Since app-related variables only appear in someFunction, would it be possible to remove all references to app in the snippet, define access as Static, and pass app to someFunction as a global variable? Could this trick the parallel workers into thinking that there are no app objects around? (I’m willing to try anything.)I have an app that I developed in App Designer which performs optimization with the aid of the Matlab function lsqnonlin. A snippet:
methods (access = private)
function x=doOptimize(app,x0,lb,ub,options)
f=@(xx)Fun(app,xx);
x=lsqnonlin(f,x0,lb,ub,options);
end
function ff=Fun(app,x)
ff=someFunction(app,x);
end
end
The “someFunction” is a very complex function which utilizes many app properties and methods. The app works fine. However, I would like to take advantage of parallel processing by setting options.UseParallel = true. Doing this causes all kinds of warnings and errors, evidently in accordance with previous posts that stated that the save and load performed by the parallel workers are incompatible with app objects. My question is this: Is there any work-around for this problem? Of course, if app could be excluded altogether from the function Fun, then access=Static can be used. But in this case app is completely intertwined in the calculations. On the other hand, for the parallel processing, why should it be necessary to save the app variable? Since app-related variables only appear in someFunction, would it be possible to remove all references to app in the snippet, define access as Static, and pass app to someFunction as a global variable? Could this trick the parallel workers into thinking that there are no app objects around? (I’m willing to try anything.) I have an app that I developed in App Designer which performs optimization with the aid of the Matlab function lsqnonlin. A snippet:
methods (access = private)
function x=doOptimize(app,x0,lb,ub,options)
f=@(xx)Fun(app,xx);
x=lsqnonlin(f,x0,lb,ub,options);
end
function ff=Fun(app,x)
ff=someFunction(app,x);
end
end
The “someFunction” is a very complex function which utilizes many app properties and methods. The app works fine. However, I would like to take advantage of parallel processing by setting options.UseParallel = true. Doing this causes all kinds of warnings and errors, evidently in accordance with previous posts that stated that the save and load performed by the parallel workers are incompatible with app objects. My question is this: Is there any work-around for this problem? Of course, if app could be excluded altogether from the function Fun, then access=Static can be used. But in this case app is completely intertwined in the calculations. On the other hand, for the parallel processing, why should it be necessary to save the app variable? Since app-related variables only appear in someFunction, would it be possible to remove all references to app in the snippet, define access as Static, and pass app to someFunction as a global variable? Could this trick the parallel workers into thinking that there are no app objects around? (I’m willing to try anything.) app designer, parallel processing, optimization MATLAB Answers — New Questions
The TCP/IP function of Simulink
I’ve create a tcp/ip connection between the ‘.m’ file and Simulink. When I use ‘sine wave’ to send data though ‘TCP/IP Client Send’, it can get though successfully. However, when I use ‘clock’ to send data though ‘TCP/IP Client Send’, the it is wrong.I’ve create a tcp/ip connection between the ‘.m’ file and Simulink. When I use ‘sine wave’ to send data though ‘TCP/IP Client Send’, it can get though successfully. However, when I use ‘clock’ to send data though ‘TCP/IP Client Send’, the it is wrong. I’ve create a tcp/ip connection between the ‘.m’ file and Simulink. When I use ‘sine wave’ to send data though ‘TCP/IP Client Send’, it can get though successfully. However, when I use ‘clock’ to send data though ‘TCP/IP Client Send’, the it is wrong. tcp/ip client MATLAB Answers — New Questions
Simulink WebView export from R2014 not displayable in Chrome?
WebViews exported from R2013B work fine in Chrome for me. WebViews exported from R2014 display a blank screen. Using the debugging console, I see a javascript error:
Uncaught Error: declare: base class is not a callable constructor. webview.js:558
This is not the well-known local file reference problem (obviously, or the webview.js file would not have been loaded). The same exported WebView displays properly in Firefox and IE11. I need this to work in Chrome, as I have a project where the WebView is supposed to be displayed from inside an application using Chromium Embedded Framework. (I’m seeing the same behavior in the normal Desktop Chrome app and in CEF3). Any ideas what is wrong?
Thanks!WebViews exported from R2013B work fine in Chrome for me. WebViews exported from R2014 display a blank screen. Using the debugging console, I see a javascript error:
Uncaught Error: declare: base class is not a callable constructor. webview.js:558
This is not the well-known local file reference problem (obviously, or the webview.js file would not have been loaded). The same exported WebView displays properly in Firefox and IE11. I need this to work in Chrome, as I have a project where the WebView is supposed to be displayed from inside an application using Chromium Embedded Framework. (I’m seeing the same behavior in the normal Desktop Chrome app and in CEF3). Any ideas what is wrong?
Thanks! WebViews exported from R2013B work fine in Chrome for me. WebViews exported from R2014 display a blank screen. Using the debugging console, I see a javascript error:
Uncaught Error: declare: base class is not a callable constructor. webview.js:558
This is not the well-known local file reference problem (obviously, or the webview.js file would not have been loaded). The same exported WebView displays properly in Firefox and IE11. I need this to work in Chrome, as I have a project where the WebView is supposed to be displayed from inside an application using Chromium Embedded Framework. (I’m seeing the same behavior in the normal Desktop Chrome app and in CEF3). Any ideas what is wrong?
Thanks! simulink, webview, chrome MATLAB Answers — New Questions
Calling Matlab Function with Multiple Returns in C++ Semantic Error
Hello, I am running into a type error where I am not able to recieve multiple returns from a custom matlab function that gives multiple returns. Here is the C++ implementation, function and error message which is defined by the IDE as a semantic issue.
C++ CALL:
matlab::data::TypedArray<double> const errArray =
factory.createArray({1,10}, {-5.6355,-5.6188,-5.6022,-5.5856,-5.569,-5.5524,-5.5358,-5.5193,-5.5027,-5.4862});
std::vector<matlab::data::Array> args({errArray});
std::vector<matlab::data::Array> m_results = matlabPtr->feval(u"func",args);
MATLAB FUNCTION:
function [cnt,rng,mn,adq,des] = func(errArr)
matrix = rainflow(errArr);
cnt = matrix(:,1);
rng = matrix(:,2);
mn = matrix(:,3);
adq = 1;
des = 1;
end
ERROR MESSAGE (SEMANTIC ISSUE):
MatlabCall.cpp:80:38: No viable conversion from ‘matlab::data::Array’ to ‘std::vector<matlab::data::Array>’
stl_vector.h:553:7: candidate constructor not viable: no known conversion from ‘matlab::data::Array’ to ‘const vector<Array> &’ for 1st argument
stl_vector.h:572:7: candidate constructor not viable: no known conversion from ‘matlab::data::Array’ to ‘vector<Array> &&’ for 1st argument
stl_vector.h:625:7: candidate constructor not viable: no known conversion from ‘matlab::data::Array’ to ‘initializer_list<value_type>’ (aka ‘initializer_list<matlab::data::Array>’) for 1st argument
stl_vector.h:497:7: explicit constructor is not a candidate
stl_vector.h:510:7: explicit constructor is not a candidate
I am wondering why the data type for m_results is matlab::data::array despite it being defined as a std::vector<matlab::data::Array>. The matlab engine is properly implemented and can run the multi-return example as provided here, https://www.mathworks.com/help/matlab/matlab_external/call-matlab-functions-from-c-1.html#mw_f777193c-c848-49fc-9591-bbb56a40a454, it just is seeming to have issue with my custom function.
I have tried the following:
give errArray as the feval argument (produces same error message)
define a size_t numReturned constant as shown in the documentation example (too many arguments error)
Thank you in advance.Hello, I am running into a type error where I am not able to recieve multiple returns from a custom matlab function that gives multiple returns. Here is the C++ implementation, function and error message which is defined by the IDE as a semantic issue.
C++ CALL:
matlab::data::TypedArray<double> const errArray =
factory.createArray({1,10}, {-5.6355,-5.6188,-5.6022,-5.5856,-5.569,-5.5524,-5.5358,-5.5193,-5.5027,-5.4862});
std::vector<matlab::data::Array> args({errArray});
std::vector<matlab::data::Array> m_results = matlabPtr->feval(u"func",args);
MATLAB FUNCTION:
function [cnt,rng,mn,adq,des] = func(errArr)
matrix = rainflow(errArr);
cnt = matrix(:,1);
rng = matrix(:,2);
mn = matrix(:,3);
adq = 1;
des = 1;
end
ERROR MESSAGE (SEMANTIC ISSUE):
MatlabCall.cpp:80:38: No viable conversion from ‘matlab::data::Array’ to ‘std::vector<matlab::data::Array>’
stl_vector.h:553:7: candidate constructor not viable: no known conversion from ‘matlab::data::Array’ to ‘const vector<Array> &’ for 1st argument
stl_vector.h:572:7: candidate constructor not viable: no known conversion from ‘matlab::data::Array’ to ‘vector<Array> &&’ for 1st argument
stl_vector.h:625:7: candidate constructor not viable: no known conversion from ‘matlab::data::Array’ to ‘initializer_list<value_type>’ (aka ‘initializer_list<matlab::data::Array>’) for 1st argument
stl_vector.h:497:7: explicit constructor is not a candidate
stl_vector.h:510:7: explicit constructor is not a candidate
I am wondering why the data type for m_results is matlab::data::array despite it being defined as a std::vector<matlab::data::Array>. The matlab engine is properly implemented and can run the multi-return example as provided here, https://www.mathworks.com/help/matlab/matlab_external/call-matlab-functions-from-c-1.html#mw_f777193c-c848-49fc-9591-bbb56a40a454, it just is seeming to have issue with my custom function.
I have tried the following:
give errArray as the feval argument (produces same error message)
define a size_t numReturned constant as shown in the documentation example (too many arguments error)
Thank you in advance. Hello, I am running into a type error where I am not able to recieve multiple returns from a custom matlab function that gives multiple returns. Here is the C++ implementation, function and error message which is defined by the IDE as a semantic issue.
C++ CALL:
matlab::data::TypedArray<double> const errArray =
factory.createArray({1,10}, {-5.6355,-5.6188,-5.6022,-5.5856,-5.569,-5.5524,-5.5358,-5.5193,-5.5027,-5.4862});
std::vector<matlab::data::Array> args({errArray});
std::vector<matlab::data::Array> m_results = matlabPtr->feval(u"func",args);
MATLAB FUNCTION:
function [cnt,rng,mn,adq,des] = func(errArr)
matrix = rainflow(errArr);
cnt = matrix(:,1);
rng = matrix(:,2);
mn = matrix(:,3);
adq = 1;
des = 1;
end
ERROR MESSAGE (SEMANTIC ISSUE):
MatlabCall.cpp:80:38: No viable conversion from ‘matlab::data::Array’ to ‘std::vector<matlab::data::Array>’
stl_vector.h:553:7: candidate constructor not viable: no known conversion from ‘matlab::data::Array’ to ‘const vector<Array> &’ for 1st argument
stl_vector.h:572:7: candidate constructor not viable: no known conversion from ‘matlab::data::Array’ to ‘vector<Array> &&’ for 1st argument
stl_vector.h:625:7: candidate constructor not viable: no known conversion from ‘matlab::data::Array’ to ‘initializer_list<value_type>’ (aka ‘initializer_list<matlab::data::Array>’) for 1st argument
stl_vector.h:497:7: explicit constructor is not a candidate
stl_vector.h:510:7: explicit constructor is not a candidate
I am wondering why the data type for m_results is matlab::data::array despite it being defined as a std::vector<matlab::data::Array>. The matlab engine is properly implemented and can run the multi-return example as provided here, https://www.mathworks.com/help/matlab/matlab_external/call-matlab-functions-from-c-1.html#mw_f777193c-c848-49fc-9591-bbb56a40a454, it just is seeming to have issue with my custom function.
I have tried the following:
give errArray as the feval argument (produces same error message)
define a size_t numReturned constant as shown in the documentation example (too many arguments error)
Thank you in advance. c++, matlab engine, function, matlab engine api MATLAB Answers — New Questions
Simulink Library Browser Icons
Some icons in the Simulink Object Browser are not the correct icons. When the incorrect icon is dragged into a new model window it changes into the correct icon. Specifically the buffer icon in DSP System Toolbox>System Management>Buffers. The icon in the library window shows an icon containing the text ‘-40 db’ but when it is dragged into a new model window it changes into a buffer icon.Some icons in the Simulink Object Browser are not the correct icons. When the incorrect icon is dragged into a new model window it changes into the correct icon. Specifically the buffer icon in DSP System Toolbox>System Management>Buffers. The icon in the library window shows an icon containing the text ‘-40 db’ but when it is dragged into a new model window it changes into a buffer icon. Some icons in the Simulink Object Browser are not the correct icons. When the incorrect icon is dragged into a new model window it changes into the correct icon. Specifically the buffer icon in DSP System Toolbox>System Management>Buffers. The icon in the library window shows an icon containing the text ‘-40 db’ but when it is dragged into a new model window it changes into a buffer icon. simulink MATLAB Answers — New Questions
How to configure Upload data button in App design
Designinh an App i had drag a button i want confure this button to upload raw dataDesigninh an App i had drag a button i want confure this button to upload raw data Designinh an App i had drag a button i want confure this button to upload raw data appdesigner MATLAB Answers — New Questions
How can I save data from for loop?
Hello.
I have 3 arrays of scalar number. I want to have some simple calculation on all numbers of these 3 arrays one by one (Permutation of all arrays numbers ), then multiplying every result (y) with rand(4,20) and finally saving every result as a excel data. I wrote the below codes but I have some problem: "I see in the output only the last multipication result of y" and therefore just last w.
clc
clear all
i=0;
j=1;
n=1;
A = [10 20 30 40 50 10];
B = [1 1.2 1.4 1.6 1.8 1];
C = [5 25 45 65 85 5];
z= rand(4,20);
for a = 1:125
i=i+1;
if i==6
j=j+1;
i=1;
end
if j==6
n=n+1;
j=1;
end
if(n==6)
n=1;
break ;
end
A_2 = A(i);
B_2 = B(j);
C_2 = C(n);
y = A_2 * B_2 * C_2 – A_2 * C_2;
w = y * z;
endHello.
I have 3 arrays of scalar number. I want to have some simple calculation on all numbers of these 3 arrays one by one (Permutation of all arrays numbers ), then multiplying every result (y) with rand(4,20) and finally saving every result as a excel data. I wrote the below codes but I have some problem: "I see in the output only the last multipication result of y" and therefore just last w.
clc
clear all
i=0;
j=1;
n=1;
A = [10 20 30 40 50 10];
B = [1 1.2 1.4 1.6 1.8 1];
C = [5 25 45 65 85 5];
z= rand(4,20);
for a = 1:125
i=i+1;
if i==6
j=j+1;
i=1;
end
if j==6
n=n+1;
j=1;
end
if(n==6)
n=1;
break ;
end
A_2 = A(i);
B_2 = B(j);
C_2 = C(n);
y = A_2 * B_2 * C_2 – A_2 * C_2;
w = y * z;
end Hello.
I have 3 arrays of scalar number. I want to have some simple calculation on all numbers of these 3 arrays one by one (Permutation of all arrays numbers ), then multiplying every result (y) with rand(4,20) and finally saving every result as a excel data. I wrote the below codes but I have some problem: "I see in the output only the last multipication result of y" and therefore just last w.
clc
clear all
i=0;
j=1;
n=1;
A = [10 20 30 40 50 10];
B = [1 1.2 1.4 1.6 1.8 1];
C = [5 25 45 65 85 5];
z= rand(4,20);
for a = 1:125
i=i+1;
if i==6
j=j+1;
i=1;
end
if j==6
n=n+1;
j=1;
end
if(n==6)
n=1;
break ;
end
A_2 = A(i);
B_2 = B(j);
C_2 = C(n);
y = A_2 * B_2 * C_2 – A_2 * C_2;
w = y * z;
end for loop, excel MATLAB Answers — New Questions
Reading and re-writing a Dicom file (header) with private tags
I have an RT ION dicom plan file which has a big nested header file with a lot of private tags.
I have opened the header file and processed everything I need to process and want to write it back into an updated DICOM RT plan file.
The plan file writes back. However, all the private or unknown tags that are not in the DICOM dictionary (dicom-dict.txt file) get read and re-written with a Private_ prefix e.g. Private_0300_0309 and the values under these tags is usually garbled.
Things I’ve tried so far:
I just let the private tags stay in as they are but then my re-written file has trouble being read again by the planning system I want to re-send, so that’s a no go.
I have all the information about the type of these DICOM tags (VR, VM, etc) and I have added a few of them to the dicom-dict.txt file but it makes no difference, and they still get read as private_ tags and get re-written as private tags.
I have tried using the ‘wiriteprivate’ modifier with dicomwrite but it doesn’t help because the tags are probably still showing up as private tags.
(dicomwrite([], FNnew, DICinfo, ‘CreateMode’, ‘copy’ , ‘WritePrivate’, true)
Is there any way to manually change the name of the tag/variable and assign the correct values or something? I can read the garbled values under these private tags using the char function on the transpose of the value. eg. char(variable’) but there’s not much I can do with that information unless I can re-write the name of the variable/tag and remove the private_ prefix of the tag name.
Or is there something I’m missing with teh dicom-dict.txt file? Do I need to force matlab to refresh or read it, or check if my additional tags in the dicom-dict.txt file have been read and accepted properly?
I’ve already spent a lot of time looking for a solution and I feel like a solution is right around the corner but I can’t figure it out.
Any help would be greatly appreciated.I have an RT ION dicom plan file which has a big nested header file with a lot of private tags.
I have opened the header file and processed everything I need to process and want to write it back into an updated DICOM RT plan file.
The plan file writes back. However, all the private or unknown tags that are not in the DICOM dictionary (dicom-dict.txt file) get read and re-written with a Private_ prefix e.g. Private_0300_0309 and the values under these tags is usually garbled.
Things I’ve tried so far:
I just let the private tags stay in as they are but then my re-written file has trouble being read again by the planning system I want to re-send, so that’s a no go.
I have all the information about the type of these DICOM tags (VR, VM, etc) and I have added a few of them to the dicom-dict.txt file but it makes no difference, and they still get read as private_ tags and get re-written as private tags.
I have tried using the ‘wiriteprivate’ modifier with dicomwrite but it doesn’t help because the tags are probably still showing up as private tags.
(dicomwrite([], FNnew, DICinfo, ‘CreateMode’, ‘copy’ , ‘WritePrivate’, true)
Is there any way to manually change the name of the tag/variable and assign the correct values or something? I can read the garbled values under these private tags using the char function on the transpose of the value. eg. char(variable’) but there’s not much I can do with that information unless I can re-write the name of the variable/tag and remove the private_ prefix of the tag name.
Or is there something I’m missing with teh dicom-dict.txt file? Do I need to force matlab to refresh or read it, or check if my additional tags in the dicom-dict.txt file have been read and accepted properly?
I’ve already spent a lot of time looking for a solution and I feel like a solution is right around the corner but I can’t figure it out.
Any help would be greatly appreciated. I have an RT ION dicom plan file which has a big nested header file with a lot of private tags.
I have opened the header file and processed everything I need to process and want to write it back into an updated DICOM RT plan file.
The plan file writes back. However, all the private or unknown tags that are not in the DICOM dictionary (dicom-dict.txt file) get read and re-written with a Private_ prefix e.g. Private_0300_0309 and the values under these tags is usually garbled.
Things I’ve tried so far:
I just let the private tags stay in as they are but then my re-written file has trouble being read again by the planning system I want to re-send, so that’s a no go.
I have all the information about the type of these DICOM tags (VR, VM, etc) and I have added a few of them to the dicom-dict.txt file but it makes no difference, and they still get read as private_ tags and get re-written as private tags.
I have tried using the ‘wiriteprivate’ modifier with dicomwrite but it doesn’t help because the tags are probably still showing up as private tags.
(dicomwrite([], FNnew, DICinfo, ‘CreateMode’, ‘copy’ , ‘WritePrivate’, true)
Is there any way to manually change the name of the tag/variable and assign the correct values or something? I can read the garbled values under these private tags using the char function on the transpose of the value. eg. char(variable’) but there’s not much I can do with that information unless I can re-write the name of the variable/tag and remove the private_ prefix of the tag name.
Or is there something I’m missing with teh dicom-dict.txt file? Do I need to force matlab to refresh or read it, or check if my additional tags in the dicom-dict.txt file have been read and accepted properly?
I’ve already spent a lot of time looking for a solution and I feel like a solution is right around the corner but I can’t figure it out.
Any help would be greatly appreciated. dicom, dicomwrite, private tags, private MATLAB Answers — New Questions
I have Backpropagation doubt
I’m trying to do neural network with 2 hidden layers and one neuron in the output layer without any toolboxes and just with matrix and vectors multiplications. To do this, I created fictional simple data as below to help me in this task:
%Data
x = 1:1000;
y1 = sind(x);
y2 = sind(x+30);
y3 = cosd(x);
y4 = cosd(x+30);
y5 = cosd(x+45);
% y6 will be the desired output data taht I would like my neural network
% try to predict
y6 = (y1 + y2 + y3 + y4 + y5);
Then, I coded as I thought to be be the right way, but my neural network can´t reach a good result, as below:
My doubt is if the result isn´t good because my implementation isn´t right or because I need to add more mechanisms im my neural network (like momentum, regularization and etc.) ?
I will post my code below sorry about the naem of some variables, but originally I wrote this code in portuguese. I will comment the code to help undestand it
%Nueral network achictecture
n_h1 = 10;
n_h2 = 11;
n_out = 1;
%Adjustable parameters
w1 = rand(5,n_h1);
b1 = ones(1,n_h1)*rand(1,1);
w2 = rand(n_h1,n_h2);
b2 = ones(1,n_h2)*rand(1,1);
w_out = rand(n_h2,n_out);
b_out = ones(1,n_out)*rand(1,1);
sig_a = 1;
learning_rate = 0.001;
limiar = 0.002;
%Helpful variables
max_epocas = 1000;
conj_entrada = [y1;y2;y3;y4;y5];
erros_epoca = [];
%Backpropagation
for epoch = 1:max_epocas
for i = 1:size(conj_entrada,2)
if i ==1
soma = 0;
else
end
enter = conj_entrada(:,i);
h1_in = [w1;b1]’*[enter;1];
h1_out = sig(h1_in,sig_a,’False’);
h2_in = [w2;b2]’*[h1_out;1];
h2_out = sig(h2_in,sig_a,’False’);
saida_in = [w_out;b_out]’*[h2_out;1];
saida_out = saida_in;
erro = y6(i) – saida_out;
soma = soma + (erro^2);
%Here starts the part of the code where the gradients are being
%calculated. Note that, here, I tried to folllow the chain rule.
%let me try to help in the understanding. Saida in portuguese is
%like output in english so when you read ,for example,
%d_erro_d_saida_out you need to know that this is the derivative of
%the error in relation with the output of the output layer. In the
%same way, entrada means input and pesos means weights
%output layer
%chain rule
d_erro_d_saida_out = -1*erro;
d_saida_d_entrada_out = 1; %linear
grad_saida = erro*d_saida_d_entrada_out;
d_entrada_d_pesos_out = h2_out;
d_erro_d_pesos_out = d_erro_d_saida_out*d_saida_d_entrada_out*d_entrada_d_pesos_out;
% Update the wights and bias
w_out = w_out -learning_rate*d_erro_d_pesos_out;
b_out = b_out -learning_rate*d_erro_d_saida_out*d_saida_d_entrada_out;
%Second hidden layer (The neighbor layer of the output layer)
%chain rule
d_erro_d_saida_h2 = -1*w_out*grad_saida;
d_saida_d_entrada_h2 = sig(h2_in,sig_a,’True’);
grad_h2 = sum(grad_saida)*d_saida_d_entrada_h2;
d_entrada_d_pesos_h2 = h1_out;
d_erro_d_pesos_h2 = d_entrada_d_pesos_h2*grad_h2′;
% Update the wights and bias
w2 = w2 -1*learning_rate*d_erro_d_pesos_h2;
b2 = b2 -1*learning_rate*sum(d_erro_d_saida_h2.*d_saida_d_entrada_h2,1);
%First hidden layer (The neighbor layer of the seccond hidden layer)
%chain rule
d_erro_d_saida_h1 = -1*w2*grad_h2;
d_saida_d_entrada_h1 = sig(h1_in,sig_a,’True’);
grad_h1 = sum(grad_h2)*d_saida_d_entrada_h1; %então daqui, tem que sair um 3×1
d_entrada_d_pesos_h1 = enter;
d_erro_d_pesos_h1 = d_entrada_d_pesos_h1*grad_h1′; %a segunda variável tem que resultar em um 1×3
% Update the wights and bias
w1 = w1 -1*learning_rate*d_erro_d_pesos_h1;
b1 = b1 -1*learning_rate*sum(d_erro_d_saida_h1.*d_saida_d_entrada_h1,1);
end
erro_atual = (soma/(2*size(x,2)));
erros_epoca = [erros_epoca;erro_atual];
if erros_epoca(epoch) <limiar
break
else
end
end
%testing the output of neural network
vetor_teste = 1:1000;
resposta_teste = zeros(1,size(vetor_teste,2));
for i = 1:size(vetor_teste,2)
enter_teste = conj_entrada(:,i);
h1_in_teste = [w1;b1]’*[enter_teste;1];
h1_out_teste = sig(h1_in_teste,sig_a,’False’);
h2_in_teste = [w2;b2]’*[h1_out_teste;1];
h2_out_teste = sig(h2_in_teste,sig_a,’False’);
saida_in_teste = [w_out;b_out]’*[h2_out_teste;1];
saida_out_teste = saida_in_teste; % a função de saída é linear;
resposta_teste(i) = saida_out_teste;
end
plot(1:size(erros_epoca,1),erros_epoca);
% plot(x,y3,’b’,vetor_teste,resposta_teste,’r’);
The code of my sigmoid activation function is below:
function [vetor_saida] = sig(vetor_entrada, const1, derivative)
if strcmp(derivative, ‘False’) == 1
vetor_saida = 1 ./ (1 + exp(-const1 * vetor_entrada));
else
sig_value = sig(vetor_entrada, const1, ‘False’);
vetor_saida = const1 * sig_value .* (1 – sig_value);
end
endI’m trying to do neural network with 2 hidden layers and one neuron in the output layer without any toolboxes and just with matrix and vectors multiplications. To do this, I created fictional simple data as below to help me in this task:
%Data
x = 1:1000;
y1 = sind(x);
y2 = sind(x+30);
y3 = cosd(x);
y4 = cosd(x+30);
y5 = cosd(x+45);
% y6 will be the desired output data taht I would like my neural network
% try to predict
y6 = (y1 + y2 + y3 + y4 + y5);
Then, I coded as I thought to be be the right way, but my neural network can´t reach a good result, as below:
My doubt is if the result isn´t good because my implementation isn´t right or because I need to add more mechanisms im my neural network (like momentum, regularization and etc.) ?
I will post my code below sorry about the naem of some variables, but originally I wrote this code in portuguese. I will comment the code to help undestand it
%Nueral network achictecture
n_h1 = 10;
n_h2 = 11;
n_out = 1;
%Adjustable parameters
w1 = rand(5,n_h1);
b1 = ones(1,n_h1)*rand(1,1);
w2 = rand(n_h1,n_h2);
b2 = ones(1,n_h2)*rand(1,1);
w_out = rand(n_h2,n_out);
b_out = ones(1,n_out)*rand(1,1);
sig_a = 1;
learning_rate = 0.001;
limiar = 0.002;
%Helpful variables
max_epocas = 1000;
conj_entrada = [y1;y2;y3;y4;y5];
erros_epoca = [];
%Backpropagation
for epoch = 1:max_epocas
for i = 1:size(conj_entrada,2)
if i ==1
soma = 0;
else
end
enter = conj_entrada(:,i);
h1_in = [w1;b1]’*[enter;1];
h1_out = sig(h1_in,sig_a,’False’);
h2_in = [w2;b2]’*[h1_out;1];
h2_out = sig(h2_in,sig_a,’False’);
saida_in = [w_out;b_out]’*[h2_out;1];
saida_out = saida_in;
erro = y6(i) – saida_out;
soma = soma + (erro^2);
%Here starts the part of the code where the gradients are being
%calculated. Note that, here, I tried to folllow the chain rule.
%let me try to help in the understanding. Saida in portuguese is
%like output in english so when you read ,for example,
%d_erro_d_saida_out you need to know that this is the derivative of
%the error in relation with the output of the output layer. In the
%same way, entrada means input and pesos means weights
%output layer
%chain rule
d_erro_d_saida_out = -1*erro;
d_saida_d_entrada_out = 1; %linear
grad_saida = erro*d_saida_d_entrada_out;
d_entrada_d_pesos_out = h2_out;
d_erro_d_pesos_out = d_erro_d_saida_out*d_saida_d_entrada_out*d_entrada_d_pesos_out;
% Update the wights and bias
w_out = w_out -learning_rate*d_erro_d_pesos_out;
b_out = b_out -learning_rate*d_erro_d_saida_out*d_saida_d_entrada_out;
%Second hidden layer (The neighbor layer of the output layer)
%chain rule
d_erro_d_saida_h2 = -1*w_out*grad_saida;
d_saida_d_entrada_h2 = sig(h2_in,sig_a,’True’);
grad_h2 = sum(grad_saida)*d_saida_d_entrada_h2;
d_entrada_d_pesos_h2 = h1_out;
d_erro_d_pesos_h2 = d_entrada_d_pesos_h2*grad_h2′;
% Update the wights and bias
w2 = w2 -1*learning_rate*d_erro_d_pesos_h2;
b2 = b2 -1*learning_rate*sum(d_erro_d_saida_h2.*d_saida_d_entrada_h2,1);
%First hidden layer (The neighbor layer of the seccond hidden layer)
%chain rule
d_erro_d_saida_h1 = -1*w2*grad_h2;
d_saida_d_entrada_h1 = sig(h1_in,sig_a,’True’);
grad_h1 = sum(grad_h2)*d_saida_d_entrada_h1; %então daqui, tem que sair um 3×1
d_entrada_d_pesos_h1 = enter;
d_erro_d_pesos_h1 = d_entrada_d_pesos_h1*grad_h1′; %a segunda variável tem que resultar em um 1×3
% Update the wights and bias
w1 = w1 -1*learning_rate*d_erro_d_pesos_h1;
b1 = b1 -1*learning_rate*sum(d_erro_d_saida_h1.*d_saida_d_entrada_h1,1);
end
erro_atual = (soma/(2*size(x,2)));
erros_epoca = [erros_epoca;erro_atual];
if erros_epoca(epoch) <limiar
break
else
end
end
%testing the output of neural network
vetor_teste = 1:1000;
resposta_teste = zeros(1,size(vetor_teste,2));
for i = 1:size(vetor_teste,2)
enter_teste = conj_entrada(:,i);
h1_in_teste = [w1;b1]’*[enter_teste;1];
h1_out_teste = sig(h1_in_teste,sig_a,’False’);
h2_in_teste = [w2;b2]’*[h1_out_teste;1];
h2_out_teste = sig(h2_in_teste,sig_a,’False’);
saida_in_teste = [w_out;b_out]’*[h2_out_teste;1];
saida_out_teste = saida_in_teste; % a função de saída é linear;
resposta_teste(i) = saida_out_teste;
end
plot(1:size(erros_epoca,1),erros_epoca);
% plot(x,y3,’b’,vetor_teste,resposta_teste,’r’);
The code of my sigmoid activation function is below:
function [vetor_saida] = sig(vetor_entrada, const1, derivative)
if strcmp(derivative, ‘False’) == 1
vetor_saida = 1 ./ (1 + exp(-const1 * vetor_entrada));
else
sig_value = sig(vetor_entrada, const1, ‘False’);
vetor_saida = const1 * sig_value .* (1 – sig_value);
end
end I’m trying to do neural network with 2 hidden layers and one neuron in the output layer without any toolboxes and just with matrix and vectors multiplications. To do this, I created fictional simple data as below to help me in this task:
%Data
x = 1:1000;
y1 = sind(x);
y2 = sind(x+30);
y3 = cosd(x);
y4 = cosd(x+30);
y5 = cosd(x+45);
% y6 will be the desired output data taht I would like my neural network
% try to predict
y6 = (y1 + y2 + y3 + y4 + y5);
Then, I coded as I thought to be be the right way, but my neural network can´t reach a good result, as below:
My doubt is if the result isn´t good because my implementation isn´t right or because I need to add more mechanisms im my neural network (like momentum, regularization and etc.) ?
I will post my code below sorry about the naem of some variables, but originally I wrote this code in portuguese. I will comment the code to help undestand it
%Nueral network achictecture
n_h1 = 10;
n_h2 = 11;
n_out = 1;
%Adjustable parameters
w1 = rand(5,n_h1);
b1 = ones(1,n_h1)*rand(1,1);
w2 = rand(n_h1,n_h2);
b2 = ones(1,n_h2)*rand(1,1);
w_out = rand(n_h2,n_out);
b_out = ones(1,n_out)*rand(1,1);
sig_a = 1;
learning_rate = 0.001;
limiar = 0.002;
%Helpful variables
max_epocas = 1000;
conj_entrada = [y1;y2;y3;y4;y5];
erros_epoca = [];
%Backpropagation
for epoch = 1:max_epocas
for i = 1:size(conj_entrada,2)
if i ==1
soma = 0;
else
end
enter = conj_entrada(:,i);
h1_in = [w1;b1]’*[enter;1];
h1_out = sig(h1_in,sig_a,’False’);
h2_in = [w2;b2]’*[h1_out;1];
h2_out = sig(h2_in,sig_a,’False’);
saida_in = [w_out;b_out]’*[h2_out;1];
saida_out = saida_in;
erro = y6(i) – saida_out;
soma = soma + (erro^2);
%Here starts the part of the code where the gradients are being
%calculated. Note that, here, I tried to folllow the chain rule.
%let me try to help in the understanding. Saida in portuguese is
%like output in english so when you read ,for example,
%d_erro_d_saida_out you need to know that this is the derivative of
%the error in relation with the output of the output layer. In the
%same way, entrada means input and pesos means weights
%output layer
%chain rule
d_erro_d_saida_out = -1*erro;
d_saida_d_entrada_out = 1; %linear
grad_saida = erro*d_saida_d_entrada_out;
d_entrada_d_pesos_out = h2_out;
d_erro_d_pesos_out = d_erro_d_saida_out*d_saida_d_entrada_out*d_entrada_d_pesos_out;
% Update the wights and bias
w_out = w_out -learning_rate*d_erro_d_pesos_out;
b_out = b_out -learning_rate*d_erro_d_saida_out*d_saida_d_entrada_out;
%Second hidden layer (The neighbor layer of the output layer)
%chain rule
d_erro_d_saida_h2 = -1*w_out*grad_saida;
d_saida_d_entrada_h2 = sig(h2_in,sig_a,’True’);
grad_h2 = sum(grad_saida)*d_saida_d_entrada_h2;
d_entrada_d_pesos_h2 = h1_out;
d_erro_d_pesos_h2 = d_entrada_d_pesos_h2*grad_h2′;
% Update the wights and bias
w2 = w2 -1*learning_rate*d_erro_d_pesos_h2;
b2 = b2 -1*learning_rate*sum(d_erro_d_saida_h2.*d_saida_d_entrada_h2,1);
%First hidden layer (The neighbor layer of the seccond hidden layer)
%chain rule
d_erro_d_saida_h1 = -1*w2*grad_h2;
d_saida_d_entrada_h1 = sig(h1_in,sig_a,’True’);
grad_h1 = sum(grad_h2)*d_saida_d_entrada_h1; %então daqui, tem que sair um 3×1
d_entrada_d_pesos_h1 = enter;
d_erro_d_pesos_h1 = d_entrada_d_pesos_h1*grad_h1′; %a segunda variável tem que resultar em um 1×3
% Update the wights and bias
w1 = w1 -1*learning_rate*d_erro_d_pesos_h1;
b1 = b1 -1*learning_rate*sum(d_erro_d_saida_h1.*d_saida_d_entrada_h1,1);
end
erro_atual = (soma/(2*size(x,2)));
erros_epoca = [erros_epoca;erro_atual];
if erros_epoca(epoch) <limiar
break
else
end
end
%testing the output of neural network
vetor_teste = 1:1000;
resposta_teste = zeros(1,size(vetor_teste,2));
for i = 1:size(vetor_teste,2)
enter_teste = conj_entrada(:,i);
h1_in_teste = [w1;b1]’*[enter_teste;1];
h1_out_teste = sig(h1_in_teste,sig_a,’False’);
h2_in_teste = [w2;b2]’*[h1_out_teste;1];
h2_out_teste = sig(h2_in_teste,sig_a,’False’);
saida_in_teste = [w_out;b_out]’*[h2_out_teste;1];
saida_out_teste = saida_in_teste; % a função de saída é linear;
resposta_teste(i) = saida_out_teste;
end
plot(1:size(erros_epoca,1),erros_epoca);
% plot(x,y3,’b’,vetor_teste,resposta_teste,’r’);
The code of my sigmoid activation function is below:
function [vetor_saida] = sig(vetor_entrada, const1, derivative)
if strcmp(derivative, ‘False’) == 1
vetor_saida = 1 ./ (1 + exp(-const1 * vetor_entrada));
else
sig_value = sig(vetor_entrada, const1, ‘False’);
vetor_saida = const1 * sig_value .* (1 – sig_value);
end
end neural network, backpropagation MATLAB Answers — New Questions
mex_C_win64 vs mingw64
I am having trouble executing mex files. Currently my compiler configurations looks like this:
>> mex.getCompilerConfigurations(‘C’)
ans =
CompilerConfiguration with properties:
Name: ‘MinGW64 Compiler (C)’
Manufacturer: ‘GNU’
Language: ‘C’
Version: ‘6.3.0’
Location: ‘C:MinGW8mingw64’
ShortName: ‘mingw64’
Priority: ‘E’
Details: [1×1 mex.CompilerConfigurationDetails]
LinkerName: ‘C:MinGW8mingw64bingcc’
LinkerVersion: ”
MexOpt: ‘C:Users<Username deducted>AppDataRoamingMathWorksMATLABR2022bmex_C_win64.xml’
However, other people in my organization mostly have MexOpt like so:
MexOpt: ‘C:Program FilesMATLABR2022bbinwin64mexoptsmingw64.xml’
Is it possible to align with others without manually editing compiler configs, if not how can I manually fix this?I am having trouble executing mex files. Currently my compiler configurations looks like this:
>> mex.getCompilerConfigurations(‘C’)
ans =
CompilerConfiguration with properties:
Name: ‘MinGW64 Compiler (C)’
Manufacturer: ‘GNU’
Language: ‘C’
Version: ‘6.3.0’
Location: ‘C:MinGW8mingw64’
ShortName: ‘mingw64’
Priority: ‘E’
Details: [1×1 mex.CompilerConfigurationDetails]
LinkerName: ‘C:MinGW8mingw64bingcc’
LinkerVersion: ”
MexOpt: ‘C:Users<Username deducted>AppDataRoamingMathWorksMATLABR2022bmex_C_win64.xml’
However, other people in my organization mostly have MexOpt like so:
MexOpt: ‘C:Program FilesMATLABR2022bbinwin64mexoptsmingw64.xml’
Is it possible to align with others without manually editing compiler configs, if not how can I manually fix this? I am having trouble executing mex files. Currently my compiler configurations looks like this:
>> mex.getCompilerConfigurations(‘C’)
ans =
CompilerConfiguration with properties:
Name: ‘MinGW64 Compiler (C)’
Manufacturer: ‘GNU’
Language: ‘C’
Version: ‘6.3.0’
Location: ‘C:MinGW8mingw64’
ShortName: ‘mingw64’
Priority: ‘E’
Details: [1×1 mex.CompilerConfigurationDetails]
LinkerName: ‘C:MinGW8mingw64bingcc’
LinkerVersion: ”
MexOpt: ‘C:Users<Username deducted>AppDataRoamingMathWorksMATLABR2022bmex_C_win64.xml’
However, other people in my organization mostly have MexOpt like so:
MexOpt: ‘C:Program FilesMATLABR2022bbinwin64mexoptsmingw64.xml’
Is it possible to align with others without manually editing compiler configs, if not how can I manually fix this? mex, compiler MATLAB Answers — New Questions
Why do the same system matlab and simulink get different step responses?
As I asked, I want to design a fractional pid controller for a model. Unfortunately, the results I got with step in matlab are quite different from those in simulink
.
Here the orange line is the output and the blue line is the offset,Now let me show you the situation of matlab.The specific parameters of the controller are consistent with the code below
cs=fopid(9.503084707494814e+03,1.889631254823942e+02,2.304958553299564e+02,0.058440555124293,1.558103446462550);%This is parameter of controller
gs=tf(118700,[1 1085 1224000]);%This is the transfer function of the controlled object
step(feedback(cs*gs,1))%Step Response of Closed-loop Transfer Function
This is the general situation. I feel confused now.As I asked, I want to design a fractional pid controller for a model. Unfortunately, the results I got with step in matlab are quite different from those in simulink
.
Here the orange line is the output and the blue line is the offset,Now let me show you the situation of matlab.The specific parameters of the controller are consistent with the code below
cs=fopid(9.503084707494814e+03,1.889631254823942e+02,2.304958553299564e+02,0.058440555124293,1.558103446462550);%This is parameter of controller
gs=tf(118700,[1 1085 1224000]);%This is the transfer function of the controlled object
step(feedback(cs*gs,1))%Step Response of Closed-loop Transfer Function
This is the general situation. I feel confused now. As I asked, I want to design a fractional pid controller for a model. Unfortunately, the results I got with step in matlab are quite different from those in simulink
.
Here the orange line is the output and the blue line is the offset,Now let me show you the situation of matlab.The specific parameters of the controller are consistent with the code below
cs=fopid(9.503084707494814e+03,1.889631254823942e+02,2.304958553299564e+02,0.058440555124293,1.558103446462550);%This is parameter of controller
gs=tf(118700,[1 1085 1224000]);%This is the transfer function of the controlled object
step(feedback(cs*gs,1))%Step Response of Closed-loop Transfer Function
This is the general situation. I feel confused now. matlab, simulink MATLAB Answers — New Questions
Calculating number of monthly events
Hi
I have events time series. (see attached)
How I can calculate monthly number of events.
Thanks for your help!Hi
I have events time series. (see attached)
How I can calculate monthly number of events.
Thanks for your help! Hi
I have events time series. (see attached)
How I can calculate monthly number of events.
Thanks for your help! calculating number of monthly events MATLAB Answers — New Questions
roc plot
area = roc(fileName,exp)
%
% fileName: The name of the output file. It is an image
% exp: a structure representing an experiment with three fields
% – exp.name: a string specifying the experiment name
% – exp.positive_n: the number of positive samples in the experiment
% – exp.likelihoods: likelihoods of each sample where the first
% exp.positive_n number of likelihoods belongs to the positive
% samples while others belong to the negative samples.
% area: a 1×1-dimensional cell array of the area under the roc curve.
true positive,false positive values of ground truth,edge detected image was calculated…then how apply these values to roc program…??????area = roc(fileName,exp)
%
% fileName: The name of the output file. It is an image
% exp: a structure representing an experiment with three fields
% – exp.name: a string specifying the experiment name
% – exp.positive_n: the number of positive samples in the experiment
% – exp.likelihoods: likelihoods of each sample where the first
% exp.positive_n number of likelihoods belongs to the positive
% samples while others belong to the negative samples.
% area: a 1×1-dimensional cell array of the area under the roc curve.
true positive,false positive values of ground truth,edge detected image was calculated…then how apply these values to roc program…?????? area = roc(fileName,exp)
%
% fileName: The name of the output file. It is an image
% exp: a structure representing an experiment with three fields
% – exp.name: a string specifying the experiment name
% – exp.positive_n: the number of positive samples in the experiment
% – exp.likelihoods: likelihoods of each sample where the first
% exp.positive_n number of likelihoods belongs to the positive
% samples while others belong to the negative samples.
% area: a 1×1-dimensional cell array of the area under the roc curve.
true positive,false positive values of ground truth,edge detected image was calculated…then how apply these values to roc program…?????? roc MATLAB Answers — New Questions
Is there a way to model sound wave interference patterns using Phased Array System Toolbox?
I am trying to find a way to model the constructive/destructive interference patterns for sound speakers in a room, i.e. concentrating sound in a specific part of the room through creating constructive interference from several non-directional (aka regular) speakers. I have been looking at the Phased Array System Toolbox (because I am thinking about an array of speakers) and think that might be the best fit for what I am looking for. Not sure if there is another Toolbox out there that does similar things or the Phased Array System is the best fit for this? Thank you!I am trying to find a way to model the constructive/destructive interference patterns for sound speakers in a room, i.e. concentrating sound in a specific part of the room through creating constructive interference from several non-directional (aka regular) speakers. I have been looking at the Phased Array System Toolbox (because I am thinking about an array of speakers) and think that might be the best fit for what I am looking for. Not sure if there is another Toolbox out there that does similar things or the Phased Array System is the best fit for this? Thank you! I am trying to find a way to model the constructive/destructive interference patterns for sound speakers in a room, i.e. concentrating sound in a specific part of the room through creating constructive interference from several non-directional (aka regular) speakers. I have been looking at the Phased Array System Toolbox (because I am thinking about an array of speakers) and think that might be the best fit for what I am looking for. Not sure if there is another Toolbox out there that does similar things or the Phased Array System is the best fit for this? Thank you! acoustic modeling, interference patterns MATLAB Answers — New Questions