Answered

Hi everyone, How do I call functions in simevents for selected queues to halt entities blocking them from departing whenever entities with specific attributes are injected into the system (by a deliberate event).

I think you must implement this complex system with MATLAB Discrete-Event System (MDES) only, since you need to iterate over que...

Hi everyone, How do I call functions in simevents for selected queues to halt entities blocking them from departing whenever entities with specific attributes are injected into the system (by a deliberate event).

I think you must implement this complex system with MATLAB Discrete-Event System (MDES) only, since you need to iterate over que...

4 days ago | 0

Answered

How do you model transfer batching in simevents if you use orders as entities and order quantity as an attribute?

You should use an Entity replicator block, which replicates entities based on the order size. Replicas are production batches af...

How do you model transfer batching in simevents if you use orders as entities and order quantity as an attribute?

You should use an Entity replicator block, which replicates entities based on the order size. Replicas are production batches af...

5 days ago | 0

| accepted

Answered

How can I bring 5 variable at 5 different axis angles and plot the correlation coefficient with respect to a base variable.

MATLAB does not have built-in spider plot, AFAIK. The nearest built-in is polarhistogram(). https://www.mathworks.com/help/matl...

How can I bring 5 variable at 5 different axis angles and plot the correlation coefficient with respect to a base variable.

MATLAB does not have built-in spider plot, AFAIK. The nearest built-in is polarhistogram(). https://www.mathworks.com/help/matl...

11 days ago | 0

Answered

Plot of 4 variables with dates(years)

You should read the documentation of plot(): https://www.mathworks.com/help/matlab/ref/plot.html All you need is to define c...

Plot of 4 variables with dates(years)

You should read the documentation of plot(): https://www.mathworks.com/help/matlab/ref/plot.html All you need is to define c...

12 days ago | 0

| accepted

Question

Loading timeseries data into the deep network designer

I have read and learnt how to train a deep network for forecasting future values of a timeseries here: https://www.mathworks.c...

15 days ago | 0 answers | 0

Answered

Using for loop to extract data from a matrix

The break statement terminates the for loop: if j > numel(cavity) break end

Using for loop to extract data from a matrix

The break statement terminates the for loop: if j > numel(cavity) break end

19 days ago | 0

| accepted

Answered

PSO algorithm pv system code

You should formulate your problem based on the scientific literature. MATLAB has built-in PSO, but it only handles unconstrained...

PSO algorithm pv system code

You should formulate your problem based on the scientific literature. MATLAB has built-in PSO, but it only handles unconstrained...

20 days ago | 0

Answered

Calculate trends with regression for columns in MATLAB

You can use parfor (parallel for loop) instead of for. The more CPU cores you have, the more speed you gain. https://www.mathw...

Calculate trends with regression for columns in MATLAB

You can use parfor (parallel for loop) instead of for. The more CPU cores you have, the more speed you gain. https://www.mathw...

20 days ago | 0

| accepted

Answered

Creating a function with varying numbers of input parameters

You should use Variable-length input argument list using varargin(). https://www.mathworks.com/help/matlab/ref/varargin.html

Creating a function with varying numbers of input parameters

You should use Variable-length input argument list using varargin(). https://www.mathworks.com/help/matlab/ref/varargin.html

24 days ago | 1

| accepted

Answered

Why SimEvents spends so much time

You should run 1000 simulations using sim() in conjunction with SimulationInput objects. With SimulationInput you can define the...

Why SimEvents spends so much time

You should run 1000 simulations using sim() in conjunction with SimulationInput objects. With SimulationInput you can define the...

25 days ago | 0

Answered

link a custom creation function

1) "If you have a partial initial population, meaning fewer than PopulationSize rows, then the genetic algorithm calls CreationF...

link a custom creation function

1) "If you have a partial initial population, meaning fewer than PopulationSize rows, then the genetic algorithm calls CreationF...

28 days ago | 0

| accepted

Answered

What information is conveyed by the different colors in Matlab's contourf( ) data plots?

