Answered
Data type mismatch error in Simulink
The easiest solution is to add a Data Type Conversion block. The proper solution is to set the proper data type at the relevant...

4 years ago | 0

Answered
Similar lines are much different in time for run due to MATLAB profiler.
It takes time to create "Comp" as a structure. Add the line below first and then profile again. Comp=struct;

4 years ago | 0

Answered
Is it possible to save the output of a command as a variable?
VarName='Test1'; assignin('base',VarName,table)

4 years ago | 1

| accepted

Answered
Data type Double/Boolean error type Matlab/Simulink
Use "Data Type Conversion" block

4 years ago | 0

Answered
Use of Variables in Simulink Matlab Function
In MATLAB Function block Editor, click "Data", define "h" as a parameter.

4 years ago | 1

Answered
how to create cell array using matrix data?
I think you want to convert 4x5x3 matrix data into 4x5 cell, each cell is a 1x3 matrix data. There is a way to do it but I doubl...

4 years ago | 1

Answered
How can I make subscript in SIMULINK block name?
Block name is used to ID the block, so don't use special characters or formating. Use annotations. Double click on the canvas, ...

4 years ago | 1

| accepted

Answered
Run a Simulink model, pause it, change some parameters and resume the simulation
For any of these properties, press Ctrl+E to open the Configuration Parameters dialog window, find the property, such as 'Save F...

4 years ago | 0

| accepted

Answered
How can I demux a "From workspace" vector or array into individual constant blocks?
Don't use the "From Workspace" block. Just use the Constant block, specify the value as "a" and then Demux.

4 years ago | 0

| accepted

Answered
How do I multiply the first 50 values of an array?
A=1:100; A(1:5)=A(1:5)*3

4 years ago | 0

| accepted

Answered
How to extract a matrix from the indexing data
They can not be scaled to the same size as A. Maybe you are looking for the matrix "index" in the below example? see help of in...

4 years ago | 0

Answered
How to solve matrix raised to -1
A^(-1) inv(A)

4 years ago | 0

| accepted

Answered
How do I get time in input?????
t=now

4 years ago | 0

Answered
Multiply matrix column by an equation
A=[1:3;10:10:30]' A(:,1)=log(A(:,1)+1)

4 years ago | 0

| accepted

Answered
regexp function that checks if a specific letter is in the end of a cell (last character)
Don't even need regexp() metForm{i}(end)=='P'

4 years ago | 0

| accepted

Answered
Two matrices (n x 1) & (m x 1) : How to get an output matrix of size (n x m) containing pairs
I would not think you need to create such a matrix. That matrix simply duplicates lots of data. The truly useful and unique data...

4 years ago | 0

Answered
try to have simulink's stop time as a block
Use a Clock block, which outputs the simulation time/clock. Compare the Clock with your Constant block. Connect the output to a ...

4 years ago | 0

Answered
How to call Stateflow charts in a sequence
Use a Function-Call Generator block and a Function-Call Split block to sheduel the calling sequence.

4 years ago | 0

Answered
Simulink: How do you send a function call to another model?
In this case, double click the "In1" Inport block inside the referenced model, check the "Output function call" option under the...

4 years ago | 0

Answered
How format external data for an inport with enum data type defined in data dictionary in Simulink?
double click the Inport block, select the "Signal Attributes" tab, in "Data type', pick "Enum: <class name>" and specify your cl...

4 years ago | 0

Answered
Compile Parametrized Simulink model name
In this case, you might have to use eval() MyCommand=[modelname,'([],[],[],''compile'')']; eval(MyCommand);

4 years ago | 1

| accepted

Answered
how to set data store variable as block parameter variable?
Use a Math function block. y=sin(2*pi*Fr*t), specify Clock multiplied by Fr as input and perform sin() function on it.

4 years ago | 0

Answered
How to convert a char array field in a struct array to a string field in a vectorized fashion.
It can be done but not sure if it is more efficient than the simple for-loop myArray=struct('code',{'a','ab','abc'}) myString=...

4 years ago | 0

Answered
Error when loading external input data into root-level Inport
Simulink model simulation has a "time" element. The true meaning of your data is that you want to input 2 scalar data. The numbe...

4 years ago | 0

| accepted

Answered
Matlab R2021b not generating output from Simulink
Assume "simout" is the name used in the "To Workspace" block, the saving format "Array" need to be set at the "To Workspace" blo...

4 years ago | 0

Answered
Error in port widths or dimensions. 'Output Port 1' and Error in port widths or dimensions. Invalid dimension has been specified for 'Input Port 5'
Clicking the link in the error message would lead to the block in the Simulink model. Double click the two port blocks to check ...

4 years ago | 0

Answered
What can I do so that a "matlab function" block can read the variables defined in a .m file
In the MATLAB Function block editor, click "Edit data", add "Aq11" as a "parameter".

4 years ago | 0

Answered
Checking the exisiting of the Goto block with specified GotoTag
find_system('ModelName','BlockType','Goto','GotoTag','Out4')

4 years ago | 0

| accepted

Answered
How to add programmatically second input to Scope block in Simulink
specify 2 ports when you add the Scope block add_block('built-in/Scope','test/scope','NumInputPorts', '2');

4 years ago | 1

Load more