Category: Matlab
Category Archives: Matlab
How to optimize IF statement with Multiple Conditions.
Hello,
I have five Tables (T1 to T5) and Conditons CR ranging from ( 0-4) . When I process a files each file may have one condition in it or multiple conditons. For example ( it could have Condition 3 or in the next file it could be 0,2 & 4). Which ever condtiion is satisfied that particular table (if one condition) and (Multiple table Verticat into one final table).
I tried using multiple methods like
1) If any or all statments didn’t work.
2) if I have to use ismember then I could have make multiple array of condition hard coded into the script. Example: Condition:if ismember([1 2], CR]’
Final_Table = verticat(T2;T3).
Could someone suggest a robust and quicker way.
If possible provide with a Script sketon or example so It could be understood better and also your time and effort is well respected.
Thank youHello,
I have five Tables (T1 to T5) and Conditons CR ranging from ( 0-4) . When I process a files each file may have one condition in it or multiple conditons. For example ( it could have Condition 3 or in the next file it could be 0,2 & 4). Which ever condtiion is satisfied that particular table (if one condition) and (Multiple table Verticat into one final table).
I tried using multiple methods like
1) If any or all statments didn’t work.
2) if I have to use ismember then I could have make multiple array of condition hard coded into the script. Example: Condition:if ismember([1 2], CR]’
Final_Table = verticat(T2;T3).
Could someone suggest a robust and quicker way.
If possible provide with a Script sketon or example so It could be understood better and also your time and effort is well respected.
Thank you Hello,
I have five Tables (T1 to T5) and Conditons CR ranging from ( 0-4) . When I process a files each file may have one condition in it or multiple conditons. For example ( it could have Condition 3 or in the next file it could be 0,2 & 4). Which ever condtiion is satisfied that particular table (if one condition) and (Multiple table Verticat into one final table).
I tried using multiple methods like
1) If any or all statments didn’t work.
2) if I have to use ismember then I could have make multiple array of condition hard coded into the script. Example: Condition:if ismember([1 2], CR]’
Final_Table = verticat(T2;T3).
Could someone suggest a robust and quicker way.
If possible provide with a Script sketon or example so It could be understood better and also your time and effort is well respected.
Thank you if statement, multiple conditions MATLAB Answers — New Questions
Smooth noisy data whilst keep absolute minimum and maximum values
I have a reasonably noisy signal (almost sinusoidal) that I am smoothing using sgolayfilt.
I am using a polynomial of 2 with a frame length of 901.
I am happy with the smoothing using this frame length.
However, there are several parts of the signal that need to have (correctly) a minimum value of zero.
When I smooth the signal the value of the minima are no longer zero. The lowest value of the smoothed curve at the minima takes a non-zero value, that might be positive or negative.
If I "shift" the curve then only one of the minima is zero.
Is there a method to smooth curves whilst keeping absolute minimum (and maximum if required) values? Or is it always a trade-off (I could trace the signal by eye very well, using a drawing package, keeping the minima, but I want to automate the process with matlab)
regardsI have a reasonably noisy signal (almost sinusoidal) that I am smoothing using sgolayfilt.
I am using a polynomial of 2 with a frame length of 901.
I am happy with the smoothing using this frame length.
However, there are several parts of the signal that need to have (correctly) a minimum value of zero.
When I smooth the signal the value of the minima are no longer zero. The lowest value of the smoothed curve at the minima takes a non-zero value, that might be positive or negative.
If I "shift" the curve then only one of the minima is zero.
Is there a method to smooth curves whilst keeping absolute minimum (and maximum if required) values? Or is it always a trade-off (I could trace the signal by eye very well, using a drawing package, keeping the minima, but I want to automate the process with matlab)
regards I have a reasonably noisy signal (almost sinusoidal) that I am smoothing using sgolayfilt.
I am using a polynomial of 2 with a frame length of 901.
I am happy with the smoothing using this frame length.
However, there are several parts of the signal that need to have (correctly) a minimum value of zero.
When I smooth the signal the value of the minima are no longer zero. The lowest value of the smoothed curve at the minima takes a non-zero value, that might be positive or negative.
If I "shift" the curve then only one of the minima is zero.
Is there a method to smooth curves whilst keeping absolute minimum (and maximum if required) values? Or is it always a trade-off (I could trace the signal by eye very well, using a drawing package, keeping the minima, but I want to automate the process with matlab)
regards smoothing, signal, sgolay, baseline correction MATLAB Answers — New Questions
Want to remove white patches of a image
Guys,
I have a problem this is a jewelry photo that i have uploaded what i need to do is remove the white bright spot that is often appearing on the gold surfaces as well as the gemstones, these are the reflection of the lighting setup. What i am planning to do is find out the region of high white intensity that is with RGB values over 220 and then replace them by the average shade of the pixels around them, thus removing those white patches. Is this possible?
Thanks a lot guys.
<</matlabcentral/answers/uploaded_files/15159/SAM_0304.JPG>>Guys,
I have a problem this is a jewelry photo that i have uploaded what i need to do is remove the white bright spot that is often appearing on the gold surfaces as well as the gemstones, these are the reflection of the lighting setup. What i am planning to do is find out the region of high white intensity that is with RGB values over 220 and then replace them by the average shade of the pixels around them, thus removing those white patches. Is this possible?
Thanks a lot guys.
<</matlabcentral/answers/uploaded_files/15159/SAM_0304.JPG>> Guys,
I have a problem this is a jewelry photo that i have uploaded what i need to do is remove the white bright spot that is often appearing on the gold surfaces as well as the gemstones, these are the reflection of the lighting setup. What i am planning to do is find out the region of high white intensity that is with RGB values over 220 and then replace them by the average shade of the pixels around them, thus removing those white patches. Is this possible?
Thanks a lot guys.
<</matlabcentral/answers/uploaded_files/15159/SAM_0304.JPG>> image processing, image analysis MATLAB Answers — New Questions
model reduction from a database created with xfoil
Hello community,
i have created a database with xfoil (2d airfoil panel code with an boundary solver).
The database is saved in this format:
% L lift
% D drag
% al angle of attack
% thick thickness of the airfoil
% camber camber of the airfoil
% Ma Mach number
% Re Reynolds number
L = db_L(al, thick, camber, Ma, Re);
D = db_D(al, thick, camber, Ma, Re);
The easiest way is a lookup-table, but i am looking for a more sophisticated approach like a POD (proper orthogonal decompositon) to identify e.g. how sensitive the thickness affect the lift.
if every input variable consist of 16 values, the database has 16^5 entries, and i could create Matrix of 1024 x1024 for the POD analysis.
but how could i compare the results of the modes with the data base? e.g. the deviation of the lift for a specific case.
PS: is there an application or something in Matlab which could help me?
best regards
emjayHello community,
i have created a database with xfoil (2d airfoil panel code with an boundary solver).
The database is saved in this format:
% L lift
% D drag
% al angle of attack
% thick thickness of the airfoil
% camber camber of the airfoil
% Ma Mach number
% Re Reynolds number
L = db_L(al, thick, camber, Ma, Re);
D = db_D(al, thick, camber, Ma, Re);
The easiest way is a lookup-table, but i am looking for a more sophisticated approach like a POD (proper orthogonal decompositon) to identify e.g. how sensitive the thickness affect the lift.
if every input variable consist of 16 values, the database has 16^5 entries, and i could create Matrix of 1024 x1024 for the POD analysis.
but how could i compare the results of the modes with the data base? e.g. the deviation of the lift for a specific case.
PS: is there an application or something in Matlab which could help me?
best regards
emjay Hello community,
i have created a database with xfoil (2d airfoil panel code with an boundary solver).
The database is saved in this format:
% L lift
% D drag
% al angle of attack
% thick thickness of the airfoil
% camber camber of the airfoil
% Ma Mach number
% Re Reynolds number
L = db_L(al, thick, camber, Ma, Re);
D = db_D(al, thick, camber, Ma, Re);
The easiest way is a lookup-table, but i am looking for a more sophisticated approach like a POD (proper orthogonal decompositon) to identify e.g. how sensitive the thickness affect the lift.
if every input variable consist of 16 values, the database has 16^5 entries, and i could create Matrix of 1024 x1024 for the POD analysis.
but how could i compare the results of the modes with the data base? e.g. the deviation of the lift for a specific case.
PS: is there an application or something in Matlab which could help me?
best regards
emjay pod MATLAB Answers — New Questions
I want to connect 30MW PV power plant to pre-built IEEE 9 bus system what is the easier way to do that in other words is there a block in the library?
in MAATLAB Simulink i want to add PV power plant to the power systemin MAATLAB Simulink i want to add PV power plant to the power system in MAATLAB Simulink i want to add PV power plant to the power system urgent MATLAB Answers — New Questions
Can I include only specific MATLAB DLL files, like “MathWorks.MATLAB.Types.dll”, in an external .NET application?
I am using MATLAB R2023b on Windows. I am creating a separate application in .NET, where I would like to only use specific MATLAB .NET datatypes, like "MathWorks.MATLAB.Types.MATLABStruct".
These data types are located in the "MathWorks.MATLAB.Types.dll" file in
C:Program FilesMATLABR2023bexterndotnetnetstandard2.0
.
I am not passing any data into MATLAB, as this is a testing application that is just testing type conversion.
Is there any way to only include specific MATLAB DLL files in a .NET application, or would I need to have either MATLAB or MATLAB Runtime installed on a machine that is running this application?I am using MATLAB R2023b on Windows. I am creating a separate application in .NET, where I would like to only use specific MATLAB .NET datatypes, like "MathWorks.MATLAB.Types.MATLABStruct".
These data types are located in the "MathWorks.MATLAB.Types.dll" file in
C:Program FilesMATLABR2023bexterndotnetnetstandard2.0
.
I am not passing any data into MATLAB, as this is a testing application that is just testing type conversion.
Is there any way to only include specific MATLAB DLL files in a .NET application, or would I need to have either MATLAB or MATLAB Runtime installed on a machine that is running this application? I am using MATLAB R2023b on Windows. I am creating a separate application in .NET, where I would like to only use specific MATLAB .NET datatypes, like "MathWorks.MATLAB.Types.MATLABStruct".
These data types are located in the "MathWorks.MATLAB.Types.dll" file in
C:Program FilesMATLABR2023bexterndotnetnetstandard2.0
.
I am not passing any data into MATLAB, as this is a testing application that is just testing type conversion.
Is there any way to only include specific MATLAB DLL files in a .NET application, or would I need to have either MATLAB or MATLAB Runtime installed on a machine that is running this application? dotnet, matlabruntime, matlabstruct, dll MATLAB Answers — New Questions
Using tabular data for Curve fitting of function z = f (x, y) with incomplete values of z. These blank z (i, j) automatically takes zero values and this is a problem
Dear Community Members,
I have tabular data for data selection in the Curve fitter in the form of:.
I have to use curve fitter for z = f (x, y), but I don’t have values for z(2, 4), z(3,3) and z(3,4) (red one).
In the workspase variable (matrix Z) these blank places automatically take values, which is zeros. Is there any instrument to ignore these zeros and the regression analyses to be made only with the available z values. In other words to ignore the three zero values in the down right corner? May be something with the weights instrument? If I simply use the matrix with zero values, without any additional actions, of course the regression method uses these z(2, 4) = 0, z(3,3) = 0 and z(3,4) = 0 and the results are unacceptable.Dear Community Members,
I have tabular data for data selection in the Curve fitter in the form of:.
I have to use curve fitter for z = f (x, y), but I don’t have values for z(2, 4), z(3,3) and z(3,4) (red one).
In the workspase variable (matrix Z) these blank places automatically take values, which is zeros. Is there any instrument to ignore these zeros and the regression analyses to be made only with the available z values. In other words to ignore the three zero values in the down right corner? May be something with the weights instrument? If I simply use the matrix with zero values, without any additional actions, of course the regression method uses these z(2, 4) = 0, z(3,3) = 0 and z(3,4) = 0 and the results are unacceptable. Dear Community Members,
I have tabular data for data selection in the Curve fitter in the form of:.
I have to use curve fitter for z = f (x, y), but I don’t have values for z(2, 4), z(3,3) and z(3,4) (red one).
In the workspase variable (matrix Z) these blank places automatically take values, which is zeros. Is there any instrument to ignore these zeros and the regression analyses to be made only with the available z values. In other words to ignore the three zero values in the down right corner? May be something with the weights instrument? If I simply use the matrix with zero values, without any additional actions, of course the regression method uses these z(2, 4) = 0, z(3,3) = 0 and z(3,4) = 0 and the results are unacceptable. ignore zeros in input data for curve fitter MATLAB Answers — New Questions
I want model a datacenter load from time series power consumption and then connecting it to AC distribution three phase system
Problem I am facing is when I use importedin MATlab and model it as a load using controlled current source and then adding an inverter , my swing bus (From IEEE 13 bus test system) is having Dc bias/ offset instead of balance volatges. I am trying to analyze transient behaviour dueto sudden high current requirement. Please guide why I am getting this problem.Problem I am facing is when I use importedin MATlab and model it as a load using controlled current source and then adding an inverter , my swing bus (From IEEE 13 bus test system) is having Dc bias/ offset instead of balance volatges. I am trying to analyze transient behaviour dueto sudden high current requirement. Please guide why I am getting this problem. Problem I am facing is when I use importedin MATlab and model it as a load using controlled current source and then adding an inverter , my swing bus (From IEEE 13 bus test system) is having Dc bias/ offset instead of balance volatges. I am trying to analyze transient behaviour dueto sudden high current requirement. Please guide why I am getting this problem. load modelling, simulink, ieee 13 bus MATLAB Answers — New Questions
What is the setting in Production Server for auto deployment and how do I set this up?
I could not find a place in Settings section in the Production Sever Dashboard to enable or disable auto deployment, and if I need to add the options through advanced section, what I should put there? Do I need to restart the server/instance after I add the auto deployment configuration?I could not find a place in Settings section in the Production Sever Dashboard to enable or disable auto deployment, and if I need to add the options through advanced section, what I should put there? Do I need to restart the server/instance after I add the auto deployment configuration? I could not find a place in Settings section in the Production Sever Dashboard to enable or disable auto deployment, and if I need to add the options through advanced section, what I should put there? Do I need to restart the server/instance after I add the auto deployment configuration? production server, configuration, auto deployment MATLAB Answers — New Questions
Examples missing from requirements toolbox installation
I am trying to open the "Link test case reqs Example" with the command openExample(‘slrequirements/LinkTestCaseReqsExample’), but the only examples I have installed are "ImportAndEditRequiermentsWordExample" & "VerifyAShortestPathAlgorithmExample". There should be way more than 2 according to the doccumentation.I am trying to open the "Link test case reqs Example" with the command openExample(‘slrequirements/LinkTestCaseReqsExample’), but the only examples I have installed are "ImportAndEditRequiermentsWordExample" & "VerifyAShortestPathAlgorithmExample". There should be way more than 2 according to the doccumentation. I am trying to open the "Link test case reqs Example" with the command openExample(‘slrequirements/LinkTestCaseReqsExample’), but the only examples I have installed are "ImportAndEditRequiermentsWordExample" & "VerifyAShortestPathAlgorithmExample". There should be way more than 2 according to the doccumentation. requirements toolbox, examples MATLAB Answers — New Questions
Accessing Pixhawk 6x parameters when building firmware for SRXL2 connection
I am attempting to get the Pixhawk 6x to receive data from a new spektrum receiver that utilizes SRXL2, the process required for getting the SRXL2 protocol to work involves setting certain parameters to different values, namely:
Set SERIAL4_PROTOCOL = 23
Set SERIAL4_OPTIONS = 4
Set RSSI_TYPE = 3
However, when looking at the parameters avaialble in Qground control or mission planner, these parameters are not present. Additionally, there seems to be some kind of text file called uart.txt that the serial parameters are attempting to read from but it detects nothing when loading. Is there any way of adding these parameters to the pixhawk during the firmware build process? Or is there a specific means of configuring the TELEM2 port for a true UART connection. As this is the only way I can get the SRXL2 to connect to the pixhawk when it is running a simulink model (fmu_v6x_fixedwing).I am attempting to get the Pixhawk 6x to receive data from a new spektrum receiver that utilizes SRXL2, the process required for getting the SRXL2 protocol to work involves setting certain parameters to different values, namely:
Set SERIAL4_PROTOCOL = 23
Set SERIAL4_OPTIONS = 4
Set RSSI_TYPE = 3
However, when looking at the parameters avaialble in Qground control or mission planner, these parameters are not present. Additionally, there seems to be some kind of text file called uart.txt that the serial parameters are attempting to read from but it detects nothing when loading. Is there any way of adding these parameters to the pixhawk during the firmware build process? Or is there a specific means of configuring the TELEM2 port for a true UART connection. As this is the only way I can get the SRXL2 to connect to the pixhawk when it is running a simulink model (fmu_v6x_fixedwing). I am attempting to get the Pixhawk 6x to receive data from a new spektrum receiver that utilizes SRXL2, the process required for getting the SRXL2 protocol to work involves setting certain parameters to different values, namely:
Set SERIAL4_PROTOCOL = 23
Set SERIAL4_OPTIONS = 4
Set RSSI_TYPE = 3
However, when looking at the parameters avaialble in Qground control or mission planner, these parameters are not present. Additionally, there seems to be some kind of text file called uart.txt that the serial parameters are attempting to read from but it detects nothing when loading. Is there any way of adding these parameters to the pixhawk during the firmware build process? Or is there a specific means of configuring the TELEM2 port for a true UART connection. As this is the only way I can get the SRXL2 to connect to the pixhawk when it is running a simulink model (fmu_v6x_fixedwing). simulink, pixhawk, uav toolbox, pixhawk6x, uart, rcin MATLAB Answers — New Questions
Publishing multiple graphs without using a subplot function
How do you publish multiple graphs independently without putting all of them in a subplot?How do you publish multiple graphs independently without putting all of them in a subplot? How do you publish multiple graphs independently without putting all of them in a subplot? graph, subplot, publish MATLAB Answers — New Questions
Numerical method of the “fimplicit” function
Hello, does anyone know what kind of numerical methods are used in the "fimplicit" function? I cannot find any information about this. Thank you!Hello, does anyone know what kind of numerical methods are used in the "fimplicit" function? I cannot find any information about this. Thank you! Hello, does anyone know what kind of numerical methods are used in the "fimplicit" function? I cannot find any information about this. Thank you! fimplicit, numerical method MATLAB Answers — New Questions
How I organize and insert NIR dataset for Classification Learner.
Hello,
I currently research the field of near-infrared spectroscopy (NIR), mainly in the analysis of the spectra of polymeric materials. I would like to make a system for classifying these spectra by machine learning. Literature indicates the APP Classification Leaner and its models to perform the training of the spectra. However, I’m having trouble inserting the spectra sheet (containing wavelength and absorbance values). Being new to Matlab, I don’t know how to organize these spreadsheets with different values, because the wavelength is constant for the different samples, but the absorbance varies for them. My idea is to classify the spectra for the different materials. How could I organize the spreadsheet and develop the training?
If anyone can help me with a tutorial or quick step by step, I would be extremely grateful.
Thanks.Hello,
I currently research the field of near-infrared spectroscopy (NIR), mainly in the analysis of the spectra of polymeric materials. I would like to make a system for classifying these spectra by machine learning. Literature indicates the APP Classification Leaner and its models to perform the training of the spectra. However, I’m having trouble inserting the spectra sheet (containing wavelength and absorbance values). Being new to Matlab, I don’t know how to organize these spreadsheets with different values, because the wavelength is constant for the different samples, but the absorbance varies for them. My idea is to classify the spectra for the different materials. How could I organize the spreadsheet and develop the training?
If anyone can help me with a tutorial or quick step by step, I would be extremely grateful.
Thanks. Hello,
I currently research the field of near-infrared spectroscopy (NIR), mainly in the analysis of the spectra of polymeric materials. I would like to make a system for classifying these spectra by machine learning. Literature indicates the APP Classification Leaner and its models to perform the training of the spectra. However, I’m having trouble inserting the spectra sheet (containing wavelength and absorbance values). Being new to Matlab, I don’t know how to organize these spreadsheets with different values, because the wavelength is constant for the different samples, but the absorbance varies for them. My idea is to classify the spectra for the different materials. How could I organize the spreadsheet and develop the training?
If anyone can help me with a tutorial or quick step by step, I would be extremely grateful.
Thanks. nir, classification learner MATLAB Answers — New Questions
how to generate correct logical mask of the size of shape file?
i am using following code to generate logical mask
function croppedimg = cropimage(data, R, shapefile)
% Load the shapefile and retrieve its info
S = shaperead(shapefile);
% Shapefile projections
info = shapeinfo(shapefile);
crs = info.CoordinateReferenceSystem;
[S.lon,S.lat] = projinv(crs,S.X,S.Y);
% read and reproject image file
p = R.ProjectedCRS;
[x,y] = worldGrid(R);
[lon,lat] = projinv(p,x,y);
% Create a logical mask
% Approach 1: Using ‘inpolygon’ function
xq = lon(:);
yq = lat(:);
in = inpolygon(xq,yq,S.lon,S.lat);
logical_mask = reshape(in,size(lon));
% Debugging: Display the logical mask summary
disp([‘Total number of pixels inside polygon: ‘, num2str(numel(logical_mask))]);
disp([‘Total number of pixels inside image: ‘, num2str(numel(data))]);
However it is showing the
Total number of pixels inside polygon: 16982229
Total number of pixels inside image: 16982229
please suggest me how to create correct logical mask of the size of shape file.
kuldeepi am using following code to generate logical mask
function croppedimg = cropimage(data, R, shapefile)
% Load the shapefile and retrieve its info
S = shaperead(shapefile);
% Shapefile projections
info = shapeinfo(shapefile);
crs = info.CoordinateReferenceSystem;
[S.lon,S.lat] = projinv(crs,S.X,S.Y);
% read and reproject image file
p = R.ProjectedCRS;
[x,y] = worldGrid(R);
[lon,lat] = projinv(p,x,y);
% Create a logical mask
% Approach 1: Using ‘inpolygon’ function
xq = lon(:);
yq = lat(:);
in = inpolygon(xq,yq,S.lon,S.lat);
logical_mask = reshape(in,size(lon));
% Debugging: Display the logical mask summary
disp([‘Total number of pixels inside polygon: ‘, num2str(numel(logical_mask))]);
disp([‘Total number of pixels inside image: ‘, num2str(numel(data))]);
However it is showing the
Total number of pixels inside polygon: 16982229
Total number of pixels inside image: 16982229
please suggest me how to create correct logical mask of the size of shape file.
kuldeep i am using following code to generate logical mask
function croppedimg = cropimage(data, R, shapefile)
% Load the shapefile and retrieve its info
S = shaperead(shapefile);
% Shapefile projections
info = shapeinfo(shapefile);
crs = info.CoordinateReferenceSystem;
[S.lon,S.lat] = projinv(crs,S.X,S.Y);
% read and reproject image file
p = R.ProjectedCRS;
[x,y] = worldGrid(R);
[lon,lat] = projinv(p,x,y);
% Create a logical mask
% Approach 1: Using ‘inpolygon’ function
xq = lon(:);
yq = lat(:);
in = inpolygon(xq,yq,S.lon,S.lat);
logical_mask = reshape(in,size(lon));
% Debugging: Display the logical mask summary
disp([‘Total number of pixels inside polygon: ‘, num2str(numel(logical_mask))]);
disp([‘Total number of pixels inside image: ‘, num2str(numel(data))]);
However it is showing the
Total number of pixels inside polygon: 16982229
Total number of pixels inside image: 16982229
please suggest me how to create correct logical mask of the size of shape file.
kuldeep how to generate correct logical mask ? MATLAB Answers — New Questions
Simulink filter using frequency response transfer function
Hi,
My main problem is this: I’m building a fiber optical communication system using simulink.
As a source, I use a bernoulli generator, then this signal runs to a low pass filter and the exit is the signal equivalent to a signal that comes off a led, so the emission part is done.
The problems begins at the transmission channel. I want to do a filter that simulates the dispersion effect in the fiber (only chromatic dispersion), but I don’t know how. I only have a transfer functions like exp(-j*alpha*f.^2) and I don’t know what to do with this. What’s the right procedure to implement this kind of t.f. in a analog filter at the simulink?
Any help is welcome.
Kind regardsHi,
My main problem is this: I’m building a fiber optical communication system using simulink.
As a source, I use a bernoulli generator, then this signal runs to a low pass filter and the exit is the signal equivalent to a signal that comes off a led, so the emission part is done.
The problems begins at the transmission channel. I want to do a filter that simulates the dispersion effect in the fiber (only chromatic dispersion), but I don’t know how. I only have a transfer functions like exp(-j*alpha*f.^2) and I don’t know what to do with this. What’s the right procedure to implement this kind of t.f. in a analog filter at the simulink?
Any help is welcome.
Kind regards Hi,
My main problem is this: I’m building a fiber optical communication system using simulink.
As a source, I use a bernoulli generator, then this signal runs to a low pass filter and the exit is the signal equivalent to a signal that comes off a led, so the emission part is done.
The problems begins at the transmission channel. I want to do a filter that simulates the dispersion effect in the fiber (only chromatic dispersion), but I don’t know how. I only have a transfer functions like exp(-j*alpha*f.^2) and I don’t know what to do with this. What’s the right procedure to implement this kind of t.f. in a analog filter at the simulink?
Any help is welcome.
Kind regards simulink, optical dispersion MATLAB Answers — New Questions
Why does App Designer include the full file path when packaging external helper functions?
I am trying to create a GUI for some existing code I wrote using the MATLAB App Designer. The app relies on some external helper functions that I wrote in MATLAB program files and they are correctly identified as necessary to include; however, when packaged it includes the entire file path of the matlab function files within the installed package. This means that after installing the app, for example, tallySum.m ends up stored in "/Users/rhysg/Library/Application Support/MathWorks/MATLAB Add-Ons/Apps/NNB_GUI/Users/rhysg/Documents/YPGRA/TIRF_ProcessingCode/tallySum.m" instead of just placing it in "/Users/rhysg/Library/Application Support/MathWorks/MATLAB Add-Ons/Apps/NNB_GUI/tallySum.m"
This doesn’t cause functional problems but it does not seem intended and I was wondering if it could be avoided. Other than copying all the functions directly into the app is there a way to fix this? Is there a reason it functions in this way? Is there somewhere else to look for information on this?
Thanks in advance.I am trying to create a GUI for some existing code I wrote using the MATLAB App Designer. The app relies on some external helper functions that I wrote in MATLAB program files and they are correctly identified as necessary to include; however, when packaged it includes the entire file path of the matlab function files within the installed package. This means that after installing the app, for example, tallySum.m ends up stored in "/Users/rhysg/Library/Application Support/MathWorks/MATLAB Add-Ons/Apps/NNB_GUI/Users/rhysg/Documents/YPGRA/TIRF_ProcessingCode/tallySum.m" instead of just placing it in "/Users/rhysg/Library/Application Support/MathWorks/MATLAB Add-Ons/Apps/NNB_GUI/tallySum.m"
This doesn’t cause functional problems but it does not seem intended and I was wondering if it could be avoided. Other than copying all the functions directly into the app is there a way to fix this? Is there a reason it functions in this way? Is there somewhere else to look for information on this?
Thanks in advance. I am trying to create a GUI for some existing code I wrote using the MATLAB App Designer. The app relies on some external helper functions that I wrote in MATLAB program files and they are correctly identified as necessary to include; however, when packaged it includes the entire file path of the matlab function files within the installed package. This means that after installing the app, for example, tallySum.m ends up stored in "/Users/rhysg/Library/Application Support/MathWorks/MATLAB Add-Ons/Apps/NNB_GUI/Users/rhysg/Documents/YPGRA/TIRF_ProcessingCode/tallySum.m" instead of just placing it in "/Users/rhysg/Library/Application Support/MathWorks/MATLAB Add-Ons/Apps/NNB_GUI/tallySum.m"
This doesn’t cause functional problems but it does not seem intended and I was wondering if it could be avoided. Other than copying all the functions directly into the app is there a way to fix this? Is there a reason it functions in this way? Is there somewhere else to look for information on this?
Thanks in advance. app designer MATLAB Answers — New Questions
How to insert an image into a specific Excel cell?
In Excel, I can place an image into a specific cell using Insert -> Pictures -> Place in Cell; this inserts the image into the cell, not floating over the cell. Can the same thing be done from MATLAB using ActiveX? Note I already have working code to insert a floating image in any desired location. What I really need to do is to insert it into a cell of my choosing.In Excel, I can place an image into a specific cell using Insert -> Pictures -> Place in Cell; this inserts the image into the cell, not floating over the cell. Can the same thing be done from MATLAB using ActiveX? Note I already have working code to insert a floating image in any desired location. What I really need to do is to insert it into a cell of my choosing. In Excel, I can place an image into a specific cell using Insert -> Pictures -> Place in Cell; this inserts the image into the cell, not floating over the cell. Can the same thing be done from MATLAB using ActiveX? Note I already have working code to insert a floating image in any desired location. What I really need to do is to insert it into a cell of my choosing. insert image, excel MATLAB Answers — New Questions
identify model parameters and data (g = Gm).
I have a problem, namely to identify model parameters and data (g = Gm).
I’ve done it in my notebook, but I want to write a matlab script for this and I’m struggling on how to write the matrix G the right way in matlab.
This is how I write G in my notebook:
1111000000000000
0000111100000000
0000000011110000
0000000000001111
1000100010001000
0100010001000100
0010001000100010
0001000100010001I have a problem, namely to identify model parameters and data (g = Gm).
I’ve done it in my notebook, but I want to write a matlab script for this and I’m struggling on how to write the matrix G the right way in matlab.
This is how I write G in my notebook:
1111000000000000
0000111100000000
0000000011110000
0000000000001111
1000100010001000
0100010001000100
0010001000100010
0001000100010001 I have a problem, namely to identify model parameters and data (g = Gm).
I’ve done it in my notebook, but I want to write a matlab script for this and I’m struggling on how to write the matrix G the right way in matlab.
This is how I write G in my notebook:
1111000000000000
0000111100000000
0000000011110000
0000000000001111
1000100010001000
0100010001000100
0010001000100010
0001000100010001 #help MATLAB Answers — New Questions
Fit a custom made function to a certain trend within data from a matrix
Dear all,
I have been struggling for a while with the two issues that I show you below.
I have a matrix which represents the image of a pixelated neutron detector. The units of such a matrix is Count/minute. If I plot the matrix with the command surface(X, Y, Z), being Z the matrix, I get the following figure:
In this figure we can see two different trends: the x=y line (plus its width), which is what we call the "Specular Ridge", and a tiny contribution given by the white dashed line, which is what we call the "Zemann Splitting". The Zemann splitting is given by the equation y = sqrt(x^2 – (1.47e-7*H*L^2)), where H is the magnetic field and L is the wavelength of the nuetrons (5.183 AA in my case).
I would like to find the optimum H which fits best to the data inside the red circle by using the above mentioned equation (H should be something like 6-7). And later I would like to make a ROI (Region Of Interest) to count how many counts lay within such area.
I have attached the matrix (file 00607_UD_subplot.txt) and X and Y coordinates (files 00607_UD_xcoordinates.txt and 00607_UD_ycoordinates.txt).
The code to visualize the figure is the following:
A = load(‘00607_UD_subplot.txt’);
X = load(‘00607_UD_xcoordinates.txt’);
Y = load(‘00607_UD_ycoordinates.txt’);
surface(X, Y, A)
axis square
colormap(map);
caxis([5e-4 100])
set(gca,’colorscale’,’log’)
hold on
plot(X, sqrt((X.^2) – (1.47e-7*6.5*5.183^2)), ‘Color’,’white’,’LineStyle’,’–‘, ‘LineWidth’, 2)
xlabel(‘alpha_{i} [rad]’, ‘fontsize’, 18);
ylabel(‘alpha_{f} [rad]’, ‘fontsize’, 18);
cb1 = colorbar;
cb1.Label.String = ‘Neutron Intensity (CTS/MIN)’;
cb1.FontSize = 16;
cb1.Label.FontSize = 20;
cb1.LineWidth = 1.5;
Any help / suggestion would be helpful and very welcomedl!!!
Cheers,
Jose.Dear all,
I have been struggling for a while with the two issues that I show you below.
I have a matrix which represents the image of a pixelated neutron detector. The units of such a matrix is Count/minute. If I plot the matrix with the command surface(X, Y, Z), being Z the matrix, I get the following figure:
In this figure we can see two different trends: the x=y line (plus its width), which is what we call the "Specular Ridge", and a tiny contribution given by the white dashed line, which is what we call the "Zemann Splitting". The Zemann splitting is given by the equation y = sqrt(x^2 – (1.47e-7*H*L^2)), where H is the magnetic field and L is the wavelength of the nuetrons (5.183 AA in my case).
I would like to find the optimum H which fits best to the data inside the red circle by using the above mentioned equation (H should be something like 6-7). And later I would like to make a ROI (Region Of Interest) to count how many counts lay within such area.
I have attached the matrix (file 00607_UD_subplot.txt) and X and Y coordinates (files 00607_UD_xcoordinates.txt and 00607_UD_ycoordinates.txt).
The code to visualize the figure is the following:
A = load(‘00607_UD_subplot.txt’);
X = load(‘00607_UD_xcoordinates.txt’);
Y = load(‘00607_UD_ycoordinates.txt’);
surface(X, Y, A)
axis square
colormap(map);
caxis([5e-4 100])
set(gca,’colorscale’,’log’)
hold on
plot(X, sqrt((X.^2) – (1.47e-7*6.5*5.183^2)), ‘Color’,’white’,’LineStyle’,’–‘, ‘LineWidth’, 2)
xlabel(‘alpha_{i} [rad]’, ‘fontsize’, 18);
ylabel(‘alpha_{f} [rad]’, ‘fontsize’, 18);
cb1 = colorbar;
cb1.Label.String = ‘Neutron Intensity (CTS/MIN)’;
cb1.FontSize = 16;
cb1.Label.FontSize = 20;
cb1.LineWidth = 1.5;
Any help / suggestion would be helpful and very welcomedl!!!
Cheers,
Jose. Dear all,
I have been struggling for a while with the two issues that I show you below.
I have a matrix which represents the image of a pixelated neutron detector. The units of such a matrix is Count/minute. If I plot the matrix with the command surface(X, Y, Z), being Z the matrix, I get the following figure:
In this figure we can see two different trends: the x=y line (plus its width), which is what we call the "Specular Ridge", and a tiny contribution given by the white dashed line, which is what we call the "Zemann Splitting". The Zemann splitting is given by the equation y = sqrt(x^2 – (1.47e-7*H*L^2)), where H is the magnetic field and L is the wavelength of the nuetrons (5.183 AA in my case).
I would like to find the optimum H which fits best to the data inside the red circle by using the above mentioned equation (H should be something like 6-7). And later I would like to make a ROI (Region Of Interest) to count how many counts lay within such area.
I have attached the matrix (file 00607_UD_subplot.txt) and X and Y coordinates (files 00607_UD_xcoordinates.txt and 00607_UD_ycoordinates.txt).
The code to visualize the figure is the following:
A = load(‘00607_UD_subplot.txt’);
X = load(‘00607_UD_xcoordinates.txt’);
Y = load(‘00607_UD_ycoordinates.txt’);
surface(X, Y, A)
axis square
colormap(map);
caxis([5e-4 100])
set(gca,’colorscale’,’log’)
hold on
plot(X, sqrt((X.^2) – (1.47e-7*6.5*5.183^2)), ‘Color’,’white’,’LineStyle’,’–‘, ‘LineWidth’, 2)
xlabel(‘alpha_{i} [rad]’, ‘fontsize’, 18);
ylabel(‘alpha_{f} [rad]’, ‘fontsize’, 18);
cb1 = colorbar;
cb1.Label.String = ‘Neutron Intensity (CTS/MIN)’;
cb1.FontSize = 16;
cb1.Label.FontSize = 20;
cb1.LineWidth = 1.5;
Any help / suggestion would be helpful and very welcomedl!!!
Cheers,
Jose. curve fitting, region of interest MATLAB Answers — New Questions