Tag Archives: matlab
After having used the command “appdesigner” at command window:When an app is running at app designer the same app is automatically running at the main window too.
After having used the command "appdesigner" at command window, the behavior of Matlab changed. Now on I can’t run an application at app designer and at same time run another script at main window. Both windows run the same programm whichever starts first. When an app is strating running at app designer the same app is automatically running at the main window too and vice versa. I used Matlab 10 hours a day 3 months ago with no such behavior: I cant run an app at app designer , stop it at a breakpoint and then use the main window to run a script searching at app variables etc any more.
Thankls in advance.After having used the command "appdesigner" at command window, the behavior of Matlab changed. Now on I can’t run an application at app designer and at same time run another script at main window. Both windows run the same programm whichever starts first. When an app is strating running at app designer the same app is automatically running at the main window too and vice versa. I used Matlab 10 hours a day 3 months ago with no such behavior: I cant run an app at app designer , stop it at a breakpoint and then use the main window to run a script searching at app variables etc any more.
Thankls in advance. After having used the command "appdesigner" at command window, the behavior of Matlab changed. Now on I can’t run an application at app designer and at same time run another script at main window. Both windows run the same programm whichever starts first. When an app is strating running at app designer the same app is automatically running at the main window too and vice versa. I used Matlab 10 hours a day 3 months ago with no such behavior: I cant run an app at app designer , stop it at a breakpoint and then use the main window to run a script searching at app variables etc any more.
Thankls in advance. appdesigner, app designer MATLAB Answers — New Questions
RoadRunner HD Map create
I finished the example of compiling a protobuf file into c++ to generate a rrhd file.
But here, I tried to build the section I selected, but lane and lane boundary didn’t understand how to express the curve, how to specify the coordinates, etc., and I couldn’t find it.
Do I have to create a hd map from a compilation of protobuf files into c++??
I tried to create with matlab, but I couldn’t find a way to add a lane or express it as a curve.
Is there a document related to the above or a link to refer to it??I finished the example of compiling a protobuf file into c++ to generate a rrhd file.
But here, I tried to build the section I selected, but lane and lane boundary didn’t understand how to express the curve, how to specify the coordinates, etc., and I couldn’t find it.
Do I have to create a hd map from a compilation of protobuf files into c++??
I tried to create with matlab, but I couldn’t find a way to add a lane or express it as a curve.
Is there a document related to the above or a link to refer to it?? I finished the example of compiling a protobuf file into c++ to generate a rrhd file.
But here, I tried to build the section I selected, but lane and lane boundary didn’t understand how to express the curve, how to specify the coordinates, etc., and I couldn’t find it.
Do I have to create a hd map from a compilation of protobuf files into c++??
I tried to create with matlab, but I couldn’t find a way to add a lane or express it as a curve.
Is there a document related to the above or a link to refer to it?? roadrunner, c++, matlab MATLAB Answers — New Questions
how to create single switch fault in packed submodules of mmc
how to create single switch fault in packed submodules of mmchow to create single switch fault in packed submodules of mmc how to create single switch fault in packed submodules of mmc switch fault MATLAB Answers — New Questions
Using simulink with two unrelated clocks (non-integer multiples of eachtoher)
I am recieving the following error in Simulink, using Model Composer:
Illegal period. Ensure that this block’s sample period is an integer multiple of the Simulink system period as configured in the Settings tab of the Vitis Model Composer Hub block.
Error occurred during "Block Configuration".
F1 = 16.0362MHz
F2 = 1.023MHz
I need to simulate with two different clocks: F1 and F2
The ratio of F1 and F2 are 15.6757
There is no GCD between F1 and F2.
I am all out of ideas.
I would like to generate a signal on 1.023MHz and sample it on the 16.0362M clock.I am recieving the following error in Simulink, using Model Composer:
Illegal period. Ensure that this block’s sample period is an integer multiple of the Simulink system period as configured in the Settings tab of the Vitis Model Composer Hub block.
Error occurred during "Block Configuration".
F1 = 16.0362MHz
F2 = 1.023MHz
I need to simulate with two different clocks: F1 and F2
The ratio of F1 and F2 are 15.6757
There is no GCD between F1 and F2.
I am all out of ideas.
I would like to generate a signal on 1.023MHz and sample it on the 16.0362M clock. I am recieving the following error in Simulink, using Model Composer:
Illegal period. Ensure that this block’s sample period is an integer multiple of the Simulink system period as configured in the Settings tab of the Vitis Model Composer Hub block.
Error occurred during "Block Configuration".
F1 = 16.0362MHz
F2 = 1.023MHz
I need to simulate with two different clocks: F1 and F2
The ratio of F1 and F2 are 15.6757
There is no GCD between F1 and F2.
I am all out of ideas.
I would like to generate a signal on 1.023MHz and sample it on the 16.0362M clock. clocking, simulink MATLAB Answers — New Questions
MatLab C++ Shared Dll library initialization problem
I am using Matlab 2013a and Visual Studio 2013. I am trying to use MatLab compiled dll from a C++ console application. My simple Matlab test dll and console application is compiled for 64bit machines (I made sure they are 64bit via dumpbin). I also have correct version of MCR installed on my machine (even if it’s not necessary).
I setup my compiler using "mbuild -setup" command.
I compile my .m file using this command line: "mcc -v -W cpplib:mylib -T link:lib myFunc" successfully.
In my console application, I include these libraries: mylib.lib, mclmcrrt.lib, mclmcr.lib, libmx.lib, libmat.lib
and use the libraries in this path "C:Program FilesMATLABR2013aexternlibwin64microsoft"
When I debug my program, it successfully initializes MCR using this call: "mclInitializeApplication(NULL, 0)" but when I call
"mylibInitialize()" in order to initialize my library, program crashes. It doesn’t even throw an axception therefore I cannot handle it using
try/catch block. It gives unhandled exception and access vialoation error message.
These are sample debug output messages I got;
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xercesc_2_7::NoSuchElementException at memory location 0x000000E263EF4E48.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xercesc_2_7::SchemaDateTimeException at memory location 0x000000E263EF4EB8.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xsd_binder::MalformedDocumentError at memory location 0x000000E263EF4E40.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xercesc_2_7::NoSuchElementException at memory location 0x000000E263EF4E48.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: boost::thread_interrupted at memory location 0x000000E2643FF630.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xsd_binder::MalformedDocumentError at memory location 0x000000E263EFA640.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: boost::thread_interrupted at memory location 0x000000E2642FFCD0.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: std::runtime_error at memory location 0x000000E264EFF530.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: CryptoPP::AES_PHM_Decryption::InvalidCiphertextOrKey at memory location 0x000000E264EFB0F0.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: tfFailedException at memory location 0x000000E264EF4C10.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: varflowFailedException at memory location 0x000000E264EF9410.
The thread 0x3550 has exited with code 0 (0x0).
‘MatlabTest.exe’ (Win32): Loaded ‘C:Program FilesMATLABR2013abinwin64hgbuiltins.dll’. Cannot find or open the PDB file.
First-chance exception at 0x0000000000B46E60 (m_interpreter.dll) in MatlabTest.exe: 0xC0000005: Access violation reading location 0x0000000064EF3B90.
Unhandled exception at 0x0000000000B46E60 (m_interpreter.dll) in MatlabTest.exe: 0xC0000005: Access violation reading location 0x0000000064EF3B90.
The program ‘[12952] MatlabTest.exe’ has exited with code 0 (0x0).
I installed MCR to another machine and tried to run this console application. I got the same result.
I tried Loren’s Vigenere example too,
http://blogs.mathworks.com/loren/2011/02/03/creating-c-shared-libraries-and-dlls/#respond
It didn’t work either.
I couldn’t find any helpful answer on Matlab community or stackoverflow.
Do you have any idea why this is happening?
ThanksI am using Matlab 2013a and Visual Studio 2013. I am trying to use MatLab compiled dll from a C++ console application. My simple Matlab test dll and console application is compiled for 64bit machines (I made sure they are 64bit via dumpbin). I also have correct version of MCR installed on my machine (even if it’s not necessary).
I setup my compiler using "mbuild -setup" command.
I compile my .m file using this command line: "mcc -v -W cpplib:mylib -T link:lib myFunc" successfully.
In my console application, I include these libraries: mylib.lib, mclmcrrt.lib, mclmcr.lib, libmx.lib, libmat.lib
and use the libraries in this path "C:Program FilesMATLABR2013aexternlibwin64microsoft"
When I debug my program, it successfully initializes MCR using this call: "mclInitializeApplication(NULL, 0)" but when I call
"mylibInitialize()" in order to initialize my library, program crashes. It doesn’t even throw an axception therefore I cannot handle it using
try/catch block. It gives unhandled exception and access vialoation error message.
These are sample debug output messages I got;
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xercesc_2_7::NoSuchElementException at memory location 0x000000E263EF4E48.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xercesc_2_7::SchemaDateTimeException at memory location 0x000000E263EF4EB8.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xsd_binder::MalformedDocumentError at memory location 0x000000E263EF4E40.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xercesc_2_7::NoSuchElementException at memory location 0x000000E263EF4E48.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: boost::thread_interrupted at memory location 0x000000E2643FF630.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xsd_binder::MalformedDocumentError at memory location 0x000000E263EFA640.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: boost::thread_interrupted at memory location 0x000000E2642FFCD0.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: std::runtime_error at memory location 0x000000E264EFF530.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: CryptoPP::AES_PHM_Decryption::InvalidCiphertextOrKey at memory location 0x000000E264EFB0F0.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: tfFailedException at memory location 0x000000E264EF4C10.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: varflowFailedException at memory location 0x000000E264EF9410.
The thread 0x3550 has exited with code 0 (0x0).
‘MatlabTest.exe’ (Win32): Loaded ‘C:Program FilesMATLABR2013abinwin64hgbuiltins.dll’. Cannot find or open the PDB file.
First-chance exception at 0x0000000000B46E60 (m_interpreter.dll) in MatlabTest.exe: 0xC0000005: Access violation reading location 0x0000000064EF3B90.
Unhandled exception at 0x0000000000B46E60 (m_interpreter.dll) in MatlabTest.exe: 0xC0000005: Access violation reading location 0x0000000064EF3B90.
The program ‘[12952] MatlabTest.exe’ has exited with code 0 (0x0).
I installed MCR to another machine and tried to run this console application. I got the same result.
I tried Loren’s Vigenere example too,
http://blogs.mathworks.com/loren/2011/02/03/creating-c-shared-libraries-and-dlls/#respond
It didn’t work either.
I couldn’t find any helpful answer on Matlab community or stackoverflow.
Do you have any idea why this is happening?
Thanks I am using Matlab 2013a and Visual Studio 2013. I am trying to use MatLab compiled dll from a C++ console application. My simple Matlab test dll and console application is compiled for 64bit machines (I made sure they are 64bit via dumpbin). I also have correct version of MCR installed on my machine (even if it’s not necessary).
I setup my compiler using "mbuild -setup" command.
I compile my .m file using this command line: "mcc -v -W cpplib:mylib -T link:lib myFunc" successfully.
In my console application, I include these libraries: mylib.lib, mclmcrrt.lib, mclmcr.lib, libmx.lib, libmat.lib
and use the libraries in this path "C:Program FilesMATLABR2013aexternlibwin64microsoft"
When I debug my program, it successfully initializes MCR using this call: "mclInitializeApplication(NULL, 0)" but when I call
"mylibInitialize()" in order to initialize my library, program crashes. It doesn’t even throw an axception therefore I cannot handle it using
try/catch block. It gives unhandled exception and access vialoation error message.
These are sample debug output messages I got;
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xercesc_2_7::NoSuchElementException at memory location 0x000000E263EF4E48.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xercesc_2_7::SchemaDateTimeException at memory location 0x000000E263EF4EB8.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xsd_binder::MalformedDocumentError at memory location 0x000000E263EF4E40.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xercesc_2_7::NoSuchElementException at memory location 0x000000E263EF4E48.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: boost::thread_interrupted at memory location 0x000000E2643FF630.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: xsd_binder::MalformedDocumentError at memory location 0x000000E263EFA640.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: boost::thread_interrupted at memory location 0x000000E2642FFCD0.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: std::runtime_error at memory location 0x000000E264EFF530.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: CryptoPP::AES_PHM_Decryption::InvalidCiphertextOrKey at memory location 0x000000E264EFB0F0.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: tfFailedException at memory location 0x000000E264EF4C10.
First-chance exception at 0x00007FFA22761F08 in MatlabTest.exe: Microsoft C++ exception: varflowFailedException at memory location 0x000000E264EF9410.
The thread 0x3550 has exited with code 0 (0x0).
‘MatlabTest.exe’ (Win32): Loaded ‘C:Program FilesMATLABR2013abinwin64hgbuiltins.dll’. Cannot find or open the PDB file.
First-chance exception at 0x0000000000B46E60 (m_interpreter.dll) in MatlabTest.exe: 0xC0000005: Access violation reading location 0x0000000064EF3B90.
Unhandled exception at 0x0000000000B46E60 (m_interpreter.dll) in MatlabTest.exe: 0xC0000005: Access violation reading location 0x0000000064EF3B90.
The program ‘[12952] MatlabTest.exe’ has exited with code 0 (0x0).
I installed MCR to another machine and tried to run this console application. I got the same result.
I tried Loren’s Vigenere example too,
http://blogs.mathworks.com/loren/2011/02/03/creating-c-shared-libraries-and-dlls/#respond
It didn’t work either.
I couldn’t find any helpful answer on Matlab community or stackoverflow.
Do you have any idea why this is happening?
Thanks matlab compiler, mcc, c++, dll, crash MATLAB Answers — New Questions
Superimpose Matlab figure to Mathematica figure, not vectorized
A PDF vectorized plot is generated from a MatLab figure. Import this Matlab PDF figure to Mathematica and superimpose it onto a Mathematica figure. Finally in Mathematica, export this Mathematica and Matlab figure as a vectorized PDF plot. It turns out the MatLab part of the figure is not a vectorized plot. No such issue when there’s no Matlab involved. I’m using Mathematica 11 and 14.3 in Windows. How to resolve it? Example with my code for Matlab and Mathematica:
[X,Y] = meshgrid(-5:.5:5);
Z = Y.*sin(X) – X.*cos(Y);
s = surf(X,Y,Z,’FaceAlpha’,0.5)
exportgraphics(gcf,’vectorfig.pdf’,’ContentType’,’vector’)
Show[Plot[x, {x, 0, 1}],
Epilog -> {Inset[Import["vectorfig.pdf"][[1]], {0.5, 0.5}, Center, {Automatic, 0.4} ]}]A PDF vectorized plot is generated from a MatLab figure. Import this Matlab PDF figure to Mathematica and superimpose it onto a Mathematica figure. Finally in Mathematica, export this Mathematica and Matlab figure as a vectorized PDF plot. It turns out the MatLab part of the figure is not a vectorized plot. No such issue when there’s no Matlab involved. I’m using Mathematica 11 and 14.3 in Windows. How to resolve it? Example with my code for Matlab and Mathematica:
[X,Y] = meshgrid(-5:.5:5);
Z = Y.*sin(X) – X.*cos(Y);
s = surf(X,Y,Z,’FaceAlpha’,0.5)
exportgraphics(gcf,’vectorfig.pdf’,’ContentType’,’vector’)
Show[Plot[x, {x, 0, 1}],
Epilog -> {Inset[Import["vectorfig.pdf"][[1]], {0.5, 0.5}, Center, {Automatic, 0.4} ]}] A PDF vectorized plot is generated from a MatLab figure. Import this Matlab PDF figure to Mathematica and superimpose it onto a Mathematica figure. Finally in Mathematica, export this Mathematica and Matlab figure as a vectorized PDF plot. It turns out the MatLab part of the figure is not a vectorized plot. No such issue when there’s no Matlab involved. I’m using Mathematica 11 and 14.3 in Windows. How to resolve it? Example with my code for Matlab and Mathematica:
[X,Y] = meshgrid(-5:.5:5);
Z = Y.*sin(X) – X.*cos(Y);
s = surf(X,Y,Z,’FaceAlpha’,0.5)
exportgraphics(gcf,’vectorfig.pdf’,’ContentType’,’vector’)
Show[Plot[x, {x, 0, 1}],
Epilog -> {Inset[Import["vectorfig.pdf"][[1]], {0.5, 0.5}, Center, {Automatic, 0.4} ]}] mathematica, vectorplot MATLAB Answers — New Questions
How can I extract the numerical array from a hypercube object?
Hi! I’ve been using the hyperspectral library for the image processing toolbox for some years now. In the beggining, when a variable of class hypercube was created, it was storing the nomerical array (i.e. the spectral image) in a struct way that you could acces via dot indexing, for instance:
spectral_image = cube.DataCube;
However this seems not to be working anymore. Instead if I try this, I get a string instead of a numerical array. I’ve cheked and there is a funcion called gather which is supposed to be for this. I have also tried:
spectral_image = gather(cube);
But it is also not working. I get the following error, but my spectral image fits more than enough in my RAM, so I am sure this is not a problem.
Dot indexing is not supported for variables of this type.
Error in hypercube/gather (line 1398)
if isa(obj.BlockedDataCube.Adapter,’images.blocked.InMemory’)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The problem is that I have spectral images stored in files in hypercube class that I saved some time ago with Matlab R2023 version or even earlier, but now I can not access directly to this numerical arrays that previously were perfectly fitting in my RAM.
Any clue about how could I fix this?
Thanks in advance.Hi! I’ve been using the hyperspectral library for the image processing toolbox for some years now. In the beggining, when a variable of class hypercube was created, it was storing the nomerical array (i.e. the spectral image) in a struct way that you could acces via dot indexing, for instance:
spectral_image = cube.DataCube;
However this seems not to be working anymore. Instead if I try this, I get a string instead of a numerical array. I’ve cheked and there is a funcion called gather which is supposed to be for this. I have also tried:
spectral_image = gather(cube);
But it is also not working. I get the following error, but my spectral image fits more than enough in my RAM, so I am sure this is not a problem.
Dot indexing is not supported for variables of this type.
Error in hypercube/gather (line 1398)
if isa(obj.BlockedDataCube.Adapter,’images.blocked.InMemory’)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The problem is that I have spectral images stored in files in hypercube class that I saved some time ago with Matlab R2023 version or even earlier, but now I can not access directly to this numerical arrays that previously were perfectly fitting in my RAM.
Any clue about how could I fix this?
Thanks in advance. Hi! I’ve been using the hyperspectral library for the image processing toolbox for some years now. In the beggining, when a variable of class hypercube was created, it was storing the nomerical array (i.e. the spectral image) in a struct way that you could acces via dot indexing, for instance:
spectral_image = cube.DataCube;
However this seems not to be working anymore. Instead if I try this, I get a string instead of a numerical array. I’ve cheked and there is a funcion called gather which is supposed to be for this. I have also tried:
spectral_image = gather(cube);
But it is also not working. I get the following error, but my spectral image fits more than enough in my RAM, so I am sure this is not a problem.
Dot indexing is not supported for variables of this type.
Error in hypercube/gather (line 1398)
if isa(obj.BlockedDataCube.Adapter,’images.blocked.InMemory’)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The problem is that I have spectral images stored in files in hypercube class that I saved some time ago with Matlab R2023 version or even earlier, but now I can not access directly to this numerical arrays that previously were perfectly fitting in my RAM.
Any clue about how could I fix this?
Thanks in advance. hyperspectral image library, image processing toolbox, hypercube object, hypercube MATLAB Answers — New Questions
addRule throws “Do not use a rule keyword as a variable name.”
I get the error on line 44 of my code: fis = addRule(fis,all); I’ve tried changing the name of the variable name (all) to other names, and the fis. I’ve removed spaces from my variables or renamed them completely.
% Create a Fuzzy Inference System (FIS) with the name "IFR"
fis = mamfis(‘Name’, ‘IFR’);
% Add a variable "input" to the FIS
fis = addInput(fis, [0 200], ‘Name’, ‘MAP_mm’);
% Add membership functions for variable "input"
fis = addMF(fis, "MAP_mm", "trapmf", [0 0 55 75], ‘Name’,"Low");
fis = addMF(fis, "MAP_mm", "trapmf", [55 75 100 120], ‘Name’,"Normal");
fis = addMF(fis, "MAP_mm", "trapmf", [100 120 200 200], ‘Name’,"High");
% HOU trapezoidal
fis = addInput(fis, [0 200], ‘Name’, ‘HOU_ml-hr’);
% HOU Low trapezoidal
fis = addMF(fis, "HOU_ml-hr", "trapmf", [0 0 30 40], ‘Name’,"Low");
% HOU Normal trapezoidal
fis = addMF(fis, "HOU_ml-hr", "trapmf", [30 40 100 125], ‘Name’,"Normal");
% HOU High trapezoidal
fis = addMF(fis, "HOU_ml-hr", "trapmf", [100 125 200 200], ‘Name’,"High");
% Add output variable to the FIS
fis = addOutput(fis, [0 2000], ‘Name’, ‘IFR_ml-hr’);
% Add membership functions for output variable
fis = addMF(fis, "IFR_ml-hr", "trapmf", [0 0 60 100], ‘Name’,"Low");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [0 100 200 400], ‘Name’,"Maintain");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [200 400 600 800], ‘Name’,"Moderate");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [600 800 1000 1500], ‘Name’,"High");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [1000 1500 2000 2000], ‘Name’,"Very_High");
% Create Rules for the FIS
r1 = "If HOU_ml-hr == Low & MAP_mm == Low => IFR_ml-hr == Very_High";
r2 = "If HOU_ml-hr == Normal & MAP_mm == Low => IFR_ml-hr == High";
r3 = "If HOU_ml-hr == High & MAP_mm == Low => IFR_ml-hr == Moderate";
r4 = "If HOU_ml-hr == Low & MAP_mm == Normal => IFR_ml-hr == Moderate";
r5 = "If HOU_ml-hr == Low & MAP_mm == High => IFR_ml-hr == Low";
r6 = "If HOU_ml-hr == Normal & MAP_mm == Normal => IFR_ml-hr == Maintain";
r7 = "If HOU_ml-hr == Normal & MAP_mm == High => IFR_ml-hr == Low";
r8 = "If HOU_ml-hr == High & MAP_mm == Normal =>IFR_ml-hr == Maintain";
r9 = "If HOU_ml-hr == High & MAP_mm == High => IFR_ml-hr == Low";
all = [r1 r2 r3 r4 r5 r6 r7 r8 r9];
% Add rules and enable rule viewing/debugging
fis = addRule(fis,all);
% Evaluate the FIS for inputs [MAP HOU]
sampleInput = [110 120; 60 25; 30 150; 180 90];
out = evalfis(fis, sampleInput);
% Plot membership functions
subplot(3,1,1)
plotmf(fis, ‘input’, 1)
subplot(3,1,2)
plotmf(fis, ‘input’, 2)
subplot(3,1,3)
plotmf(fis, ‘output’,3)I get the error on line 44 of my code: fis = addRule(fis,all); I’ve tried changing the name of the variable name (all) to other names, and the fis. I’ve removed spaces from my variables or renamed them completely.
% Create a Fuzzy Inference System (FIS) with the name "IFR"
fis = mamfis(‘Name’, ‘IFR’);
% Add a variable "input" to the FIS
fis = addInput(fis, [0 200], ‘Name’, ‘MAP_mm’);
% Add membership functions for variable "input"
fis = addMF(fis, "MAP_mm", "trapmf", [0 0 55 75], ‘Name’,"Low");
fis = addMF(fis, "MAP_mm", "trapmf", [55 75 100 120], ‘Name’,"Normal");
fis = addMF(fis, "MAP_mm", "trapmf", [100 120 200 200], ‘Name’,"High");
% HOU trapezoidal
fis = addInput(fis, [0 200], ‘Name’, ‘HOU_ml-hr’);
% HOU Low trapezoidal
fis = addMF(fis, "HOU_ml-hr", "trapmf", [0 0 30 40], ‘Name’,"Low");
% HOU Normal trapezoidal
fis = addMF(fis, "HOU_ml-hr", "trapmf", [30 40 100 125], ‘Name’,"Normal");
% HOU High trapezoidal
fis = addMF(fis, "HOU_ml-hr", "trapmf", [100 125 200 200], ‘Name’,"High");
% Add output variable to the FIS
fis = addOutput(fis, [0 2000], ‘Name’, ‘IFR_ml-hr’);
% Add membership functions for output variable
fis = addMF(fis, "IFR_ml-hr", "trapmf", [0 0 60 100], ‘Name’,"Low");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [0 100 200 400], ‘Name’,"Maintain");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [200 400 600 800], ‘Name’,"Moderate");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [600 800 1000 1500], ‘Name’,"High");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [1000 1500 2000 2000], ‘Name’,"Very_High");
% Create Rules for the FIS
r1 = "If HOU_ml-hr == Low & MAP_mm == Low => IFR_ml-hr == Very_High";
r2 = "If HOU_ml-hr == Normal & MAP_mm == Low => IFR_ml-hr == High";
r3 = "If HOU_ml-hr == High & MAP_mm == Low => IFR_ml-hr == Moderate";
r4 = "If HOU_ml-hr == Low & MAP_mm == Normal => IFR_ml-hr == Moderate";
r5 = "If HOU_ml-hr == Low & MAP_mm == High => IFR_ml-hr == Low";
r6 = "If HOU_ml-hr == Normal & MAP_mm == Normal => IFR_ml-hr == Maintain";
r7 = "If HOU_ml-hr == Normal & MAP_mm == High => IFR_ml-hr == Low";
r8 = "If HOU_ml-hr == High & MAP_mm == Normal =>IFR_ml-hr == Maintain";
r9 = "If HOU_ml-hr == High & MAP_mm == High => IFR_ml-hr == Low";
all = [r1 r2 r3 r4 r5 r6 r7 r8 r9];
% Add rules and enable rule viewing/debugging
fis = addRule(fis,all);
% Evaluate the FIS for inputs [MAP HOU]
sampleInput = [110 120; 60 25; 30 150; 180 90];
out = evalfis(fis, sampleInput);
% Plot membership functions
subplot(3,1,1)
plotmf(fis, ‘input’, 1)
subplot(3,1,2)
plotmf(fis, ‘input’, 2)
subplot(3,1,3)
plotmf(fis, ‘output’,3) I get the error on line 44 of my code: fis = addRule(fis,all); I’ve tried changing the name of the variable name (all) to other names, and the fis. I’ve removed spaces from my variables or renamed them completely.
% Create a Fuzzy Inference System (FIS) with the name "IFR"
fis = mamfis(‘Name’, ‘IFR’);
% Add a variable "input" to the FIS
fis = addInput(fis, [0 200], ‘Name’, ‘MAP_mm’);
% Add membership functions for variable "input"
fis = addMF(fis, "MAP_mm", "trapmf", [0 0 55 75], ‘Name’,"Low");
fis = addMF(fis, "MAP_mm", "trapmf", [55 75 100 120], ‘Name’,"Normal");
fis = addMF(fis, "MAP_mm", "trapmf", [100 120 200 200], ‘Name’,"High");
% HOU trapezoidal
fis = addInput(fis, [0 200], ‘Name’, ‘HOU_ml-hr’);
% HOU Low trapezoidal
fis = addMF(fis, "HOU_ml-hr", "trapmf", [0 0 30 40], ‘Name’,"Low");
% HOU Normal trapezoidal
fis = addMF(fis, "HOU_ml-hr", "trapmf", [30 40 100 125], ‘Name’,"Normal");
% HOU High trapezoidal
fis = addMF(fis, "HOU_ml-hr", "trapmf", [100 125 200 200], ‘Name’,"High");
% Add output variable to the FIS
fis = addOutput(fis, [0 2000], ‘Name’, ‘IFR_ml-hr’);
% Add membership functions for output variable
fis = addMF(fis, "IFR_ml-hr", "trapmf", [0 0 60 100], ‘Name’,"Low");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [0 100 200 400], ‘Name’,"Maintain");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [200 400 600 800], ‘Name’,"Moderate");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [600 800 1000 1500], ‘Name’,"High");
fis = addMF(fis, "IFR_ml-hr", "trapmf", [1000 1500 2000 2000], ‘Name’,"Very_High");
% Create Rules for the FIS
r1 = "If HOU_ml-hr == Low & MAP_mm == Low => IFR_ml-hr == Very_High";
r2 = "If HOU_ml-hr == Normal & MAP_mm == Low => IFR_ml-hr == High";
r3 = "If HOU_ml-hr == High & MAP_mm == Low => IFR_ml-hr == Moderate";
r4 = "If HOU_ml-hr == Low & MAP_mm == Normal => IFR_ml-hr == Moderate";
r5 = "If HOU_ml-hr == Low & MAP_mm == High => IFR_ml-hr == Low";
r6 = "If HOU_ml-hr == Normal & MAP_mm == Normal => IFR_ml-hr == Maintain";
r7 = "If HOU_ml-hr == Normal & MAP_mm == High => IFR_ml-hr == Low";
r8 = "If HOU_ml-hr == High & MAP_mm == Normal =>IFR_ml-hr == Maintain";
r9 = "If HOU_ml-hr == High & MAP_mm == High => IFR_ml-hr == Low";
all = [r1 r2 r3 r4 r5 r6 r7 r8 r9];
% Add rules and enable rule viewing/debugging
fis = addRule(fis,all);
% Evaluate the FIS for inputs [MAP HOU]
sampleInput = [110 120; 60 25; 30 150; 180 90];
out = evalfis(fis, sampleInput);
% Plot membership functions
subplot(3,1,1)
plotmf(fis, ‘input’, 1)
subplot(3,1,2)
plotmf(fis, ‘input’, 2)
subplot(3,1,3)
plotmf(fis, ‘output’,3) addrule MATLAB Answers — New Questions
How to run a Windows-generated .slxp file on macOS?
I received a Simulink .slxp file (Protected Model) from an external source. It was originally generated on a Windows 64-bit (win64) system.
Is there any way to run or use this file on a macOS environment? Any advice would be appreciated.I received a Simulink .slxp file (Protected Model) from an external source. It was originally generated on a Windows 64-bit (win64) system.
Is there any way to run or use this file on a macOS environment? Any advice would be appreciated. I received a Simulink .slxp file (Protected Model) from an external source. It was originally generated on a Windows 64-bit (win64) system.
Is there any way to run or use this file on a macOS environment? Any advice would be appreciated. simulink MATLAB Answers — New Questions
Using for loop with if condition
Respectd Team,
I am looking solution for genration of data load by text.
My problem in simple manner, We have 14 floor building with 20 rooms in each floor, I have to write a code for once the person is enter into the room 1st floor 101 and remaining values in corresponding top floors should be zer (ex :201,301….1401) and if the person enter into 2room no 415 (4 floor & no 15) than correpsonding values in 115,215,315,515….1415 should be zero.Respectd Team,
I am looking solution for genration of data load by text.
My problem in simple manner, We have 14 floor building with 20 rooms in each floor, I have to write a code for once the person is enter into the room 1st floor 101 and remaining values in corresponding top floors should be zer (ex :201,301….1401) and if the person enter into 2room no 415 (4 floor & no 15) than correpsonding values in 115,215,315,515….1415 should be zero. Respectd Team,
I am looking solution for genration of data load by text.
My problem in simple manner, We have 14 floor building with 20 rooms in each floor, I have to write a code for once the person is enter into the room 1st floor 101 and remaining values in corresponding top floors should be zer (ex :201,301….1401) and if the person enter into 2room no 415 (4 floor & no 15) than correpsonding values in 115,215,315,515….1415 should be zero. for loop, if condition MATLAB Answers — New Questions
i can’t select msg type to “sensor_msgs/Imagae” in ROS2 Subscribe block.
I try to read a ros image message in simulink.
A msg type is "sensor_msgs/Image".
But i can’t select msg type to "sensor_msgs/Imagae" in ROS2 Subscribe block.
however, it is selected in ROS subscribe block.I try to read a ros image message in simulink.
A msg type is "sensor_msgs/Image".
But i can’t select msg type to "sensor_msgs/Imagae" in ROS2 Subscribe block.
however, it is selected in ROS subscribe block. I try to read a ros image message in simulink.
A msg type is "sensor_msgs/Image".
But i can’t select msg type to "sensor_msgs/Imagae" in ROS2 Subscribe block.
however, it is selected in ROS subscribe block. ros2, simulink MATLAB Answers — New Questions
power spectral density of nonstationary data
I am hoping those with seasoned experience with signaling can assist me with two questions. The ultimate goal is to obtain a power spectral density of very nonstationay optical data sampled at 1 kHz (attached). There is a huge DC offset that persists even after detrending or subtracting the mean. For such nonstationary data, pwelch seems most appropriate but a rather odd looking series of deminishing regularly space peaks is outputted across the frequency domain. Is the windowing wrong? Is this the wrong analysis to do?
First, here is the pwelch based code I ran:
x = time_series – mean(time_series);
fs = 1000;
[pxx_smooth, f] = pwelch(x, hann(length(x)/2), [], fs);
figure;
plot(f, 10*log10(pxx_smooth), ‘LineWidth’, 1.5);
If you run the code on the attached time-series you get no distinct peaks and a huge off wtih a very narrow frequency domain. This makes no sense.
Second, despite supposedly not correct to do since this is non-stationary data, I ran an FFT:
fs = 1000;
%x = detrend(time_series);
x = time_series-mean(time_series);
figure;
L = length(x);
plot(fs/L*(-L/2:L/2-1),abs(fftshift(x)),"LineWidth",2)
With an FFT you get more defined peaks and over a much larger frequency range (see attached jpg), but confused why the asymmetry when using ffshift, where it should be symmetrical about x = 0. Why the asymmetry?
I am convinced I doing something fundamentally wrong with the processing or windowing and odd looking output is not inherently due to the data itself. Any assistance in how to correctly attain a PSD for this data and what is the most valid approach for nonstationary data of this nature would be greatly appreciated.I am hoping those with seasoned experience with signaling can assist me with two questions. The ultimate goal is to obtain a power spectral density of very nonstationay optical data sampled at 1 kHz (attached). There is a huge DC offset that persists even after detrending or subtracting the mean. For such nonstationary data, pwelch seems most appropriate but a rather odd looking series of deminishing regularly space peaks is outputted across the frequency domain. Is the windowing wrong? Is this the wrong analysis to do?
First, here is the pwelch based code I ran:
x = time_series – mean(time_series);
fs = 1000;
[pxx_smooth, f] = pwelch(x, hann(length(x)/2), [], fs);
figure;
plot(f, 10*log10(pxx_smooth), ‘LineWidth’, 1.5);
If you run the code on the attached time-series you get no distinct peaks and a huge off wtih a very narrow frequency domain. This makes no sense.
Second, despite supposedly not correct to do since this is non-stationary data, I ran an FFT:
fs = 1000;
%x = detrend(time_series);
x = time_series-mean(time_series);
figure;
L = length(x);
plot(fs/L*(-L/2:L/2-1),abs(fftshift(x)),"LineWidth",2)
With an FFT you get more defined peaks and over a much larger frequency range (see attached jpg), but confused why the asymmetry when using ffshift, where it should be symmetrical about x = 0. Why the asymmetry?
I am convinced I doing something fundamentally wrong with the processing or windowing and odd looking output is not inherently due to the data itself. Any assistance in how to correctly attain a PSD for this data and what is the most valid approach for nonstationary data of this nature would be greatly appreciated. I am hoping those with seasoned experience with signaling can assist me with two questions. The ultimate goal is to obtain a power spectral density of very nonstationay optical data sampled at 1 kHz (attached). There is a huge DC offset that persists even after detrending or subtracting the mean. For such nonstationary data, pwelch seems most appropriate but a rather odd looking series of deminishing regularly space peaks is outputted across the frequency domain. Is the windowing wrong? Is this the wrong analysis to do?
First, here is the pwelch based code I ran:
x = time_series – mean(time_series);
fs = 1000;
[pxx_smooth, f] = pwelch(x, hann(length(x)/2), [], fs);
figure;
plot(f, 10*log10(pxx_smooth), ‘LineWidth’, 1.5);
If you run the code on the attached time-series you get no distinct peaks and a huge off wtih a very narrow frequency domain. This makes no sense.
Second, despite supposedly not correct to do since this is non-stationary data, I ran an FFT:
fs = 1000;
%x = detrend(time_series);
x = time_series-mean(time_series);
figure;
L = length(x);
plot(fs/L*(-L/2:L/2-1),abs(fftshift(x)),"LineWidth",2)
With an FFT you get more defined peaks and over a much larger frequency range (see attached jpg), but confused why the asymmetry when using ffshift, where it should be symmetrical about x = 0. Why the asymmetry?
I am convinced I doing something fundamentally wrong with the processing or windowing and odd looking output is not inherently due to the data itself. Any assistance in how to correctly attain a PSD for this data and what is the most valid approach for nonstationary data of this nature would be greatly appreciated. psd MATLAB Answers — New Questions
Odd and even numbers
Hi I’m new in matlab so i need a little help to get started. How do i make a program which can distinguish from odd and even numbers? I know that i need to make a loop, it should be either if or while but i would love some suggestions on how to solve this problem. Thanks :)Hi I’m new in matlab so i need a little help to get started. How do i make a program which can distinguish from odd and even numbers? I know that i need to make a loop, it should be either if or while but i would love some suggestions on how to solve this problem. Thanks 🙂 Hi I’m new in matlab so i need a little help to get started. How do i make a program which can distinguish from odd and even numbers? I know that i need to make a loop, it should be either if or while but i would love some suggestions on how to solve this problem. Thanks 🙂 MATLAB Answers — New Questions
different in Poisson distribution test
I have a problem when i take a test of poisson distribution. I have the data: 0, 1, 2, 0, 3, 2, 1, 2, 1, 0, 1, 2, 3, 2, 1, 1, 0, 1, 2, 3, 1, 0, 1, 1, 2, 1, 2, 1, 0, 1, 2, 1, 3, 2, 0, 1, 1, 2, 1, 1. I test is wonder the data have Poisson distribution. I use 3 ways:
>> dl=[0, 1, 2, 0, 3, 2, 1, 2, 1, 0, 1, 2, 3, 2, 1, 1, 0, 1, 2, 3, 1, 0, 1, 1, 2, 1, 2, 1, 0, 1, 2, 1, 3, 2, 0, 1, 1, 2, 1, 1];
>> x=unique(dl);
>> ts=histcounts(dl);
>> [h,p]=chi2gof(dl,’CDF’,makedist(‘Poisson’,mean(dl)))
the results are: h = 0 p = 0.9810
2. >> n=length(dl);
>> tslt=n*pdf(makedist(‘Poisson’,mean(dl)),x);
>> [h,p]=chi2gof(x,’Ctrs’, x, ‘Frequency’, ts, ‘Expected’,tslt, ‘NParams’, 1)
the results are: h = 0 p = 0.1019
3. >> [h,p]=kstest(dl’,’CDF’, makedist(‘Poisson’,mean(dl)))
h =1 p = 7.8989e-08
3 ways return 3 different results. Please help me explain why it isI have a problem when i take a test of poisson distribution. I have the data: 0, 1, 2, 0, 3, 2, 1, 2, 1, 0, 1, 2, 3, 2, 1, 1, 0, 1, 2, 3, 1, 0, 1, 1, 2, 1, 2, 1, 0, 1, 2, 1, 3, 2, 0, 1, 1, 2, 1, 1. I test is wonder the data have Poisson distribution. I use 3 ways:
>> dl=[0, 1, 2, 0, 3, 2, 1, 2, 1, 0, 1, 2, 3, 2, 1, 1, 0, 1, 2, 3, 1, 0, 1, 1, 2, 1, 2, 1, 0, 1, 2, 1, 3, 2, 0, 1, 1, 2, 1, 1];
>> x=unique(dl);
>> ts=histcounts(dl);
>> [h,p]=chi2gof(dl,’CDF’,makedist(‘Poisson’,mean(dl)))
the results are: h = 0 p = 0.9810
2. >> n=length(dl);
>> tslt=n*pdf(makedist(‘Poisson’,mean(dl)),x);
>> [h,p]=chi2gof(x,’Ctrs’, x, ‘Frequency’, ts, ‘Expected’,tslt, ‘NParams’, 1)
the results are: h = 0 p = 0.1019
3. >> [h,p]=kstest(dl’,’CDF’, makedist(‘Poisson’,mean(dl)))
h =1 p = 7.8989e-08
3 ways return 3 different results. Please help me explain why it is I have a problem when i take a test of poisson distribution. I have the data: 0, 1, 2, 0, 3, 2, 1, 2, 1, 0, 1, 2, 3, 2, 1, 1, 0, 1, 2, 3, 1, 0, 1, 1, 2, 1, 2, 1, 0, 1, 2, 1, 3, 2, 0, 1, 1, 2, 1, 1. I test is wonder the data have Poisson distribution. I use 3 ways:
>> dl=[0, 1, 2, 0, 3, 2, 1, 2, 1, 0, 1, 2, 3, 2, 1, 1, 0, 1, 2, 3, 1, 0, 1, 1, 2, 1, 2, 1, 0, 1, 2, 1, 3, 2, 0, 1, 1, 2, 1, 1];
>> x=unique(dl);
>> ts=histcounts(dl);
>> [h,p]=chi2gof(dl,’CDF’,makedist(‘Poisson’,mean(dl)))
the results are: h = 0 p = 0.9810
2. >> n=length(dl);
>> tslt=n*pdf(makedist(‘Poisson’,mean(dl)),x);
>> [h,p]=chi2gof(x,’Ctrs’, x, ‘Frequency’, ts, ‘Expected’,tslt, ‘NParams’, 1)
the results are: h = 0 p = 0.1019
3. >> [h,p]=kstest(dl’,’CDF’, makedist(‘Poisson’,mean(dl)))
h =1 p = 7.8989e-08
3 ways return 3 different results. Please help me explain why it is poisson distribution, chi2gof, kstest MATLAB Answers — New Questions
PWM on PE5 / PE6 causes XCP error on NUCLEO-H753ZI in Simulink (STM32 support package)
Hi everyone,
I am migrating a Simulink model from NUCLEO-F767ZI to NUCLEO-H753ZI using the Simulink Support Package for STM32.
Most peripherals work correctly on the H753ZI:
>I2C
>UDP / Ethernet
>PWM on other pins
However, I am facing an issue specifically with PWM outputs on pins PE_5 and PE_6.
>>Setup details:
Board: NUCLEO-H753ZI
MCU: STM32H753 (single-core Cortex-M7)
Toolchain: Simulink + STM32 support package
PWM pins: PE_5 and PE_6
These pins are mapped to TIM15
PWM configured as PWM Generation CH1 (not CH1N)
>>Observed behavior:
When PWM blocks for PE_5 and PE_6 are disabled, the model builds, downloads, and runs normally.
When PWM on PE_5 and/or PE_6 is enabled, the model fails to run:
An XCP error is reported immediately
The application does not start execution on the target
PWM on other pins works correctly.
The same Simulink model worked without issues on the F767ZI.
This appears to be specific to STM32H7 .
Any insights or recommendations would be greatly appreciated.
Thanks in advance!Hi everyone,
I am migrating a Simulink model from NUCLEO-F767ZI to NUCLEO-H753ZI using the Simulink Support Package for STM32.
Most peripherals work correctly on the H753ZI:
>I2C
>UDP / Ethernet
>PWM on other pins
However, I am facing an issue specifically with PWM outputs on pins PE_5 and PE_6.
>>Setup details:
Board: NUCLEO-H753ZI
MCU: STM32H753 (single-core Cortex-M7)
Toolchain: Simulink + STM32 support package
PWM pins: PE_5 and PE_6
These pins are mapped to TIM15
PWM configured as PWM Generation CH1 (not CH1N)
>>Observed behavior:
When PWM blocks for PE_5 and PE_6 are disabled, the model builds, downloads, and runs normally.
When PWM on PE_5 and/or PE_6 is enabled, the model fails to run:
An XCP error is reported immediately
The application does not start execution on the target
PWM on other pins works correctly.
The same Simulink model worked without issues on the F767ZI.
This appears to be specific to STM32H7 .
Any insights or recommendations would be greatly appreciated.
Thanks in advance! Hi everyone,
I am migrating a Simulink model from NUCLEO-F767ZI to NUCLEO-H753ZI using the Simulink Support Package for STM32.
Most peripherals work correctly on the H753ZI:
>I2C
>UDP / Ethernet
>PWM on other pins
However, I am facing an issue specifically with PWM outputs on pins PE_5 and PE_6.
>>Setup details:
Board: NUCLEO-H753ZI
MCU: STM32H753 (single-core Cortex-M7)
Toolchain: Simulink + STM32 support package
PWM pins: PE_5 and PE_6
These pins are mapped to TIM15
PWM configured as PWM Generation CH1 (not CH1N)
>>Observed behavior:
When PWM blocks for PE_5 and PE_6 are disabled, the model builds, downloads, and runs normally.
When PWM on PE_5 and/or PE_6 is enabled, the model fails to run:
An XCP error is reported immediately
The application does not start execution on the target
PWM on other pins works correctly.
The same Simulink model worked without issues on the F767ZI.
This appears to be specific to STM32H7 .
Any insights or recommendations would be greatly appreciated.
Thanks in advance! stm32h7, simulink MATLAB Answers — New Questions
How do I choose the poles and zeros in order to calculate my TF from input & output data?
Hello :), I have a set of data exported from my simulator, which consists of Thrust getting in the system (T_in) and some Thrust output after some conversions (T_out) for two different types of propellers, HTU and DEP. I use iddata to package the output, input and sample data.
Then with that data I use tfest to estimate the continuous-time transfer function sys.
My problem is that I don’t know how to define the number of poles (np) and zeros (nz). Any suggestions?
Thanks in advance!
% Bode Diagram analysis
T_in_HTU = load("T_in_HTU.mat");
T_in_DEP = load("T_in_DEP.mat");
T_out_HTU = load("T_out_HTU.mat");
T_out_DEP = load("T_out_DEP.mat");
T_in_HTU = T_in_HTU.T_in_HTU;
T_in_DEP = T_in_DEP.T_in_DEP;
T_out_HTU = T_out_HTU.T_out_HTU;
T_out_DEP = T_out_DEP.T_out_DEP;
data_HTU = iddata(T_in_HTU,T_out_HTU,1/500);
data_DEP = iddata(T_in_DEP,T_out_DEP,1/500);
sys_HTU = tfest(data_HTU,np,nz,’Ts’,1/500);
sys_DEP = tfest(data_DEP,np,nz,’Ts’,1/500);
% Generate Bode plots for the identified transfer functions
figure;
bode(sys_HTU);
grid on;
title(‘Bode Diagram for HTU System’);
figure;
bode(sys_DEP);
grid on;
title(‘Bode Diagram for DEP System’);
figure;
bode(sys_HTU,sys_DEP);
grid on;
title(‘Bode Diagram for DEP System’);Hello :), I have a set of data exported from my simulator, which consists of Thrust getting in the system (T_in) and some Thrust output after some conversions (T_out) for two different types of propellers, HTU and DEP. I use iddata to package the output, input and sample data.
Then with that data I use tfest to estimate the continuous-time transfer function sys.
My problem is that I don’t know how to define the number of poles (np) and zeros (nz). Any suggestions?
Thanks in advance!
% Bode Diagram analysis
T_in_HTU = load("T_in_HTU.mat");
T_in_DEP = load("T_in_DEP.mat");
T_out_HTU = load("T_out_HTU.mat");
T_out_DEP = load("T_out_DEP.mat");
T_in_HTU = T_in_HTU.T_in_HTU;
T_in_DEP = T_in_DEP.T_in_DEP;
T_out_HTU = T_out_HTU.T_out_HTU;
T_out_DEP = T_out_DEP.T_out_DEP;
data_HTU = iddata(T_in_HTU,T_out_HTU,1/500);
data_DEP = iddata(T_in_DEP,T_out_DEP,1/500);
sys_HTU = tfest(data_HTU,np,nz,’Ts’,1/500);
sys_DEP = tfest(data_DEP,np,nz,’Ts’,1/500);
% Generate Bode plots for the identified transfer functions
figure;
bode(sys_HTU);
grid on;
title(‘Bode Diagram for HTU System’);
figure;
bode(sys_DEP);
grid on;
title(‘Bode Diagram for DEP System’);
figure;
bode(sys_HTU,sys_DEP);
grid on;
title(‘Bode Diagram for DEP System’); Hello :), I have a set of data exported from my simulator, which consists of Thrust getting in the system (T_in) and some Thrust output after some conversions (T_out) for two different types of propellers, HTU and DEP. I use iddata to package the output, input and sample data.
Then with that data I use tfest to estimate the continuous-time transfer function sys.
My problem is that I don’t know how to define the number of poles (np) and zeros (nz). Any suggestions?
Thanks in advance!
% Bode Diagram analysis
T_in_HTU = load("T_in_HTU.mat");
T_in_DEP = load("T_in_DEP.mat");
T_out_HTU = load("T_out_HTU.mat");
T_out_DEP = load("T_out_DEP.mat");
T_in_HTU = T_in_HTU.T_in_HTU;
T_in_DEP = T_in_DEP.T_in_DEP;
T_out_HTU = T_out_HTU.T_out_HTU;
T_out_DEP = T_out_DEP.T_out_DEP;
data_HTU = iddata(T_in_HTU,T_out_HTU,1/500);
data_DEP = iddata(T_in_DEP,T_out_DEP,1/500);
sys_HTU = tfest(data_HTU,np,nz,’Ts’,1/500);
sys_DEP = tfest(data_DEP,np,nz,’Ts’,1/500);
% Generate Bode plots for the identified transfer functions
figure;
bode(sys_HTU);
grid on;
title(‘Bode Diagram for HTU System’);
figure;
bode(sys_DEP);
grid on;
title(‘Bode Diagram for DEP System’);
figure;
bode(sys_HTU,sys_DEP);
grid on;
title(‘Bode Diagram for DEP System’); tfest, transfer function, zeros and poles MATLAB Answers — New Questions
The uploaded file was not imported because it is missing timestamps.
Have uploaded previously with same file format without any problems – most recent upload (2 Feb 26) fails with message
The uploaded file was not imported because it is missing timestamps.
It seems to conform to the template, first few lines attached (which fail to load) but I have 5 months data to upload in same format. Have tried with all field names and ,,,,,,,, appended, but same result
created_at,field1,field2,field3,field4
2025-09-01T23:55:37+00:00,6.365,-5.895,0,304.96
2025-09-02T23:55:38+00:00,6.355,-5.898,11.51,316.47
2025-09-03T23:55:41+00:00,6.34,-5.903,6.81,323.28Have uploaded previously with same file format without any problems – most recent upload (2 Feb 26) fails with message
The uploaded file was not imported because it is missing timestamps.
It seems to conform to the template, first few lines attached (which fail to load) but I have 5 months data to upload in same format. Have tried with all field names and ,,,,,,,, appended, but same result
created_at,field1,field2,field3,field4
2025-09-01T23:55:37+00:00,6.365,-5.895,0,304.96
2025-09-02T23:55:38+00:00,6.355,-5.898,11.51,316.47
2025-09-03T23:55:41+00:00,6.34,-5.903,6.81,323.28 Have uploaded previously with same file format without any problems – most recent upload (2 Feb 26) fails with message
The uploaded file was not imported because it is missing timestamps.
It seems to conform to the template, first few lines attached (which fail to load) but I have 5 months data to upload in same format. Have tried with all field names and ,,,,,,,, appended, but same result
created_at,field1,field2,field3,field4
2025-09-01T23:55:37+00:00,6.365,-5.895,0,304.96
2025-09-02T23:55:38+00:00,6.355,-5.898,11.51,316.47
2025-09-03T23:55:41+00:00,6.34,-5.903,6.81,323.28 upload, timestamp MATLAB Answers — New Questions
How to install symbolic toolbox if I have a student version of matlab
Hi! I have a student version of Matlab, and I need to use symbolic toolbox, but I don’t know how to go about installing it. I know that it was included, but I am not sure how to get to it. Very basic step by step instructions would be appreciated.Hi! I have a student version of Matlab, and I need to use symbolic toolbox, but I don’t know how to go about installing it. I know that it was included, but I am not sure how to get to it. Very basic step by step instructions would be appreciated. Hi! I have a student version of Matlab, and I need to use symbolic toolbox, but I don’t know how to go about installing it. I know that it was included, but I am not sure how to get to it. Very basic step by step instructions would be appreciated. symbolic, toolbox, installation, download MATLAB Answers — New Questions
how to represent schottky diode in matlab simulink
I am trying to simulate a maximum power point tracking algorithm where i integrate it with a boost converter. the schematic i will be implementing involves a schottky diode, which does not exist as a simulink block. the only online resource for a schottky diode is actually a zener diode, which it looks like someone made by adjusting the masking of the diode block to connect to an actual part. what is the simplest way for me to create a schottky diode block? the resource with zener diode that I am talking about: https://www.mathworks.com/help/sps/ug/schottky-barrier-diode-characteristics.htmlI am trying to simulate a maximum power point tracking algorithm where i integrate it with a boost converter. the schematic i will be implementing involves a schottky diode, which does not exist as a simulink block. the only online resource for a schottky diode is actually a zener diode, which it looks like someone made by adjusting the masking of the diode block to connect to an actual part. what is the simplest way for me to create a schottky diode block? the resource with zener diode that I am talking about: https://www.mathworks.com/help/sps/ug/schottky-barrier-diode-characteristics.html I am trying to simulate a maximum power point tracking algorithm where i integrate it with a boost converter. the schematic i will be implementing involves a schottky diode, which does not exist as a simulink block. the only online resource for a schottky diode is actually a zener diode, which it looks like someone made by adjusting the masking of the diode block to connect to an actual part. what is the simplest way for me to create a schottky diode block? the resource with zener diode that I am talking about: https://www.mathworks.com/help/sps/ug/schottky-barrier-diode-characteristics.html energy harvesting, simulink MATLAB Answers — New Questions
What qualifies as research to have to get the commercial license?
I would like to use Matlab for modeling (not to gather data but simply organize it). Does that mean I have to change my home license to a commercial one? I’m not affiliated with a university yet. Not sure if that qualifies as research if it only aids it.I would like to use Matlab for modeling (not to gather data but simply organize it). Does that mean I have to change my home license to a commercial one? I’m not affiliated with a university yet. Not sure if that qualifies as research if it only aids it. I would like to use Matlab for modeling (not to gather data but simply organize it). Does that mean I have to change my home license to a commercial one? I’m not affiliated with a university yet. Not sure if that qualifies as research if it only aids it. research MATLAB Answers — New Questions









