Answered
How I can Change the input and output data type of matlab function block? I want to change it to Matrix. Plz help me I am using matlab 2016a.
Press Ctrl+H at your model to open the Model Explorer, on the left, find and select the MATLAB Function block, on the right, you...

7 years ago | 0

Answered
Simulink Settings for Blocks
One way I can think of (or actually I am doing it in this way) is that you modify the built-in Simulink library to reflect these...

7 years ago | 0

Answered
Using Regex to get strings with whitespace within them.
white space in regular expression is \s

7 years ago | 0

Answered
Creating text file with columns of data
In this case, you can use fprintf(fileID,'%f %f\n',data')

7 years ago | 1

Answered
How do i plot data from a structure? and extract data from a structure?
[SpeedA.distanceA_km, SpeedA.SpeedA_kmph]

7 years ago | 0

| accepted

Answered
How can I read Simulink comments (annotations) from the Matlab command window?
What do you really mean by "read"? vdp; a=find_system('vdp','FindAll','On','type','annotation'); b=get(a,'Name') celldisp(...

7 years ago | 1

Answered
How To Use Workspace Parameters in Simulink
You already did! In the most common case, you define a variable "k" in base workspace (you refer as editor workspace), specify t...

7 years ago | 1

Answered
Obtaining signal units post compilation
CompiledPortUnits But according to R2018b document, Simulink passes units through the following blocks that do not change dat...

7 years ago | 1

| accepted

Answered
Plotting customized figures using Simulink
Open the model, click menu File, Model Properties, Model Properties Click the Callbacks tab, Select "StopFcn*" on the left, you...

7 years ago | 0

| accepted

Answered
How to set fixed values to Simulink parameters instead of variable?
Not following your point. If you want the gain to be a, put in a. If you want the gain to be 2, put in 2. You can add 'a' to th...

7 years ago | 1

| accepted

Answered
AUTOSAR support package free of charge?
Yes. Install AUTOSAR support package

7 years ago | 1

| accepted

Answered
How to get a csv file excluding first row and last column to run through if statement?
Let's fix the biggest issue first. Should be numrows = size(data,1); thisrow = data(rownum,:);

7 years ago | 0

Answered
Reading data from excel
I would suggest reading the whole Excel sheet and then process the data in MATLAB according to your logic. xlsread() is more tim...

7 years ago | 0

Answered
getting the mean EXCEPT zero entries
M=zeros(5); M(randi(25,10,1))=1:10; M(M==0)=nan; mean(M,'omitnan')

7 years ago | 1

Answered
How to round a large array to the nearest factor of 0.0064
x-rem(x,0.0064) It is the floor() effect. If you want "round" effect, you might need a few lines more. This example assume...

7 years ago | 0

Answered
How to build a graph from two graphs at certain intervals
From the diagram, it seems that it can be achieved by using a Switch block. Compare y1 with zero using a Relational Operator blo...

7 years ago | 0

Answered
bdroot causes problems in MATLAB 2017b
Something may have changed from R2015b to R2017b but I would say that your usage of bdroot() for this purpose is not robust. "Si...

7 years ago | 0

| accepted

Answered
Simulink buffer: How do I fix the error "All sample times must be discrete. No continuous or constant sample times are allowed."
Try feeding the Buffer block with a Constant block. Changing the sample time of the Constant block from "inf" to 0.1 (for exampl...

7 years ago | 1

| accepted

Answered
How to access Data dictionary data in matlab function block simulink
Add a "data" to the MATLAB Function block and specify its scope as "Parameter" (rather than input or output). Have "data" define...

7 years ago | 2

Answered
Providing Maximum Value as Initial Value for Single Precision Signal Causes Error due to Quantization
I had similar issues with this. I have requested the Mathworks to do an enhancement but have not seen it in place yet. The p...

7 years ago | 0

| accepted

Answered
how do i create an array of e^x
try exp(x)

7 years ago | 0

Answered
MATLAB App Designer <--> Simulink
Use the build-in model 'f14' as an example, if you drag in a Knob block and connect it to the Gain block Zw, the changing of the...

7 years ago | 1

| accepted

Answered
Reference model vs subsystem
The official document is here. It gives comparison between Subsystems, libraries and model referencing. It also provided some Ge...

7 years ago | 1

Answered
Gathering data from a for loop
something like this: t=0:1200:43200; M=zeros(size(t)); for k=1:numel(t) M(k)=M0 + nn*t(k); end plot(t,M)...

8 years ago | 0

Answered
How to split binary and convert to decimal ?
aaa = ['0000001101001011';'0000011010001010';'0000100100111100']; bbb=[aaa(:,1:8); aaa(:,9:16)]; bbb=reshape(bin2dec(bbb...

8 years ago | 0

| accepted

Answered
Setting Simulink parameter values from script
4. Why has it stopped running properly just because I moved my code into the gui script? When you run "t_step = Simulink.Para...

8 years ago | 0

| accepted

Answered
Access to memory store via global in matlab function
I think the warning message is clear. If you want to ignore this, go to Simulation, Model Configuration Parameters, Diagnostics,...

8 years ago | 0

Answered
Is there a way to index a variable to a certain position in the array
Depending on the value of n, you want to loop through the different dimension of matrix. I think you can utilize the function...

8 years ago | 2

| accepted

Answered
switch in a loop while changing variable name according to iter index
construct your data as 60xn matrix Data(1,:)=[mean_RSI_high,mean_RSI_low,mean_NeNMF_high,mean_NeNMF_low]; ... Data(60...

8 years ago | 1

| accepted

Answered
Save a plot from a function in a structure and save the structure
You can save all your workspace data or selected data into an .mat file. Then you can load or simply double click the .mat file ...

8 years ago | 0

| accepted

Load more