You can turn on the ShowText property of the contour, or add the color bar: x = linspace (-5, 5, 51); y = linspace (-5, 5, 51...

What information is conveyed by the different colors in Matlab's contourf( ) data plots?

You can turn on the ShowText property of the contour, or add the color bar: x = linspace (-5, 5, 51); y = linspace (-5, 5, 51...

28 days ago | 0

| accepted

Answered

MATLAB function block error in Simulink

Unlike m-file functions, MATLAB function block does not apply automatic array expansion. The simplest way to overcome is to defi...

MATLAB function block error in Simulink

Unlike m-file functions, MATLAB function block does not apply automatic array expansion. The simplest way to overcome is to defi...

29 days ago | 0

| accepted

Answered

Run a Simulink modell stepwise inside Matlab

You can use MATLAB function block. It is executed on every timestep just like other blocks, and you can return outputs for every...

Run a Simulink modell stepwise inside Matlab

You can use MATLAB function block. It is executed on every timestep just like other blocks, and you can return outputs for every...

29 days ago | 0

Answered

Create 9x9 matrix with RANDI between [0,2] with each 0,1, and 2 repeating three times each per column.

You can first create a vector with the values you need: Reference = repelem (0:2,3)'; Then you initialize the 9x9 matrix with...

Create 9x9 matrix with RANDI between [0,2] with each 0,1, and 2 repeating three times each per column.

You can first create a vector with the values you need: Reference = repelem (0:2,3)'; Then you initialize the 9x9 matrix with...

29 days ago | 1

| accepted

Answered

How can I display the last value obtained in a scope block graph in Simulink?

The Display block shows the numeric output. https://www.mathworks.com/help/simulink/slref/display.html

How can I display the last value obtained in a scope block graph in Simulink?

The Display block shows the numeric output. https://www.mathworks.com/help/simulink/slref/display.html

29 days ago | 0

Answered

Can I use my own timetraces in M/M/1 queue implementation by Simevents?

I think you need a simple M/M/c queue. The example you are trying has components for other purposes, which might have confused y...

Can I use my own timetraces in M/M/1 queue implementation by Simevents?

I think you need a simple M/M/c queue. The example you are trying has components for other purposes, which might have confused y...

30 days ago | 0

| accepted

Answered

What am I doing wrong?

For drawing multiple line plots at once, you should have one column vector for each line. You just need to have x as a column ve...

What am I doing wrong?

For drawing multiple line plots at once, you should have one column vector for each line. You just need to have x as a column ve...

1 month ago | 2

Answered

How to use the Parallel Computing Toolbox of MATLAB to optimize the parameters of a Simulink model with genetic algorithm?

You should set ga() to pass all of the generation members at once using UseVectorized option. Then you set the objective functio...

How to use the Parallel Computing Toolbox of MATLAB to optimize the parameters of a Simulink model with genetic algorithm?

You should set ga() to pass all of the generation members at once using UseVectorized option. Then you set the objective functio...

1 month ago | 0

Answered

How to solve this problem? Error using == Quadratic constraints not supported

QP = Quadradic Programming = Quadradic objective function and linear constraints. QCQP = Quadratically Constrained Quadratic P...

How to solve this problem? Error using == Quadratic constraints not supported

QP = Quadradic Programming = Quadradic objective function and linear constraints. QCQP = Quadratically Constrained Quadratic P...

1 month ago | 2

| accepted

Answered

Small Value bars are missing in bar graph.

You can add a constant to the bars with small values. For example: X (X<4) = X (X<4) + 0.2;

Small Value bars are missing in bar graph.

You can add a constant to the bars with small values. For example: X (X<4) = X (X<4) + 0.2;

1 month ago | 0

Question

parsim() with fast restart returns different results

I am running multiple simulations using parsim() with fast restart to accelerate execution. However, I have noticed that using p...

1 month ago | 1 answer | 0

Answered

How do you use the NaN function?

You first create the NaN vector using nan(), then fill in the elements. V = nan (500,1); V (124:end) = Data;

How do you use the NaN function?

You first create the NaN vector using nan(), then fill in the elements. V = nan (500,1); V (124:end) = Data;

1 month ago | 0

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

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

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

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

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

2 months ago | 0

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

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

2 months ago | 0