Answered

How to plot one point in one axis

You should turn off the visibility of the vertical axis. For example: scatter (1,1); ax = gca; ax.YAxis.Visible = 'off'; xl...

How to plot one point in one axis

You should turn off the visibility of the vertical axis. For example: scatter (1,1); ax = gca; ax.YAxis.Visible = 'off'; xl...

3 months ago | 0

| accepted

Question

How to assign array values to object.object.property at once using deal?

I know that it is possible to assign the values of an array to object.property using deal(). Is it possible to do such thing for...

3 months ago | 1 answer | 0

Answered

How to import excel file only one sheet and skip first column?

You should use readmatrix(). For example: M = readmatrix (filename, 'Sheet', 'MySheet', 'Range','B2:Z10'); Readmatrix documen...

How to import excel file only one sheet and skip first column?

You should use readmatrix(). For example: M = readmatrix (filename, 'Sheet', 'MySheet', 'Range','B2:Z10'); Readmatrix documen...

3 months ago | 0

Answered

How to make a burst entity generation based on a event

You should use MATLAB Discrete-Event System block instead of an event-based Entity Generator.

How to make a burst entity generation based on a event

You should use MATLAB Discrete-Event System block instead of an event-based Entity Generator.

3 months ago | 0

Answered

Do Simevents Entity Servers release entities in a FIFO manner?

Generally, the server starts to serve an entity as soon as the entity enters the block. The server tries to forward the entity a...

Do Simevents Entity Servers release entities in a FIFO manner?

Generally, the server starts to serve an entity as soon as the entity enters the block. The server tries to forward the entity a...

3 months ago | 1

| accepted

Answered

scaling and change the ylim for subplot

You should set ylim() for each axes separately. For example: x = linspace (0, 6, 51)'; y1 = sin (x); y2 = cos (x); yyaxis...

scaling and change the ylim for subplot

You should set ylim() for each axes separately. For example: x = linspace (0, 6, 51)'; y1 = sin (x); y2 = cos (x); yyaxis...

3 months ago | 0

| accepted

Answered

export variable in word

You can export matrixes to word using Report generator. The general workflow is that you first create a report template that det...

export variable in word

You can export matrixes to word using Report generator. The general workflow is that you first create a report template that det...

3 months ago | 0

Answered

Adding up the block statistics for two adjacent blocks in Simevents

If I have understood you correctly, you want to calculate the system's WIP (Work In Progress). You can use the Add block to sum ...

Adding up the block statistics for two adjacent blocks in Simevents

If I have understood you correctly, you want to calculate the system's WIP (Work In Progress). You can use the Add block to sum ...

3 months ago | 0

Answered

Store generated Entity type in Workspace

You need a Simulink function, whose output port is connected to a "To workspace" block. Let's call this function RecordGeneratio...

Store generated Entity type in Workspace

You need a Simulink function, whose output port is connected to a "To workspace" block. Let's call this function RecordGeneratio...

3 months ago | 1

Answered

In a matrix column/array, how can I turn all numbers higher than a certain value into nans?

The best way is to use logical indexing. X(X>1) = NaN; Read this page, especially Indexing with Logical Values: https://www...

In a matrix column/array, how can I turn all numbers higher than a certain value into nans?

The best way is to use logical indexing. X(X>1) = NaN; Read this page, especially Indexing with Logical Values: https://www...

3 months ago | 0

| accepted

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...

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...

3 months 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...

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...

3 months 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(...

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(...

3 months 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...

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...

3 months 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...

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...

3 months 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);

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);

3 months 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...

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...

3 months 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...

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...

3 months 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])...

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])...

3 months 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...

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...

3 months 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...

3 months ago | 1 answer | 0

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...

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...

3 months 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...

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...

3 months 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...

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...

3 months 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...

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...

3 months 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...

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...

3 months 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...

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...

3 months 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', ...

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', ...

3 months 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().

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().

3 months 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...

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...

3 months ago | 1

| accepted