Answered
Using a "global" variable in Simevents
1) You can create it with set and get functions. They are nothing but two Simulink functions, where the output of the Set is con...

meer dan een jaar ago | 1

| accepted

Answered
Get the mean and standard deviation of the lower half of the first mode of a bimodal distribution
You can first determine the elements that are in the lower half LowerHalfMask = Data <= mean(Data); Then calculate the statis...

meer dan een jaar ago | 0

Answered
Quadprog solver not following constraints
Your bounds are the same for all of the variables, so they can be defined easier: lb = -5e4 * ones(1,2*iC); ub = 5e4 * ones(...

meer dan een jaar ago | 0

Answered
filling a 1D plot with colours associated to each sample value
You can use patch() and use your response values for both edges and the color data. You replace your data with SampleX and Sampl...

meer dan een jaar ago | 3

Answered
Why do i get "Index exceeds the number of array elements (2)". and how can i fix it? Please
You should first initialize the variable y. I also changed the definition order of the elements of y. I didn't understand why yo...

meer dan een jaar ago | 0

| accepted

Answered
Plot line with 2y against single x value
You can use the following command to reverse the order of the elements in the variable c: c = flip (c);

meer dan een jaar ago | 0

Answered
How to edit a variable in a structure and save the changes?
You should first load the variable, then write the new value, and then save it. For example, for changing the value of the varia...

meer dan een jaar ago | 1

Answered
How to use extrapolation to predict the future data
You should find a mathematical model a model to each of your lines using curve fitting toolbox. Type cftool in the command windo...

meer dan een jaar ago | 0

| accepted

Answered
How do I make a boxplot with a few groups?
You can add some columns of NaN. a = rand(10,2); b = rand(10,2); c = nan(10,2); boxplot([a,c,b]); xticks ([1,2,5,6])...

meer dan een jaar ago | 0

Answered
Simulation traffic in a ferry terminal
I think you need discrete-event simulation. Check Simulink's dedicated library for DES, called SimEvents. mathworks.com/produc...

meer dan een jaar ago | 1

Question


How to avoid repmat in problem-based optimization?
I am using the problem-based workflow of the Optimization toolbox for solving a MILP problem. Variables x's size is 1xn. x = o...

meer dan een jaar ago | 1 answer | 0

1

answer

Answered
Can I generate a variable function for varying amounts of variables?
In order to achieve scalability in optimization problems or elsewhere, you should use write a general equation for your equation...

meer dan een jaar ago | 0

Answered
How to operate a function on matrix
Assuming this is your homework assignment, I can only give you the clue that you can use logical indexing. https://www.mathwor...

meer dan een jaar ago | 0

Answered
Plotting multiple 2D line plots from a 3D matrix
In order to use plot() efficiently, you should prepare the data to call it just one time. plot() treats each column of 2D arrays...

meer dan een jaar ago | 1

| accepted

Answered
Producing a distribution for categorical data
You can find all of the files in the video at the end of the discription, including mpgdistribution(). It basically contains cod...

meer dan een jaar ago | 1

| accepted

Answered
Options when drawing using the Curve Fitting tool
Your datapoints seem to have a polynomial relationship, not logarithmic. I think your should change your model. In addition, vis...

meer dan een jaar ago | 0

| accepted

Answered
Create a new equation from a model in order to nonlinear, polynomial multiple regression, etc. for multiple many (4 or above) variables
Your have a linear relationship and the best option for you is the multiple linear regression. See the documentation of the regr...

meer dan een jaar ago | 0

Answered
Writematrix command not writing data in my excel sheet
You should pass sheet name and range as a Name-Value pair argument: writematrix (ltp_full, filename, 'Sheet', sname, 'Range', ...

meer dan een jaar ago | 1

Answered
How to draw vertical and horizontal line at the center of the screen in matlab?
If you want to draw vertical or horizontal line in a figure, you can use xline() and yline().

meer dan een jaar ago | 0

Answered
How to check whether the distribution of my data is a right/left skewed normal distribution using kolmogorov-smirnov test?
If your data points were positive, they would look like Gamma or Chi-square distribution. Type distributionFitter in the command...

meer dan een jaar ago | 1

| accepted

Answered
How to plot a histogram in a waterfall plot?
I think there is no function to draw this in one command. However, it can be drawn using patch() and plot3(). Use the following ...

meer dan een jaar ago | 1

Answered
GA codes for linear regression equation
Although ga() can fit multiple linear regression models, it is recommended to use regress() since it is dedicated to linear regr...

meer dan een jaar ago | 0

| accepted

Answered
Simulink Model of Task Scheduling in Multicore CPU
Check this example from SimEvents: https://www.mathworks.com/help/simevents/examples/develop-custom-scheduler-of-a-multicore-c...

meer dan een jaar ago | 0

| accepted

Answered
I want to do a nonlinear regression analysis with MATLAB.
If you have up to 2 independent variables, you can use curve fitting app (cftool). If you have 3 or more independent variables, ...

meer dan een jaar ago | 0

Answered
how can i do Factor analysis with 2 matrix
factoran function implements Factor Analysis (FA) in MATLAB. FA is a dimension reduction technique. It is not designed to find t...

meer dan een jaar ago | 0

Answered
boxplot of matrix with different size
A = rand (9,16); B = rand (13,17); [ADim1,ADim2] = size (A); [BDim1,BDim2] = size (B); GroupingA = strcat ("A", string(r...

meer dan een jaar ago | 0

Answered
Change colours of specific points in a scatter plot that has already been plotted?
Take a look at gscatter().

meer dan een jaar ago | 0

| accepted

Answered
boxplot of matrix with different size
You want one plot for A and one plot for B, or you want plot for every column in A and B?

meer dan een jaar ago | 0

Answered
Multiple histograms and what will be the best way to put mean and std of data into a plot?
You can use text function to add annotations anywhere on the plots. By the way, If A, B, and C are column vectors, it is wiser t...

meer dan een jaar ago | 0

Answered
How to create contour plot within a 2D plot
When you want to draw multiple plots within one axes, you should put all of the commands between hold on and hold off. hold on ...

meer dan een jaar ago | 0

Load more