Answered
Where Can I find these signals in SIMULINK?
Simulink, Sources, Repeating Sequence, specify time as [0 1 3 4], output as [0 1 -1 0] Simulink, Sources, Repeating Sequence,...

8 years ago | 1

| accepted

Answered
How to fix error in Simulink "data read before being written to" ?
If you don't care that much, go to Model Configuration Parameters (Ctrl+E), Diagnostics, Stateflow, Read-before-write to output ...

8 years ago | 0

Answered
Time delay for variable
use the "Zero-order hold" block, specify 1 second as the sample time

8 years ago | 0

Answered
How to set Stateflow properties in Stateflow Model Explorer using matlab script?
See <https://www.mathworks.com/help/stateflow/api/creating-and-destroying-api-objects.html?searchHighlight=stateflow%2520api&s_t...

8 years ago | 0

| accepted

Answered
Simple Explaination of the Rate Limiter Block
Specifing the slew rate as e.g. 5/(25*10e-9) and -5/(25*10e-9) should give you a Trapezoid form. Specify the fixed simulation st...

8 years ago | 0

| accepted

Answered
Can I call a function defined within another function .m file?
No. It is a local function. If it needs to be used outside, it has to be saved in a separate .m file. See <https://www.mathwo...

8 years ago | 0

Answered
Find the number of times a number is in an array for every column
Hope this give you a clue a=rand(3,9)-0.5; b=a<=0; c=sum(b)

8 years ago | 0

| accepted

Answered
How to convert ModelDataLogs to Structure
This might help. Assume your logged data is "logsout", run logsout.unpack('all') to unpack all the data and then do whatever ...

8 years ago | 1

| accepted

Answered
I cannot open the buck converter with thermal dynamics example file
It needs the "Simscape Electronics" toolbox. It seems that you don't have that toolbox. Click the link in that page for trial ve...

8 years ago | 0

| accepted

Answered
Using a 'for' Loop to Pass in Excel Files
No need to use fopen() and fclose() to read Excel file. Assume "excel_files" is a 1x11 cell, each contains an Excel file name...

8 years ago | 1

| accepted

Answered
Analyzing structures created from .log files
Hope you get an array of structures. Take a look at this example and read this Blog <https://blogs.mathworks.com/loren/2008/02/...

8 years ago | 0

Answered
Compare to constant block doesn't work.
What is the data type of "lamba5"? I assume it is double or single. This is a typical "floating point equal or unequal compariso...

8 years ago | 1

| accepted

Answered
Indexing of cell array containing class
I tried this. It looks better to construct an array of objects, not a cell array of objects. a=[timer,timer] a.Period ...

8 years ago | 0

| accepted

Answered
Reset a sine wave in Simulink
Use the "Fcn" block which you can specify "sin(u)" as the function. Use an "Integrator" block with the input as constant value o...

8 years ago | 0

Answered
Count number of elements in a matrix
arrayfun(@(x) nnz(B==x),A)

8 years ago | 1

Answered
How to use Arrayfun passing a random function as its arguments?
f=@sin; R1=arrayfun(f,x1);

8 years ago | 0

| accepted

Answered
How to create a matrix whose elements are function of their indices?
I am not aware of such a built-in function in MATLAB without any special toolbox. A typical approach is to pre-allocate and then...

8 years ago | 0

Answered
can some one help me for this question?
"Embedded Coder" is not a Simulink library. It is a separate toolbox. Go to Mathworks website, Products, look for "Embedded Code...

8 years ago | 0

Answered
An array for multiple LHS assignment cannot contain expressions
Remove the white space in "index (i)" [~, index(i)] = min (compare_onset(i), [], 2)

8 years ago | 1

| accepted

Answered
How do I create an empty cell array of given dimensions?
a=cell(1,2,3)

8 years ago | 6

| accepted

Answered
How do I copy a .csv file from any specified folder to the working directory where matlab is run from?
copyfile(source, destination) where source and destination can be full path of the file. pwd() will get you the current folde...

8 years ago | 0

| accepted

Answered
S-Function Backward Compatibility
I doubt it. Even if it can be used, you might get constant warning messages. The document says that all example S-function ME...

8 years ago | 1

| accepted

Answered
How to remove the values in vector 'B' corresponding to 'NaNs' in vector 'A'?
index=isnan(A) B(index) = [];

8 years ago | 2

| accepted

Answered
Diary file with current date and time as time stamp, Part 2
Include the full path when you specify the file, set(0,'DiaryFile',fullfile('c:',diary_filename)) or just use diary(f...

8 years ago | 0

| accepted

Answered
Editor and command windows next to each other, Part 2
You could select the already written comments, right click, and select "Wrap Comments", or Ctrl+J

8 years ago | 1

Answered
How to increment the specific command
A for-loop can be used, such as for lineNum=4:0.1:5 num2str(lineNum) end But the "lineNum" in Par.SigGen{lineNum}....

8 years ago | 0

Answered
How to input an argument in an Exit Shell command ?
try this system(['C:\Users\Philippe\Anaconda2\python.exe Test.py & ', ECG])

8 years ago | 0

| accepted

Answered
How to remove the error highlighting in Simulink?
Can you try this? select this block and then run this in Command window hilite_system(gcb,'none')

8 years ago | 0

Answered
Error using reshape To RESHAPE the number of elements must not change.
There is no error in your code. It should have no error if your put in all the d*k elements. There is no need to run reshape...

8 years ago | 0

Load more