Category: Matlab
Category Archives: Matlab
Simulink Requirement Editor: Indentation of Requirements upon importing them from Excel
I want to import Requirements from an Excel File in the Requirements Editor of Simulink (2018a). I would like to be able to "group", or unfold/collapse requirements according to their topic, as it is shown in the example "Migrating Requirements Management Interface Data to Simulink® Requirements™" (https://ch.mathworks.com/help/slrequirements/examples/_mw_f304f626-0b76-4fbf-a313-1ab233014a0b.html) when requirements are imported from a word file (where apparently Bookmarks are recognized for that).
Is there a way to import requirements from excel, in order to have them in a collapsible structure in the Requirement editor? I have tried the REGEX way where I specified a regex expression for the unique Req IDs (IDs are recognized correctly, i.e. they turn red in the newly opened excel file that appears when pressing "Preview", and after the last item in a line there’s a green item added, which I assume is a line termination item), but the mechanics behind when a new collapsible item is created is a bit shady to me.
Are named Excel cells the way to go? If yes, what’s the strategy?
Thanks for your help!
StefanI want to import Requirements from an Excel File in the Requirements Editor of Simulink (2018a). I would like to be able to "group", or unfold/collapse requirements according to their topic, as it is shown in the example "Migrating Requirements Management Interface Data to Simulink® Requirements™" (https://ch.mathworks.com/help/slrequirements/examples/_mw_f304f626-0b76-4fbf-a313-1ab233014a0b.html) when requirements are imported from a word file (where apparently Bookmarks are recognized for that).
Is there a way to import requirements from excel, in order to have them in a collapsible structure in the Requirement editor? I have tried the REGEX way where I specified a regex expression for the unique Req IDs (IDs are recognized correctly, i.e. they turn red in the newly opened excel file that appears when pressing "Preview", and after the last item in a line there’s a green item added, which I assume is a line termination item), but the mechanics behind when a new collapsible item is created is a bit shady to me.
Are named Excel cells the way to go? If yes, what’s the strategy?
Thanks for your help!
Stefan I want to import Requirements from an Excel File in the Requirements Editor of Simulink (2018a). I would like to be able to "group", or unfold/collapse requirements according to their topic, as it is shown in the example "Migrating Requirements Management Interface Data to Simulink® Requirements™" (https://ch.mathworks.com/help/slrequirements/examples/_mw_f304f626-0b76-4fbf-a313-1ab233014a0b.html) when requirements are imported from a word file (where apparently Bookmarks are recognized for that).
Is there a way to import requirements from excel, in order to have them in a collapsible structure in the Requirement editor? I have tried the REGEX way where I specified a regex expression for the unique Req IDs (IDs are recognized correctly, i.e. they turn red in the newly opened excel file that appears when pressing "Preview", and after the last item in a line there’s a green item added, which I assume is a line termination item), but the mechanics behind when a new collapsible item is created is a bit shady to me.
Are named Excel cells the way to go? If yes, what’s the strategy?
Thanks for your help!
Stefan requiremens editor, simulink, import excel requirements, 2018a, regex MATLAB Answers — New Questions
What are the payment options for Training Classes?
What are the payment options for Training Classes?What are the payment options for Training Classes? What are the payment options for Training Classes? training, payment MATLAB Answers — New Questions
Can I get user email addresses from license server checkout/checkin log?
Hello,
I would like to find a way to get the email address of users of the MATLAB client software whenever they checkout/checkin a software license. Looking at the current software license log for FlexLM, I only see the system name registered for checkout/checkin events. Can you please tell me if there is a way to also include the user’s email address in the log?
Thank you,
-brianHello,
I would like to find a way to get the email address of users of the MATLAB client software whenever they checkout/checkin a software license. Looking at the current software license log for FlexLM, I only see the system name registered for checkout/checkin events. Can you please tell me if there is a way to also include the user’s email address in the log?
Thank you,
-brian Hello,
I would like to find a way to get the email address of users of the MATLAB client software whenever they checkout/checkin a software license. Looking at the current software license log for FlexLM, I only see the system name registered for checkout/checkin events. Can you please tell me if there is a way to also include the user’s email address in the log?
Thank you,
-brian license, checkout, user email MATLAB Answers — New Questions
Still waiting for my order to be processed
Dear sirs,
i am still waiting for my order to be processed. I am frankly quite disapointed that it has not been processed. I decided to join you after some investigation. Please help expedite my order and send me details.
Best regards
Pálmi Ragnar PéturssonDear sirs,
i am still waiting for my order to be processed. I am frankly quite disapointed that it has not been processed. I decided to join you after some investigation. Please help expedite my order and send me details.
Best regards
Pálmi Ragnar Pétursson Dear sirs,
i am still waiting for my order to be processed. I am frankly quite disapointed that it has not been processed. I decided to join you after some investigation. Please help expedite my order and send me details.
Best regards
Pálmi Ragnar Pétursson thingspeak MATLAB Answers — New Questions
Training a TCN model to predict a Continuous Variable
Hello there, I am trying to build a TCN model to predict a continuous variable. Similar the the example here: https://www.mathworks.com/help/deeplearning/ug/sequence-to-sequence-classification-using-1-d-convolutions.html#SeqToSeqClassificationUsing1DConvAndModelFunctionExample-11. I have time series data in which I am using 3 input features (accelrometer measuments in x,y,z directions), but instead of classifying an acitivity, I am trying to estimate/predict a continuous variable. My predictors/input features are stored in a 10×1 cell array name "IMUdata" (each cell is one of the 10 trials) with each cell containing a 540×3 double with the acclerometer data from that trial. The target continous varable I am trying to predict is simialrly stored in a 10×1 cell array with each cell contaning a 540×1 double named "Predvar". The code I have been trying so far is:
numfeatures = 3;
numFilters = 64;
filterSize = 5;
droupoutFactor = 0.005;
numBlocks = 4;
net = dlnetwork;
layer = sequenceInputLayer(numFeatures,Normalization="rescale-symmetric",Name="input");
net = addLayers(net,layer);
outputName = layer.Name;
for i = 1:numBlocks
dilationFactor = 2^(i-1);
layers = [
convolution1dLayer(filterSize,numFilters,DilationFactor=dilationFactor,Padding="causal",Name="conv1_"+i)
layerNormalizationLayer
spatialDropoutLayer(Name= "spat_drop_"+i,Probability=droupoutFactor)
convolution1dLayer(filterSize,numFilters,DilationFactor=dilationFactor,Padding="causal")
layerNormalizationLayer
reluLayer
spatialDropoutLayer(Name="spat_drop2_"+i,Probability=droupoutFactor)
additionLayer(2,Name="add_"+i)];
% Add and connect layers.
net = addLayers(net,layers);
net = connectLayers(net,outputName,"conv1_"+i);
% Skip connection.
if i == 1
% Include convolution in first skip connection.
layer = convolution1dLayer(1,numFilters,Name="convSkip");
net = addLayers(net,layer);
net = connectLayers(net,outputName,"convSkip");
net = connectLayers(net,"convSkip","add_" + i + "/in2");
else
net = connectLayers(net,outputName,"add_" + i + "/in2");
end
% Update layer output name.
outputName = "add_" + i;
end
layers = [
fullyConnectedLayer(1)];
net = addLayers(net,layers);
net = connectLayers(net,outputName,"fc");
options = trainingOptions("adam", …
MaxEpochs=60, …
miniBatchSize=1, …
InputDataFormats="CTB", …
Plots="training-progress", …
Metrics="rmse", …
Verbose=0);
net = trainnet(IMUdata,Predvar,net,"mse",options)
However I am getiting an ERROR with the trainnet function saying that: Error setting data statistics of layer "input".nnet.cnn.layer.SequenceInputLayer>iAssertValidStatistics (line 341)Expected input to be of size 3×1, but it is of size 541×1.
Is this because of the way my input data is stored? Im not sure how to fix this error and if this is the correct way to build a TCN model to predict a continuous variable? Any help is greatly appreciated!Hello there, I am trying to build a TCN model to predict a continuous variable. Similar the the example here: https://www.mathworks.com/help/deeplearning/ug/sequence-to-sequence-classification-using-1-d-convolutions.html#SeqToSeqClassificationUsing1DConvAndModelFunctionExample-11. I have time series data in which I am using 3 input features (accelrometer measuments in x,y,z directions), but instead of classifying an acitivity, I am trying to estimate/predict a continuous variable. My predictors/input features are stored in a 10×1 cell array name "IMUdata" (each cell is one of the 10 trials) with each cell containing a 540×3 double with the acclerometer data from that trial. The target continous varable I am trying to predict is simialrly stored in a 10×1 cell array with each cell contaning a 540×1 double named "Predvar". The code I have been trying so far is:
numfeatures = 3;
numFilters = 64;
filterSize = 5;
droupoutFactor = 0.005;
numBlocks = 4;
net = dlnetwork;
layer = sequenceInputLayer(numFeatures,Normalization="rescale-symmetric",Name="input");
net = addLayers(net,layer);
outputName = layer.Name;
for i = 1:numBlocks
dilationFactor = 2^(i-1);
layers = [
convolution1dLayer(filterSize,numFilters,DilationFactor=dilationFactor,Padding="causal",Name="conv1_"+i)
layerNormalizationLayer
spatialDropoutLayer(Name= "spat_drop_"+i,Probability=droupoutFactor)
convolution1dLayer(filterSize,numFilters,DilationFactor=dilationFactor,Padding="causal")
layerNormalizationLayer
reluLayer
spatialDropoutLayer(Name="spat_drop2_"+i,Probability=droupoutFactor)
additionLayer(2,Name="add_"+i)];
% Add and connect layers.
net = addLayers(net,layers);
net = connectLayers(net,outputName,"conv1_"+i);
% Skip connection.
if i == 1
% Include convolution in first skip connection.
layer = convolution1dLayer(1,numFilters,Name="convSkip");
net = addLayers(net,layer);
net = connectLayers(net,outputName,"convSkip");
net = connectLayers(net,"convSkip","add_" + i + "/in2");
else
net = connectLayers(net,outputName,"add_" + i + "/in2");
end
% Update layer output name.
outputName = "add_" + i;
end
layers = [
fullyConnectedLayer(1)];
net = addLayers(net,layers);
net = connectLayers(net,outputName,"fc");
options = trainingOptions("adam", …
MaxEpochs=60, …
miniBatchSize=1, …
InputDataFormats="CTB", …
Plots="training-progress", …
Metrics="rmse", …
Verbose=0);
net = trainnet(IMUdata,Predvar,net,"mse",options)
However I am getiting an ERROR with the trainnet function saying that: Error setting data statistics of layer "input".nnet.cnn.layer.SequenceInputLayer>iAssertValidStatistics (line 341)Expected input to be of size 3×1, but it is of size 541×1.
Is this because of the way my input data is stored? Im not sure how to fix this error and if this is the correct way to build a TCN model to predict a continuous variable? Any help is greatly appreciated! Hello there, I am trying to build a TCN model to predict a continuous variable. Similar the the example here: https://www.mathworks.com/help/deeplearning/ug/sequence-to-sequence-classification-using-1-d-convolutions.html#SeqToSeqClassificationUsing1DConvAndModelFunctionExample-11. I have time series data in which I am using 3 input features (accelrometer measuments in x,y,z directions), but instead of classifying an acitivity, I am trying to estimate/predict a continuous variable. My predictors/input features are stored in a 10×1 cell array name "IMUdata" (each cell is one of the 10 trials) with each cell containing a 540×3 double with the acclerometer data from that trial. The target continous varable I am trying to predict is simialrly stored in a 10×1 cell array with each cell contaning a 540×1 double named "Predvar". The code I have been trying so far is:
numfeatures = 3;
numFilters = 64;
filterSize = 5;
droupoutFactor = 0.005;
numBlocks = 4;
net = dlnetwork;
layer = sequenceInputLayer(numFeatures,Normalization="rescale-symmetric",Name="input");
net = addLayers(net,layer);
outputName = layer.Name;
for i = 1:numBlocks
dilationFactor = 2^(i-1);
layers = [
convolution1dLayer(filterSize,numFilters,DilationFactor=dilationFactor,Padding="causal",Name="conv1_"+i)
layerNormalizationLayer
spatialDropoutLayer(Name= "spat_drop_"+i,Probability=droupoutFactor)
convolution1dLayer(filterSize,numFilters,DilationFactor=dilationFactor,Padding="causal")
layerNormalizationLayer
reluLayer
spatialDropoutLayer(Name="spat_drop2_"+i,Probability=droupoutFactor)
additionLayer(2,Name="add_"+i)];
% Add and connect layers.
net = addLayers(net,layers);
net = connectLayers(net,outputName,"conv1_"+i);
% Skip connection.
if i == 1
% Include convolution in first skip connection.
layer = convolution1dLayer(1,numFilters,Name="convSkip");
net = addLayers(net,layer);
net = connectLayers(net,outputName,"convSkip");
net = connectLayers(net,"convSkip","add_" + i + "/in2");
else
net = connectLayers(net,outputName,"add_" + i + "/in2");
end
% Update layer output name.
outputName = "add_" + i;
end
layers = [
fullyConnectedLayer(1)];
net = addLayers(net,layers);
net = connectLayers(net,outputName,"fc");
options = trainingOptions("adam", …
MaxEpochs=60, …
miniBatchSize=1, …
InputDataFormats="CTB", …
Plots="training-progress", …
Metrics="rmse", …
Verbose=0);
net = trainnet(IMUdata,Predvar,net,"mse",options)
However I am getiting an ERROR with the trainnet function saying that: Error setting data statistics of layer "input".nnet.cnn.layer.SequenceInputLayer>iAssertValidStatistics (line 341)Expected input to be of size 3×1, but it is of size 541×1.
Is this because of the way my input data is stored? Im not sure how to fix this error and if this is the correct way to build a TCN model to predict a continuous variable? Any help is greatly appreciated! tcn model, trainnet function, machine learning, neural networks MATLAB Answers — New Questions
Flipping Sign provide wrong information and Answers
Hi, I type my equation and the equation reversing and change the meaning of the equation.
can you assists me how to solve this? how to turn off the alphabetical orders settings?Hi, I type my equation and the equation reversing and change the meaning of the equation.
can you assists me how to solve this? how to turn off the alphabetical orders settings? Hi, I type my equation and the equation reversing and change the meaning of the equation.
can you assists me how to solve this? how to turn off the alphabetical orders settings? flipping sign, reversing equation MATLAB Answers — New Questions
Pressure interpolation CFD to FEA
Hello,
I have a 3D pressure distribution in the form of x,y,z and pressure coefficient at each node. I also have the FEA grid in the form of x,y,z of each node. I would like to interpolate the pressure from the CFD grid to the FEA grid. How do I do that please? ThanksHello,
I have a 3D pressure distribution in the form of x,y,z and pressure coefficient at each node. I also have the FEA grid in the form of x,y,z of each node. I would like to interpolate the pressure from the CFD grid to the FEA grid. How do I do that please? Thanks Hello,
I have a 3D pressure distribution in the form of x,y,z and pressure coefficient at each node. I also have the FEA grid in the form of x,y,z of each node. I would like to interpolate the pressure from the CFD grid to the FEA grid. How do I do that please? Thanks pressure interpolation MATLAB Answers — New Questions
lambda in fmincon Interior-Point Algorithm with Analytic Hessian
I am trying to use fmincon Interior-Point Algorithm with Analytic Hessian (https://www.mathworks.com/help/optim/ug/fmincon-interior-point-algorithm-with-analytic-hessian.html)
The examplay function is hessinterior which is Hessian of both c(1) and c(2).
My understanding is lambda is Lagrange Multiplier, which should be an output since it is the stationary points of the Lagrangian function. How come it is an input to the function hessinterior?
Thank you very much!I am trying to use fmincon Interior-Point Algorithm with Analytic Hessian (https://www.mathworks.com/help/optim/ug/fmincon-interior-point-algorithm-with-analytic-hessian.html)
The examplay function is hessinterior which is Hessian of both c(1) and c(2).
My understanding is lambda is Lagrange Multiplier, which should be an output since it is the stationary points of the Lagrangian function. How come it is an input to the function hessinterior?
Thank you very much! I am trying to use fmincon Interior-Point Algorithm with Analytic Hessian (https://www.mathworks.com/help/optim/ug/fmincon-interior-point-algorithm-with-analytic-hessian.html)
The examplay function is hessinterior which is Hessian of both c(1) and c(2).
My understanding is lambda is Lagrange Multiplier, which should be an output since it is the stationary points of the Lagrangian function. How come it is an input to the function hessinterior?
Thank you very much! fmincon, lambda MATLAB Answers — New Questions
How to add every nth element of an array to the nth+1 element?
I wonder if there is a short expression for the task above. For example if I had an array like this
a = [1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9]
How can I add, let’s say every 3rd element to every 4th element to get an array like this ?
a = [1, 2, 3+3, 4, 5+5, 6, 7+7, 8, 9]
I can do this with some ugle lines of code, but what if you got a more elegant way?I wonder if there is a short expression for the task above. For example if I had an array like this
a = [1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9]
How can I add, let’s say every 3rd element to every 4th element to get an array like this ?
a = [1, 2, 3+3, 4, 5+5, 6, 7+7, 8, 9]
I can do this with some ugle lines of code, but what if you got a more elegant way? I wonder if there is a short expression for the task above. For example if I had an array like this
a = [1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9]
How can I add, let’s say every 3rd element to every 4th element to get an array like this ?
a = [1, 2, 3+3, 4, 5+5, 6, 7+7, 8, 9]
I can do this with some ugle lines of code, but what if you got a more elegant way? arrays MATLAB Answers — New Questions
Why does the “interpolate” function have a large normalized volatility?
When using the "interpolate" function in the Financial Toolbox to simulate a Brown Bridge, the interpolated values have a much larger normalized volatility than the original time series. Ideally, the interpolated annualized daily return volatility should be similar to the original annual volatility. Why does the "interpolate" function have such a large normalized volatility?When using the "interpolate" function in the Financial Toolbox to simulate a Brown Bridge, the interpolated values have a much larger normalized volatility than the original time series. Ideally, the interpolated annualized daily return volatility should be similar to the original annual volatility. Why does the "interpolate" function have such a large normalized volatility? When using the "interpolate" function in the Financial Toolbox to simulate a Brown Bridge, the interpolated values have a much larger normalized volatility than the original time series. Ideally, the interpolated annualized daily return volatility should be similar to the original annual volatility. Why does the "interpolate" function have such a large normalized volatility? interpolate, "brown, bridge", volatility, brown, brownian, interpolation MATLAB Answers — New Questions
How to solve a fourth order differential equation (boundary value problem) with constraint?
Hi everyone,
I was trying to solve the following fourth order differential equation: A·x-B·x·w””(x)=w(x) where A and B are constants,and 0<x<l, and the boundary conditions are w(0) = 0, w”(l) = 0, w”'(l)=0, w””(0)=0. I solved the equation with bvp4c.
Now I want to add constratin to w””(x), i.e., 0<w””(x)<C, where C is a constant.
How can I add this constraint?
Thanks,
JZHi everyone,
I was trying to solve the following fourth order differential equation: A·x-B·x·w””(x)=w(x) where A and B are constants,and 0<x<l, and the boundary conditions are w(0) = 0, w”(l) = 0, w”'(l)=0, w””(0)=0. I solved the equation with bvp4c.
Now I want to add constratin to w””(x), i.e., 0<w””(x)<C, where C is a constant.
How can I add this constraint?
Thanks,
JZ Hi everyone,
I was trying to solve the following fourth order differential equation: A·x-B·x·w””(x)=w(x) where A and B are constants,and 0<x<l, and the boundary conditions are w(0) = 0, w”(l) = 0, w”'(l)=0, w””(0)=0. I solved the equation with bvp4c.
Now I want to add constratin to w””(x), i.e., 0<w””(x)<C, where C is a constant.
How can I add this constraint?
Thanks,
JZ differential equations MATLAB Answers — New Questions
How do I cross-compile for Linux on ARM using MATLAB Coder?
I have some MATLAB code that I would like to compile into a ".so" shared library with MATLAB Coder. MATLAB is running on my x86 Windows computer, but I would like the executable to run on an ARM board running Linux. How do generate and compile the code so it will run on the ARM board?I have some MATLAB code that I would like to compile into a ".so" shared library with MATLAB Coder. MATLAB is running on my x86 Windows computer, but I would like the executable to run on an ARM board running Linux. How do generate and compile the code so it will run on the ARM board? I have some MATLAB code that I would like to compile into a ".so" shared library with MATLAB Coder. MATLAB is running on my x86 Windows computer, but I would like the executable to run on an ARM board running Linux. How do generate and compile the code so it will run on the ARM board? matlab-coder, cross-compile, arm, linux, cmake MATLAB Answers — New Questions
What are the frequencies when N in fft(x,N) is odd?
I know when N is even, fft(x,N) corresponds to frequencies 0,df,…,N/2*df,-(N/2-2)*df,…,-df.
What about if N is odd?I know when N is even, fft(x,N) corresponds to frequencies 0,df,…,N/2*df,-(N/2-2)*df,…,-df.
What about if N is odd? I know when N is even, fft(x,N) corresponds to frequencies 0,df,…,N/2*df,-(N/2-2)*df,…,-df.
What about if N is odd? fft, frequency, spectrum MATLAB Answers — New Questions
Plot legend goes behing plot axes when using tiledlayout
I am generating several plots with legends on one figure using tiledlayout(). While the plot looks correct, the legends disappear behind the axes when I try to move them. The issue appears to be the same as described in this question, although I did not have any success with the fix:
Why does legend goes to the back of the axes box in multiplots if you click it or move it with the mouse?
The minimimum code that produces the issue is below. I get the same results when I omit the object handles.
t = tiledlayout(2, 1);
ax1 = nexttile(t);
pt1 = plot(ax1, 0:10, 0:10);
lg1 = legend(ax1, ‘Plot 1’);
ax2 = nexttile(t);
pt2 = plot(ax2, 0:10, 0:10);
lg2 = legend(ax2, ‘Plot 2’);I am generating several plots with legends on one figure using tiledlayout(). While the plot looks correct, the legends disappear behind the axes when I try to move them. The issue appears to be the same as described in this question, although I did not have any success with the fix:
Why does legend goes to the back of the axes box in multiplots if you click it or move it with the mouse?
The minimimum code that produces the issue is below. I get the same results when I omit the object handles.
t = tiledlayout(2, 1);
ax1 = nexttile(t);
pt1 = plot(ax1, 0:10, 0:10);
lg1 = legend(ax1, ‘Plot 1’);
ax2 = nexttile(t);
pt2 = plot(ax2, 0:10, 0:10);
lg2 = legend(ax2, ‘Plot 2’); I am generating several plots with legends on one figure using tiledlayout(). While the plot looks correct, the legends disappear behind the axes when I try to move them. The issue appears to be the same as described in this question, although I did not have any success with the fix:
Why does legend goes to the back of the axes box in multiplots if you click it or move it with the mouse?
The minimimum code that produces the issue is below. I get the same results when I omit the object handles.
t = tiledlayout(2, 1);
ax1 = nexttile(t);
pt1 = plot(ax1, 0:10, 0:10);
lg1 = legend(ax1, ‘Plot 1’);
ax2 = nexttile(t);
pt2 = plot(ax2, 0:10, 0:10);
lg2 = legend(ax2, ‘Plot 2’); plot, legend, tiledlayout, nexttile MATLAB Answers — New Questions
How do I extract Trajectory Data using NGSIM dataset?
It is required to extract trajectory data along with the frame number, vehicle ID, lane number, time, and position for the target vehicles in US-101 category of the Next Generation Simulation (NGSIM) dataset; however, after successfully reading the file with "data = readtable(‘pre-processing.csv’)", one proceeded to use "Features=[categorical(pre-processing.csv,trajectory)]", but was flagging an error, kindly help.It is required to extract trajectory data along with the frame number, vehicle ID, lane number, time, and position for the target vehicles in US-101 category of the Next Generation Simulation (NGSIM) dataset; however, after successfully reading the file with "data = readtable(‘pre-processing.csv’)", one proceeded to use "Features=[categorical(pre-processing.csv,trajectory)]", but was flagging an error, kindly help. It is required to extract trajectory data along with the frame number, vehicle ID, lane number, time, and position for the target vehicles in US-101 category of the Next Generation Simulation (NGSIM) dataset; however, after successfully reading the file with "data = readtable(‘pre-processing.csv’)", one proceeded to use "Features=[categorical(pre-processing.csv,trajectory)]", but was flagging an error, kindly help. matlab, ngsim, data, excel MATLAB Answers — New Questions
Portfolio optimization — estimateCustomObjectivePortfolio equivalent in R2021b?
Hello, Matlab community. I am working on a portfolio optimization exercise, and I’m looking for a way to incorporate a user-defined objective function in the usual Portfolio object workflow. The "estimateCustomObjectivePortfolio" function seems to be exactly what I need, but unfortunately it was introduced in R2022b. I am using a corporate R2021b Matlab license, so my IT department may not let me just upgrade to get the new functionality (I’m checking on that as well).
Assuming I have to live with R2021b for now, I’ll give you an example of what I’m trying to accomplish. Consider a fixed-income-only universe of asset classes, and durations for each:
– IG corporate duration = 7 years
– high yield corporate duration = 3 years
– treasury duration = 10 years
– etc.
In the portfolio optimization, I’d like to be able to have a stated duration target for the resulting portfolio. But, the duration of any hypothetical portfolio depends on the portfolio weights the optimizer is considering in any given iteration, and I don’t see a way (in my version of Matlab) to state that duration target as a constraint or objective.
Thanks in advance for any thoughts you may have.Hello, Matlab community. I am working on a portfolio optimization exercise, and I’m looking for a way to incorporate a user-defined objective function in the usual Portfolio object workflow. The "estimateCustomObjectivePortfolio" function seems to be exactly what I need, but unfortunately it was introduced in R2022b. I am using a corporate R2021b Matlab license, so my IT department may not let me just upgrade to get the new functionality (I’m checking on that as well).
Assuming I have to live with R2021b for now, I’ll give you an example of what I’m trying to accomplish. Consider a fixed-income-only universe of asset classes, and durations for each:
– IG corporate duration = 7 years
– high yield corporate duration = 3 years
– treasury duration = 10 years
– etc.
In the portfolio optimization, I’d like to be able to have a stated duration target for the resulting portfolio. But, the duration of any hypothetical portfolio depends on the portfolio weights the optimizer is considering in any given iteration, and I don’t see a way (in my version of Matlab) to state that duration target as a constraint or objective.
Thanks in advance for any thoughts you may have. Hello, Matlab community. I am working on a portfolio optimization exercise, and I’m looking for a way to incorporate a user-defined objective function in the usual Portfolio object workflow. The "estimateCustomObjectivePortfolio" function seems to be exactly what I need, but unfortunately it was introduced in R2022b. I am using a corporate R2021b Matlab license, so my IT department may not let me just upgrade to get the new functionality (I’m checking on that as well).
Assuming I have to live with R2021b for now, I’ll give you an example of what I’m trying to accomplish. Consider a fixed-income-only universe of asset classes, and durations for each:
– IG corporate duration = 7 years
– high yield corporate duration = 3 years
– treasury duration = 10 years
– etc.
In the portfolio optimization, I’d like to be able to have a stated duration target for the resulting portfolio. But, the duration of any hypothetical portfolio depends on the portfolio weights the optimizer is considering in any given iteration, and I don’t see a way (in my version of Matlab) to state that duration target as a constraint or objective.
Thanks in advance for any thoughts you may have. portfolio optimization, custom constraint MATLAB Answers — New Questions
Data normalization using robust scaling
Hello all, I am trying to implement "Robust Scaling" but I am confused. Should I use "all" parameter for "median" and "iqr" functions?
Thanks for the help.
DataSet = readtable(‘Datasets/Test.csv’);
DataSet = table2array(DataSet); % 7195 * 22
RScaling = (DataSet – median(DataSet))./iqr(DataSet)Hello all, I am trying to implement "Robust Scaling" but I am confused. Should I use "all" parameter for "median" and "iqr" functions?
Thanks for the help.
DataSet = readtable(‘Datasets/Test.csv’);
DataSet = table2array(DataSet); % 7195 * 22
RScaling = (DataSet – median(DataSet))./iqr(DataSet) Hello all, I am trying to implement "Robust Scaling" but I am confused. Should I use "all" parameter for "median" and "iqr" functions?
Thanks for the help.
DataSet = readtable(‘Datasets/Test.csv’);
DataSet = table2array(DataSet); % 7195 * 22
RScaling = (DataSet – median(DataSet))./iqr(DataSet) normalization MATLAB Answers — New Questions
MATLAB config file that loads variables at runtime
I would like to have a configuration file that acts similarly to a .config file that you would find in a C# program. Meaning I would like the variables in the config file to load into the application at runtime. I’m using the Application Compiler app to build the executable. I have tried having a text file with my config variables that is read at the beginning of the program, but it seems that these are only read when the application is compiled. I would like to compile/build the app only once, and have it read in the variables each time it runs. Is there a way for this to work within MATLAB?I would like to have a configuration file that acts similarly to a .config file that you would find in a C# program. Meaning I would like the variables in the config file to load into the application at runtime. I’m using the Application Compiler app to build the executable. I have tried having a text file with my config variables that is read at the beginning of the program, but it seems that these are only read when the application is compiled. I would like to compile/build the app only once, and have it read in the variables each time it runs. Is there a way for this to work within MATLAB? I would like to have a configuration file that acts similarly to a .config file that you would find in a C# program. Meaning I would like the variables in the config file to load into the application at runtime. I’m using the Application Compiler app to build the executable. I have tried having a text file with my config variables that is read at the beginning of the program, but it seems that these are only read when the application is compiled. I would like to compile/build the app only once, and have it read in the variables each time it runs. Is there a way for this to work within MATLAB? configuration, data import MATLAB Answers — New Questions
IR sensor and I2C display with Arduin uno
Hi,
I’m building my project with Arduino Uno and Matlab Simulink. In my project, I want the display to show the output on a 16×2 LCD and start counting milliseconds after the IR sensor detects the object. Also, I want the display to stop and keep the last second show up once the IR sensor detects the object again.Hi,
I’m building my project with Arduino Uno and Matlab Simulink. In my project, I want the display to show the output on a 16×2 LCD and start counting milliseconds after the IR sensor detects the object. Also, I want the display to stop and keep the last second show up once the IR sensor detects the object again. Hi,
I’m building my project with Arduino Uno and Matlab Simulink. In my project, I want the display to show the output on a 16×2 LCD and start counting milliseconds after the IR sensor detects the object. Also, I want the display to stop and keep the last second show up once the IR sensor detects the object again. simulink, project MATLAB Answers — New Questions
EPS Figure Not Saving As Vectorized Plot For Illustrator
I am trying to generate figures in matlab and save them as eps files to further edit them in adobe illustrator. When I open the eps plot in adobe illustrator it is not vectorized and is essentially just an image. Here is what it looks like in illustrator:I am trying to generate figures in matlab and save them as eps files to further edit them in adobe illustrator. When I open the eps plot in adobe illustrator it is not vectorized and is essentially just an image. Here is what it looks like in illustrator: I am trying to generate figures in matlab and save them as eps files to further edit them in adobe illustrator. When I open the eps plot in adobe illustrator it is not vectorized and is essentially just an image. Here is what it looks like in illustrator: eps, illustrator MATLAB Answers — New Questions