Category: Matlab
Category Archives: Matlab
I am new to use MATLAB ZOS-API and struggling to execute this file.
I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don’t know why this is happening.
Here is my code and error,
function [ r ] = MATLABStandalone_NSC_ray_trace( args )
if ~exist(‘args’, ‘var’)
args = [];
end
% Initialize the OpticStudio connection
TheApplication = InitConnection();
if isempty(TheApplication)
% failed to initialize a connection
r = [];
else
try
r = BeginApplication(TheApplication, args);
CleanupConnection(TheApplication);
catch err
CleanupConnection(TheApplication);
rethrow(err);
end
end
end
function [r] = BeginApplication(TheApplication, args)
import ZOSAPI.*;
% creates a new API directory
apiPath = System.String.Concat(TheApplication.SamplesDir, ‘APIMatlab’);
if (exist(char(apiPath)) == 0) mkdir(char(apiPath)); end;
% Set up primary optical system
TheSystem = TheApplication.PrimarySystem;
sampleDir = TheApplication.SamplesDir;
%! [e02s01_m]
% Open file
testFile = System.String.Concat(sampleDir, ‘"D:PracticeZemax PracticeBeam_expander-NONSEQ.zos"’);
TheSystem.LoadFile(testFile, false);
%! [e02s01_m]
%! [e02s02_m]
% Create ray trace
NSCRayTrace = TheSystem.Tools.OpenNSCRayTrace();
NSCRayTrace.SplitNSCRays = false;
NSCRayTrace.ScatterNSCRays = false;
NSCRayTrace.UsePolarization = false;
NSCRayTrace.IgnoreErrors = true;
NSCRayTrace.SaveRays = false;
%NSCRayTrace.ClearDetectors(0);
% Run ray trace
NSCRayTrace.RunAndWaitForCompletion();
NSCRayTrace.Close();
%! [e02s02_m]
% Non-sequential component editor
TheNCE = TheSystem.NCE;
%! [e02s03_m]
% Get detector data
data = NET.createArray(‘System.Double’, TheNCE.GetDetectorSize(6));
TheNCE.GetAllDetectorData(6, 1, TheNCE.GetDetectorSize(6), data);
[~, rows, cols] = TheNCE.GetDetectorDimensions(6);
% rotates and flips image to reflect ZOS orientation
detectorData = flipud(rot90(reshape(data.double, rows, cols)));
%! [e02s03_m]
% Plot
close all;
figure(‘position’, [50, 150, 700, 600])
surf(detectorData);
axis([1 100 1 100]);
shading flat;
xlabel(‘Column #’);
ylabel(‘Row #’);
title(‘Incoherent Illuminance [lm/cm^2]’);
colorbar;
r = [];
end
function app = InitConnection()
import System.Reflection.*;
% Find the installed version of OpticStudio.
zemaxData = winqueryreg(‘HKEY_CURRENT_USER’, ‘SoftwareZemax’, ‘ZemaxRoot’);
NetHelper = strcat(zemaxData, ‘ZOS-APILibrariesZOSAPI_NetHelper.dll’);
% Note — uncomment the following line to use a custom NetHelper path
% NetHelper = ‘C:UsersDocumentsZemaxZOS-APILibrariesZOSAPI_NetHelper.dll’;
NET.addAssembly(NetHelper);
success = ZOSAPI_NetHelper.ZOSAPI_Initializer.Initialize();
% Note — uncomment the following line to use a custom initialization path
% success = ZOSAPI_NetHelper.ZOSAPI_Initializer.Initialize(‘C:Program FilesOpticStudio’);
if success == 1
LogMessage(strcat(‘Found OpticStudio at: ‘, char(ZOSAPI_NetHelper.ZOSAPI_Initializer.GetZemaxDirectory())));
else
app = [];
return;
end
% Now load the ZOS-API assemblies
NET.addAssembly(AssemblyName(‘ZOSAPI_Interfaces’));
NET.addAssembly(AssemblyName(‘ZOSAPI’));
% Create the initial connection class
TheConnection = ZOSAPI.ZOSAPI_Connection();
% Attempt to create a Standalone connection
% NOTE – if this fails with a message like ‘Unable to load one or more of
% the requested types’, it is usually caused by try to connect to a 32-bit
% version of OpticStudio from a 64-bit version of MATLAB (or vice-versa).
% This is an issue with how MATLAB interfaces with .NET, and the only
% current workaround is to use 32- or 64-bit versions of both applications.
app = TheConnection.CreateNewApplication();
if isempty(app)
HandleError(‘An unknown connection error occurred!’);
end
if ~app.IsValidLicenseForAPI
HandleError(‘License check failed!’);
app = [];
end
end
function LogMessage(msg)
disp(msg);
end
function HandleError(error)
ME = MXException(error);
throw(ME);
end
function CleanupConnection(TheApplication)
% Note – this will close down the connection.
% If you want to keep the application open, you should skip this step
% and store the instance somewhere instead.
TheApplication.CloseApplication();
end
This is the error I am getting,
Beam_expander_NSC_raytrace
Found OpticStudio at:c:program filesansys zemax opticstudio 2023 r2.00
Unrecognized field name "RunAndWaitForCompletion".
Error in Beam_expander_NSC_raytrace>BeginApplication (line 55)
NSCRayTrace.RunAndWaitForCompletion();
Error in Beam_expander_NSC_raytrace (line 16)
r = BeginApplication(TheApplication, args);
I know lot of people doesn’t have access to Zemax (If you have zemax I am attaching the .zos file), and any help in any regards is much appreciated.
Thank you and regards,
NavaneethI am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don’t know why this is happening.
Here is my code and error,
function [ r ] = MATLABStandalone_NSC_ray_trace( args )
if ~exist(‘args’, ‘var’)
args = [];
end
% Initialize the OpticStudio connection
TheApplication = InitConnection();
if isempty(TheApplication)
% failed to initialize a connection
r = [];
else
try
r = BeginApplication(TheApplication, args);
CleanupConnection(TheApplication);
catch err
CleanupConnection(TheApplication);
rethrow(err);
end
end
end
function [r] = BeginApplication(TheApplication, args)
import ZOSAPI.*;
% creates a new API directory
apiPath = System.String.Concat(TheApplication.SamplesDir, ‘APIMatlab’);
if (exist(char(apiPath)) == 0) mkdir(char(apiPath)); end;
% Set up primary optical system
TheSystem = TheApplication.PrimarySystem;
sampleDir = TheApplication.SamplesDir;
%! [e02s01_m]
% Open file
testFile = System.String.Concat(sampleDir, ‘"D:PracticeZemax PracticeBeam_expander-NONSEQ.zos"’);
TheSystem.LoadFile(testFile, false);
%! [e02s01_m]
%! [e02s02_m]
% Create ray trace
NSCRayTrace = TheSystem.Tools.OpenNSCRayTrace();
NSCRayTrace.SplitNSCRays = false;
NSCRayTrace.ScatterNSCRays = false;
NSCRayTrace.UsePolarization = false;
NSCRayTrace.IgnoreErrors = true;
NSCRayTrace.SaveRays = false;
%NSCRayTrace.ClearDetectors(0);
% Run ray trace
NSCRayTrace.RunAndWaitForCompletion();
NSCRayTrace.Close();
%! [e02s02_m]
% Non-sequential component editor
TheNCE = TheSystem.NCE;
%! [e02s03_m]
% Get detector data
data = NET.createArray(‘System.Double’, TheNCE.GetDetectorSize(6));
TheNCE.GetAllDetectorData(6, 1, TheNCE.GetDetectorSize(6), data);
[~, rows, cols] = TheNCE.GetDetectorDimensions(6);
% rotates and flips image to reflect ZOS orientation
detectorData = flipud(rot90(reshape(data.double, rows, cols)));
%! [e02s03_m]
% Plot
close all;
figure(‘position’, [50, 150, 700, 600])
surf(detectorData);
axis([1 100 1 100]);
shading flat;
xlabel(‘Column #’);
ylabel(‘Row #’);
title(‘Incoherent Illuminance [lm/cm^2]’);
colorbar;
r = [];
end
function app = InitConnection()
import System.Reflection.*;
% Find the installed version of OpticStudio.
zemaxData = winqueryreg(‘HKEY_CURRENT_USER’, ‘SoftwareZemax’, ‘ZemaxRoot’);
NetHelper = strcat(zemaxData, ‘ZOS-APILibrariesZOSAPI_NetHelper.dll’);
% Note — uncomment the following line to use a custom NetHelper path
% NetHelper = ‘C:UsersDocumentsZemaxZOS-APILibrariesZOSAPI_NetHelper.dll’;
NET.addAssembly(NetHelper);
success = ZOSAPI_NetHelper.ZOSAPI_Initializer.Initialize();
% Note — uncomment the following line to use a custom initialization path
% success = ZOSAPI_NetHelper.ZOSAPI_Initializer.Initialize(‘C:Program FilesOpticStudio’);
if success == 1
LogMessage(strcat(‘Found OpticStudio at: ‘, char(ZOSAPI_NetHelper.ZOSAPI_Initializer.GetZemaxDirectory())));
else
app = [];
return;
end
% Now load the ZOS-API assemblies
NET.addAssembly(AssemblyName(‘ZOSAPI_Interfaces’));
NET.addAssembly(AssemblyName(‘ZOSAPI’));
% Create the initial connection class
TheConnection = ZOSAPI.ZOSAPI_Connection();
% Attempt to create a Standalone connection
% NOTE – if this fails with a message like ‘Unable to load one or more of
% the requested types’, it is usually caused by try to connect to a 32-bit
% version of OpticStudio from a 64-bit version of MATLAB (or vice-versa).
% This is an issue with how MATLAB interfaces with .NET, and the only
% current workaround is to use 32- or 64-bit versions of both applications.
app = TheConnection.CreateNewApplication();
if isempty(app)
HandleError(‘An unknown connection error occurred!’);
end
if ~app.IsValidLicenseForAPI
HandleError(‘License check failed!’);
app = [];
end
end
function LogMessage(msg)
disp(msg);
end
function HandleError(error)
ME = MXException(error);
throw(ME);
end
function CleanupConnection(TheApplication)
% Note – this will close down the connection.
% If you want to keep the application open, you should skip this step
% and store the instance somewhere instead.
TheApplication.CloseApplication();
end
This is the error I am getting,
Beam_expander_NSC_raytrace
Found OpticStudio at:c:program filesansys zemax opticstudio 2023 r2.00
Unrecognized field name "RunAndWaitForCompletion".
Error in Beam_expander_NSC_raytrace>BeginApplication (line 55)
NSCRayTrace.RunAndWaitForCompletion();
Error in Beam_expander_NSC_raytrace (line 16)
r = BeginApplication(TheApplication, args);
I know lot of people doesn’t have access to Zemax (If you have zemax I am attaching the .zos file), and any help in any regards is much appreciated.
Thank you and regards,
Navaneeth I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don’t know why this is happening.
Here is my code and error,
function [ r ] = MATLABStandalone_NSC_ray_trace( args )
if ~exist(‘args’, ‘var’)
args = [];
end
% Initialize the OpticStudio connection
TheApplication = InitConnection();
if isempty(TheApplication)
% failed to initialize a connection
r = [];
else
try
r = BeginApplication(TheApplication, args);
CleanupConnection(TheApplication);
catch err
CleanupConnection(TheApplication);
rethrow(err);
end
end
end
function [r] = BeginApplication(TheApplication, args)
import ZOSAPI.*;
% creates a new API directory
apiPath = System.String.Concat(TheApplication.SamplesDir, ‘APIMatlab’);
if (exist(char(apiPath)) == 0) mkdir(char(apiPath)); end;
% Set up primary optical system
TheSystem = TheApplication.PrimarySystem;
sampleDir = TheApplication.SamplesDir;
%! [e02s01_m]
% Open file
testFile = System.String.Concat(sampleDir, ‘"D:PracticeZemax PracticeBeam_expander-NONSEQ.zos"’);
TheSystem.LoadFile(testFile, false);
%! [e02s01_m]
%! [e02s02_m]
% Create ray trace
NSCRayTrace = TheSystem.Tools.OpenNSCRayTrace();
NSCRayTrace.SplitNSCRays = false;
NSCRayTrace.ScatterNSCRays = false;
NSCRayTrace.UsePolarization = false;
NSCRayTrace.IgnoreErrors = true;
NSCRayTrace.SaveRays = false;
%NSCRayTrace.ClearDetectors(0);
% Run ray trace
NSCRayTrace.RunAndWaitForCompletion();
NSCRayTrace.Close();
%! [e02s02_m]
% Non-sequential component editor
TheNCE = TheSystem.NCE;
%! [e02s03_m]
% Get detector data
data = NET.createArray(‘System.Double’, TheNCE.GetDetectorSize(6));
TheNCE.GetAllDetectorData(6, 1, TheNCE.GetDetectorSize(6), data);
[~, rows, cols] = TheNCE.GetDetectorDimensions(6);
% rotates and flips image to reflect ZOS orientation
detectorData = flipud(rot90(reshape(data.double, rows, cols)));
%! [e02s03_m]
% Plot
close all;
figure(‘position’, [50, 150, 700, 600])
surf(detectorData);
axis([1 100 1 100]);
shading flat;
xlabel(‘Column #’);
ylabel(‘Row #’);
title(‘Incoherent Illuminance [lm/cm^2]’);
colorbar;
r = [];
end
function app = InitConnection()
import System.Reflection.*;
% Find the installed version of OpticStudio.
zemaxData = winqueryreg(‘HKEY_CURRENT_USER’, ‘SoftwareZemax’, ‘ZemaxRoot’);
NetHelper = strcat(zemaxData, ‘ZOS-APILibrariesZOSAPI_NetHelper.dll’);
% Note — uncomment the following line to use a custom NetHelper path
% NetHelper = ‘C:UsersDocumentsZemaxZOS-APILibrariesZOSAPI_NetHelper.dll’;
NET.addAssembly(NetHelper);
success = ZOSAPI_NetHelper.ZOSAPI_Initializer.Initialize();
% Note — uncomment the following line to use a custom initialization path
% success = ZOSAPI_NetHelper.ZOSAPI_Initializer.Initialize(‘C:Program FilesOpticStudio’);
if success == 1
LogMessage(strcat(‘Found OpticStudio at: ‘, char(ZOSAPI_NetHelper.ZOSAPI_Initializer.GetZemaxDirectory())));
else
app = [];
return;
end
% Now load the ZOS-API assemblies
NET.addAssembly(AssemblyName(‘ZOSAPI_Interfaces’));
NET.addAssembly(AssemblyName(‘ZOSAPI’));
% Create the initial connection class
TheConnection = ZOSAPI.ZOSAPI_Connection();
% Attempt to create a Standalone connection
% NOTE – if this fails with a message like ‘Unable to load one or more of
% the requested types’, it is usually caused by try to connect to a 32-bit
% version of OpticStudio from a 64-bit version of MATLAB (or vice-versa).
% This is an issue with how MATLAB interfaces with .NET, and the only
% current workaround is to use 32- or 64-bit versions of both applications.
app = TheConnection.CreateNewApplication();
if isempty(app)
HandleError(‘An unknown connection error occurred!’);
end
if ~app.IsValidLicenseForAPI
HandleError(‘License check failed!’);
app = [];
end
end
function LogMessage(msg)
disp(msg);
end
function HandleError(error)
ME = MXException(error);
throw(ME);
end
function CleanupConnection(TheApplication)
% Note – this will close down the connection.
% If you want to keep the application open, you should skip this step
% and store the instance somewhere instead.
TheApplication.CloseApplication();
end
This is the error I am getting,
Beam_expander_NSC_raytrace
Found OpticStudio at:c:program filesansys zemax opticstudio 2023 r2.00
Unrecognized field name "RunAndWaitForCompletion".
Error in Beam_expander_NSC_raytrace>BeginApplication (line 55)
NSCRayTrace.RunAndWaitForCompletion();
Error in Beam_expander_NSC_raytrace (line 16)
r = BeginApplication(TheApplication, args);
I know lot of people doesn’t have access to Zemax (If you have zemax I am attaching the .zos file), and any help in any regards is much appreciated.
Thank you and regards,
Navaneeth api, matlab, raytrace, zos-api MATLAB Answers — New Questions
How to code for PS5 in matlab ? is there any library present .
I want use libraries like arduino . is libraries are prsent like (arduino) ps5.bt, wire.h,servo.h in matlab.I want use libraries like arduino . is libraries are prsent like (arduino) ps5.bt, wire.h,servo.h in matlab. I want use libraries like arduino . is libraries are prsent like (arduino) ps5.bt, wire.h,servo.h in matlab. arduino, programming, library MATLAB Answers — New Questions
State machine for grid connection – TIDM-SOLARUINV
Hi,
I hope everything is going well. I have a question regarding using MATLAB to write code for the C2000 controller – F28035. I am currently implementing the TI Microinverter (TIDM-SOLARUINV) controlled by the F28035 using MATLAB. I have tested the input side MPPT and the output side inverter and grid integration.
However, I am uncertain about how to integrate both the PV and inverter together for grid integration. TI has used a state machine for grid connection as described on page 45 of the documentation (https://www.ti.com/lit/ug/tidu405b/tidu405b.pdf?ts=1716863482444&ref_url=https%253A%252F%252Fwww.ti.com%252Ftool%252FTIDM-SOLARUINV). Could you please provide some guidance or an example file on how to implement this in MATLAB? Your assistance would be greatly appreciated.
Thank you.Hi,
I hope everything is going well. I have a question regarding using MATLAB to write code for the C2000 controller – F28035. I am currently implementing the TI Microinverter (TIDM-SOLARUINV) controlled by the F28035 using MATLAB. I have tested the input side MPPT and the output side inverter and grid integration.
However, I am uncertain about how to integrate both the PV and inverter together for grid integration. TI has used a state machine for grid connection as described on page 45 of the documentation (https://www.ti.com/lit/ug/tidu405b/tidu405b.pdf?ts=1716863482444&ref_url=https%253A%252F%252Fwww.ti.com%252Ftool%252FTIDM-SOLARUINV). Could you please provide some guidance or an example file on how to implement this in MATLAB? Your assistance would be greatly appreciated.
Thank you. Hi,
I hope everything is going well. I have a question regarding using MATLAB to write code for the C2000 controller – F28035. I am currently implementing the TI Microinverter (TIDM-SOLARUINV) controlled by the F28035 using MATLAB. I have tested the input side MPPT and the output side inverter and grid integration.
However, I am uncertain about how to integrate both the PV and inverter together for grid integration. TI has used a state machine for grid connection as described on page 45 of the documentation (https://www.ti.com/lit/ug/tidu405b/tidu405b.pdf?ts=1716863482444&ref_url=https%253A%252F%252Fwww.ti.com%252Ftool%252FTIDM-SOLARUINV). Could you please provide some guidance or an example file on how to implement this in MATLAB? Your assistance would be greatly appreciated.
Thank you. power_electronics_control, f28035, tidm-solaruinv, c2000, grid integration MATLAB Answers — New Questions
Why should we use only dyadic length signal in discrete wavelet transform?
Why should the signal length be dyadic while taking discrete wavelet transform? What happens if the signal length is not dyadic. I am working on compressing real time sensor signals containing 2000 samples in 20ms duration.Can some one help me with valuable answers. Many thanks in advance! my mail id is charanchakravarthy@gmail.comWhy should the signal length be dyadic while taking discrete wavelet transform? What happens if the signal length is not dyadic. I am working on compressing real time sensor signals containing 2000 samples in 20ms duration.Can some one help me with valuable answers. Many thanks in advance! my mail id is charanchakravarthy@gmail.com Why should the signal length be dyadic while taking discrete wavelet transform? What happens if the signal length is not dyadic. I am working on compressing real time sensor signals containing 2000 samples in 20ms duration.Can some one help me with valuable answers. Many thanks in advance! my mail id is charanchakravarthy@gmail.com signal processing, wavelet compression MATLAB Answers — New Questions
How do I display all the data, not just the last 30 minutes or so
I am collecting data every minute or so (for now while I debug my system). How can I display all the data instead of the last few minutes?
I know I can download all the data and plot it in Excel or LibreOffice but I would prefer to be able to see more of the data on the graph, like at least a day. I see examples like the chart of air pollution that has A LOT of data points, but I do not know how it’s done.
ThanksI am collecting data every minute or so (for now while I debug my system). How can I display all the data instead of the last few minutes?
I know I can download all the data and plot it in Excel or LibreOffice but I would prefer to be able to see more of the data on the graph, like at least a day. I see examples like the chart of air pollution that has A LOT of data points, but I do not know how it’s done.
Thanks I am collecting data every minute or so (for now while I debug my system). How can I display all the data instead of the last few minutes?
I know I can download all the data and plot it in Excel or LibreOffice but I would prefer to be able to see more of the data on the graph, like at least a day. I see examples like the chart of air pollution that has A LOT of data points, but I do not know how it’s done.
Thanks thingspeak MATLAB Answers — New Questions
can you tell me algorithem features extraction eeglab
i have features extraction in eeglabi have features extraction in eeglab i have features extraction in eeglab features extrction MATLAB Answers — New Questions
What type of test does matlab use to obtain corr pvalue?
According to the documentation, the correlation pvalues indicate "If pval(a,b) is small (less than 0.05), then the correlation rho(a,b) is significantly different from zero."
But it’s never specified which test was used to obtain the pvlaues.According to the documentation, the correlation pvalues indicate "If pval(a,b) is small (less than 0.05), then the correlation rho(a,b) is significantly different from zero."
But it’s never specified which test was used to obtain the pvlaues. According to the documentation, the correlation pvalues indicate "If pval(a,b) is small (less than 0.05), then the correlation rho(a,b) is significantly different from zero."
But it’s never specified which test was used to obtain the pvlaues. statistics, correlation, matlab code MATLAB Answers — New Questions
How to efficiently use dependent properties if dependence is computational costly?
Hello!
I want to design a class where some properties are dependent on others. I understand the general concept of Matlab OOP for dependent properties: the property is recalculated each time it is accessed.
But if these calculations/dependencies are costly and the dependent properties are often accessed by methods within the class, what are you suggesting to do. Basically, it would suffice to recalculated the property each time its parents properties are updated.
If I do so, I get a warning that accessing another property from the set method of an independent property is not recommended. What else can I do?
Cheers
MichaelHello!
I want to design a class where some properties are dependent on others. I understand the general concept of Matlab OOP for dependent properties: the property is recalculated each time it is accessed.
But if these calculations/dependencies are costly and the dependent properties are often accessed by methods within the class, what are you suggesting to do. Basically, it would suffice to recalculated the property each time its parents properties are updated.
If I do so, I get a warning that accessing another property from the set method of an independent property is not recommended. What else can I do?
Cheers
Michael Hello!
I want to design a class where some properties are dependent on others. I understand the general concept of Matlab OOP for dependent properties: the property is recalculated each time it is accessed.
But if these calculations/dependencies are costly and the dependent properties are often accessed by methods within the class, what are you suggesting to do. Basically, it would suffice to recalculated the property each time its parents properties are updated.
If I do so, I get a warning that accessing another property from the set method of an independent property is not recommended. What else can I do?
Cheers
Michael oop, dependent property MATLAB Answers — New Questions
How to use phase difference information to extract effective components of signal?
I now have two lines of data, both of which contain signal components and strong noise. The signal components have the same frequency, but the frequency is unknown. And in these two lines of data, the signal components have a 180 degree phase difference. Is there any way to separate the signal components from the noise based on these two lines of data?I now have two lines of data, both of which contain signal components and strong noise. The signal components have the same frequency, but the frequency is unknown. And in these two lines of data, the signal components have a 180 degree phase difference. Is there any way to separate the signal components from the noise based on these two lines of data? I now have two lines of data, both of which contain signal components and strong noise. The signal components have the same frequency, but the frequency is unknown. And in these two lines of data, the signal components have a 180 degree phase difference. Is there any way to separate the signal components from the noise based on these two lines of data? fft, matlab, signal processing, digital signal processing MATLAB Answers — New Questions
Problem with anfis CLUSTERING
Hello all,
I am trying to use genfis2 to create a FIS structure to be used by ANFIS. I am working with a set of data that is 3000×3. The first 2 columns are the inputs for genfis2 and last column is the output. Below is how I am using the genfis2 command,
in_fis = genfis2(Xin,Xout,radii)
from what I understand, radii is a vector that determines the range of a cluster and xbounds are the min/max (to normalize the data) values in each column of data correct? Why am I getting
"Warning: Rank deficient, rank = 0, tol = NaN.
> In genfis2 at 179"
Start training ANFIS …
1 -1.#IND
2 1.#QNAN
.
.
85 1.#QNAN
Designated epoch number reached –> ANFIS training completed
??? Error using ==> evalfismex
Illegal parameters in fisGaussianMF() –> sigma = 0
Error in ==> evalfis at 84
[output,IRR,ORR,ARR] = evalfismex(input, fis, numofpoints);
Is it my input thats messed, anyone have any sage advice? Thank you.Hello all,
I am trying to use genfis2 to create a FIS structure to be used by ANFIS. I am working with a set of data that is 3000×3. The first 2 columns are the inputs for genfis2 and last column is the output. Below is how I am using the genfis2 command,
in_fis = genfis2(Xin,Xout,radii)
from what I understand, radii is a vector that determines the range of a cluster and xbounds are the min/max (to normalize the data) values in each column of data correct? Why am I getting
"Warning: Rank deficient, rank = 0, tol = NaN.
> In genfis2 at 179"
Start training ANFIS …
1 -1.#IND
2 1.#QNAN
.
.
85 1.#QNAN
Designated epoch number reached –> ANFIS training completed
??? Error using ==> evalfismex
Illegal parameters in fisGaussianMF() –> sigma = 0
Error in ==> evalfis at 84
[output,IRR,ORR,ARR] = evalfismex(input, fis, numofpoints);
Is it my input thats messed, anyone have any sage advice? Thank you. Hello all,
I am trying to use genfis2 to create a FIS structure to be used by ANFIS. I am working with a set of data that is 3000×3. The first 2 columns are the inputs for genfis2 and last column is the output. Below is how I am using the genfis2 command,
in_fis = genfis2(Xin,Xout,radii)
from what I understand, radii is a vector that determines the range of a cluster and xbounds are the min/max (to normalize the data) values in each column of data correct? Why am I getting
"Warning: Rank deficient, rank = 0, tol = NaN.
> In genfis2 at 179"
Start training ANFIS …
1 -1.#IND
2 1.#QNAN
.
.
85 1.#QNAN
Designated epoch number reached –> ANFIS training completed
??? Error using ==> evalfismex
Illegal parameters in fisGaussianMF() –> sigma = 0
Error in ==> evalfis at 84
[output,IRR,ORR,ARR] = evalfismex(input, fis, numofpoints);
Is it my input thats messed, anyone have any sage advice? Thank you. genfis2 MATLAB Answers — New Questions
how to enhance a color image ?
For gray image, we use the commands like adapthisteq, imadjust… How to increase the intensity for the color image.For gray image, we use the commands like adapthisteq, imadjust… How to increase the intensity for the color image. For gray image, we use the commands like adapthisteq, imadjust… How to increase the intensity for the color image. color image enhancement MATLAB Answers — New Questions
Attention mechanism diagram For unet Deep Learning
Dear all,
Anyone know how to add the Attention mechanism diagram using deep network design Matlab?Dear all,
Anyone know how to add the Attention mechanism diagram using deep network design Matlab? Dear all,
Anyone know how to add the Attention mechanism diagram using deep network design Matlab? deep learning MATLAB Answers — New Questions
Time response of modes to an impulse
Hi.
For a 4×4 plant matrix, I want to see the time response of short period mode and phugoid mode of an aircraft for an initial perturbation, respectively. I have 2 roots of the plant matrix for both short period mode and phugoid mode and corresponding period times. How can I plot the responses of the 4 variables with specified initial conditions for an elevator angle deflection?
Thanks.Hi.
For a 4×4 plant matrix, I want to see the time response of short period mode and phugoid mode of an aircraft for an initial perturbation, respectively. I have 2 roots of the plant matrix for both short period mode and phugoid mode and corresponding period times. How can I plot the responses of the 4 variables with specified initial conditions for an elevator angle deflection?
Thanks. Hi.
For a 4×4 plant matrix, I want to see the time response of short period mode and phugoid mode of an aircraft for an initial perturbation, respectively. I have 2 roots of the plant matrix for both short period mode and phugoid mode and corresponding period times. How can I plot the responses of the 4 variables with specified initial conditions for an elevator angle deflection?
Thanks. model, response MATLAB Answers — New Questions
Non-negative least square method is giving fixed values
I am trying the NNLS with my dataset to solve the a problem. The values are for each column remain same and no changes at all in each column. what is the possible exlanation for this?
I have adde the .mat adn .m file with the question. I could use SVD but the the values need to be positive as hey are concentration.
Any help will be appreciated.I am trying the NNLS with my dataset to solve the a problem. The values are for each column remain same and no changes at all in each column. what is the possible exlanation for this?
I have adde the .mat adn .m file with the question. I could use SVD but the the values need to be positive as hey are concentration.
Any help will be appreciated. I am trying the NNLS with my dataset to solve the a problem. The values are for each column remain same and no changes at all in each column. what is the possible exlanation for this?
I have adde the .mat adn .m file with the question. I could use SVD but the the values need to be positive as hey are concentration.
Any help will be appreciated. lsqnonneg, matrix, svd MATLAB Answers — New Questions
command line install of .mlpkginstall silently
Hello Dear All,
Quick question that i do no find a real answer.
How can we install a .mlpkginstall in command line and silenstly.
I must deploy a package on a few hundred computers.
Many thanks in advance.Hello Dear All,
Quick question that i do no find a real answer.
How can we install a .mlpkginstall in command line and silenstly.
I must deploy a package on a few hundred computers.
Many thanks in advance. Hello Dear All,
Quick question that i do no find a real answer.
How can we install a .mlpkginstall in command line and silenstly.
I must deploy a package on a few hundred computers.
Many thanks in advance. mlpkginstall, adminsys MATLAB Answers — New Questions
How can I download matlab 7.1 ?
How can I download the following ?
1) MATLAB Version 7.1.0.246 (R14) Service Pack 3
2) MATLAB Compiler Version 4.3 (R14SP3)
3) MATLAB Report Generator Version 2.3.1 (R14SP3)How can I download the following ?
1) MATLAB Version 7.1.0.246 (R14) Service Pack 3
2) MATLAB Compiler Version 4.3 (R14SP3)
3) MATLAB Report Generator Version 2.3.1 (R14SP3) How can I download the following ?
1) MATLAB Version 7.1.0.246 (R14) Service Pack 3
2) MATLAB Compiler Version 4.3 (R14SP3)
3) MATLAB Report Generator Version 2.3.1 (R14SP3) download matlab_archive_version MATLAB Answers — New Questions
Garch-evt – copula
I am trying to estimate an Egarch- EVT- COPULA MODEL. THE MODEL WILL LINK THE Egarch with extreme value theory and copula to capture interdependence. Is there a toolbox for this, user-written codes or package to execute this. I will be happy if I can get some help in this regardI am trying to estimate an Egarch- EVT- COPULA MODEL. THE MODEL WILL LINK THE Egarch with extreme value theory and copula to capture interdependence. Is there a toolbox for this, user-written codes or package to execute this. I will be happy if I can get some help in this regard I am trying to estimate an Egarch- EVT- COPULA MODEL. THE MODEL WILL LINK THE Egarch with extreme value theory and copula to capture interdependence. Is there a toolbox for this, user-written codes or package to execute this. I will be happy if I can get some help in this regard garch, evt, copula MATLAB Answers — New Questions
fplot not showing any value
Hello, I’m fairly new to Matlab, and I need to plot a function. This function is the double anti-derivative of another function.
Using fplot to plot the first function works, but it doesn’t show any value for the second function… Here is my code :
syms x D(x) Dint(x) g(x) f(x)
E=2.1*10^11
L=12
F=2000
K=1500
C=0.28
e=0.008
a=0.00076
P=3000
w=77008.5
% Fonctions
D(x)=0.2191-a*x
Dint(x)=D(x)-2*e
f(x)= (-F*(L-x)-K*C*(D(x))*(L-x)^2/2)/(E*3.14*(D(x)^4-Dint(x)^4)/64)
g(x)=int(f(x)) – subs(int(f(x)),x,0)
Y(x)=int(g(x)) – subs(int(g(x)),x,0)
subs(Y,x,0)
double(subs(Y,x,12))
% Debug
fplot(f,[0 12])
fplot(Y,[0 12])
I am using Matlab R2024a.
Thanks in advance !Hello, I’m fairly new to Matlab, and I need to plot a function. This function is the double anti-derivative of another function.
Using fplot to plot the first function works, but it doesn’t show any value for the second function… Here is my code :
syms x D(x) Dint(x) g(x) f(x)
E=2.1*10^11
L=12
F=2000
K=1500
C=0.28
e=0.008
a=0.00076
P=3000
w=77008.5
% Fonctions
D(x)=0.2191-a*x
Dint(x)=D(x)-2*e
f(x)= (-F*(L-x)-K*C*(D(x))*(L-x)^2/2)/(E*3.14*(D(x)^4-Dint(x)^4)/64)
g(x)=int(f(x)) – subs(int(f(x)),x,0)
Y(x)=int(g(x)) – subs(int(g(x)),x,0)
subs(Y,x,0)
double(subs(Y,x,12))
% Debug
fplot(f,[0 12])
fplot(Y,[0 12])
I am using Matlab R2024a.
Thanks in advance ! Hello, I’m fairly new to Matlab, and I need to plot a function. This function is the double anti-derivative of another function.
Using fplot to plot the first function works, but it doesn’t show any value for the second function… Here is my code :
syms x D(x) Dint(x) g(x) f(x)
E=2.1*10^11
L=12
F=2000
K=1500
C=0.28
e=0.008
a=0.00076
P=3000
w=77008.5
% Fonctions
D(x)=0.2191-a*x
Dint(x)=D(x)-2*e
f(x)= (-F*(L-x)-K*C*(D(x))*(L-x)^2/2)/(E*3.14*(D(x)^4-Dint(x)^4)/64)
g(x)=int(f(x)) – subs(int(f(x)),x,0)
Y(x)=int(g(x)) – subs(int(g(x)),x,0)
subs(Y,x,0)
double(subs(Y,x,12))
% Debug
fplot(f,[0 12])
fplot(Y,[0 12])
I am using Matlab R2024a.
Thanks in advance ! fplot, syms MATLAB Answers — New Questions
Assign column names in a workspace table
Hi, MatLab novice here
I have been given three data sets to analyse. I need to rename the columns in the tables as different things. I have tried looking for the answer elsewhere and cannot work it out, could someone please help/point me in the right direction?
Many thanks!Hi, MatLab novice here
I have been given three data sets to analyse. I need to rename the columns in the tables as different things. I have tried looking for the answer elsewhere and cannot work it out, could someone please help/point me in the right direction?
Many thanks! Hi, MatLab novice here
I have been given three data sets to analyse. I need to rename the columns in the tables as different things. I have tried looking for the answer elsewhere and cannot work it out, could someone please help/point me in the right direction?
Many thanks! add column name, column name, assign column variable names MATLAB Answers — New Questions
USB-2416-4AO Matlab Live user interface
I want to make a code that takes in analog inputs from a DAQ and is able to store that data in plots as well as send output signals based on the inputs. I cannot seem to get the code to store any data or read data directly from the DAQ in matlab.
My code so far:
d = daqlist("mcc");
d(1, 🙂
dq = daq("mcc")
addinput(dq, "Board0", "Ai0", "Voltage");
dq
[data, startTime] = read(dq, seconds(1));
plot(data.Time, data.Board0_Ai0);
xlabel("Time (s)");
ylabel("Voltage (V)");I want to make a code that takes in analog inputs from a DAQ and is able to store that data in plots as well as send output signals based on the inputs. I cannot seem to get the code to store any data or read data directly from the DAQ in matlab.
My code so far:
d = daqlist("mcc");
d(1, 🙂
dq = daq("mcc")
addinput(dq, "Board0", "Ai0", "Voltage");
dq
[data, startTime] = read(dq, seconds(1));
plot(data.Time, data.Board0_Ai0);
xlabel("Time (s)");
ylabel("Voltage (V)"); I want to make a code that takes in analog inputs from a DAQ and is able to store that data in plots as well as send output signals based on the inputs. I cannot seem to get the code to store any data or read data directly from the DAQ in matlab.
My code so far:
d = daqlist("mcc");
d(1, 🙂
dq = daq("mcc")
addinput(dq, "Board0", "Ai0", "Voltage");
dq
[data, startTime] = read(dq, seconds(1));
plot(data.Time, data.Board0_Ai0);
xlabel("Time (s)");
ylabel("Voltage (V)"); daq, gui MATLAB Answers — New Questions