Answered

How to access Simulink Model callbacks like PreLoadFcn, InitFcn, StopFcn from matlab command window?

Model='f14'; open_system(Model) get_param(Model,'PreLoadFcn'); set_param(Model,'PreLoadFcn','YourFunctionName')

How to access Simulink Model callbacks like PreLoadFcn, InitFcn, StopFcn from matlab command window?

Model='f14'; open_system(Model) get_param(Model,'PreLoadFcn'); set_param(Model,'PreLoadFcn','YourFunctionName')

3 månader ago | 0

Answered

Neglecting difference between two values if it is very small so that value1= value2

To compare element by element, abs(C) < Tolerance To compare the two vectors as a whole, all(abs(C) < Tolerance) or use isme...

Neglecting difference between two values if it is very small so that value1= value2

To compare element by element, abs(C) < Tolerance To compare the two vectors as a whole, all(abs(C) < Tolerance) or use isme...

3 månader ago | 0

Answered

How to loop through structure with words?

fn=fieldnames(reflectance.nhy1); for k=1:length(fn) reflectance.nhy1.(fn{k}) end

How to loop through structure with words?

fn=fieldnames(reflectance.nhy1); for k=1:length(fn) reflectance.nhy1.(fn{k}) end

3 månader ago | 0

| accepted

Answered

write two inputs to interpreted MATLAB block

Specify as "mod1(u(1),u(2))". Look at the Help of the block.

write two inputs to interpreted MATLAB block

Specify as "mod1(u(1),u(2))". Look at the Help of the block.

3 månader ago | 0

| accepted

Answered

Why is the look-up table in Simulink must faster than the interp3 function in Matlab script?

Might it be that interp3() is a M-script function, not a built-in (or written in C) function? Try to specify all the optional ...

Why is the look-up table in Simulink must faster than the interp3 function in Matlab script?

Might it be that interp3() is a M-script function, not a built-in (or written in C) function? Try to specify all the optional ...

3 månader ago | 0

Answered

What does the Following mean in Simulink

That is the Index Vector block. "Ldq" is a vector. The above math is: Out1=In1*Ldq(2)/Ldq(1)

What does the Following mean in Simulink

That is the Index Vector block. "Ldq" is a vector. The above math is: Out1=In1*Ldq(2)/Ldq(1)

3 månader ago | 1

| accepted

Answered

Repeat a time based signal in Simulink (not using *.m script) / during Start of simulation based on number of repetitions

Repeating Sequence block

Repeat a time based signal in Simulink (not using *.m script) / during Start of simulation based on number of repetitions

Repeating Sequence block

3 månader ago | 0

| accepted

Answered

How can i have a loop in every step time in Simulink?

Use For Iterator Subsystem

How can i have a loop in every step time in Simulink?

Use For Iterator Subsystem

3 månader ago | 0

| accepted

Answered

Insufficient number of outputs from right hand side of equal sign to satisfy assignment

nonlcon() is a defined function so fun=@nonlcon should be enough. It might be easier if the function has only one return variabl...

Insufficient number of outputs from right hand side of equal sign to satisfy assignment

nonlcon() is a defined function so fun=@nonlcon should be enough. It might be easier if the function has only one return variabl...

4 månader ago | 0

Answered

theoretical framework of support for S-Functions

S-Function is used broadly. doc: web(fullfile(docroot, 'simulink/slref/sfunction.html')) example: open_system('sfundemos')...

theoretical framework of support for S-Functions

S-Function is used broadly. doc: web(fullfile(docroot, 'simulink/slref/sfunction.html')) example: open_system('sfundemos')...

4 månader ago | 0

Answered

error in repeating sequence

It's better to provide the error message. I assume the error is about the time data that you provied. There are duplicated val...

error in repeating sequence

It's better to provide the error message. I assume the error is about the time data that you provied. There are duplicated val...

4 månader ago | 0

Answered

Sizeof double float int etc

Look at the .bytes returned by whos() a=false(5); aInfo=whos('a') b=zeros(5); bInfo=whos('b')

Sizeof double float int etc

Look at the .bytes returned by whos() a=false(5); aInfo=whos('a') b=zeros(5); bInfo=whos('b')

4 månader ago | 0

Answered

Is There a Way to Find all Shadowed Functions on the matlabpath?

I am not aware of any direct method. On the other hand, Files=dir('**/*.m') will give you all the M-file names including all sub...

Is There a Way to Find all Shadowed Functions on the matlabpath?

I am not aware of any direct method. On the other hand, Files=dir('**/*.m') will give you all the M-file names including all sub...

4 månader ago | 0

| accepted

Answered

How do i know which Simulink Libraries are used in the Program?

license('inuse') tells the "toolboxes" that are used. What you need is libinfo('ModelName'). Most likely, 'Delft_Tyre_dtlib' is...

How do i know which Simulink Libraries are used in the Program?

license('inuse') tells the "toolboxes" that are used. What you need is libinfo('ModelName'). Most likely, 'Delft_Tyre_dtlib' is...

4 månader ago | 1

Answered

How do I restore matlab to original settings?

In MATLAB, run "restoredefaultpath" to see if you can get your Simulink back to normal. Then try to re-install SpeedGoat.

How do I restore matlab to original settings?

In MATLAB, run "restoredefaultpath" to see if you can get your Simulink back to normal. Then try to re-install SpeedGoat.

4 månader ago | 0

Answered

Where to find Variable Size for output of Matlab function in Simulink

double click the MATLAB Function block to open the code editor, Click "Edit Data" button/icon, select the variable on the left c...

Where to find Variable Size for output of Matlab function in Simulink

double click the MATLAB Function block to open the code editor, Click "Edit Data" button/icon, select the variable on the left c...

4 månader ago | 0

| accepted

Answered

How to combine matrices with different size but preserve elements with same value?

unique([A;B])?

How to combine matrices with different size but preserve elements with same value?

unique([A;B])?

4 månader ago | 0

Answered

Initializing 1/2 of a row with one value and the other half with another

You mis-understood it. The code involves built-in functions ones() and zeros(). The input arguments are size of the matrix, not ...

Initializing 1/2 of a row with one value and the other half with another

You mis-understood it. The code involves built-in functions ones() and zeros(). The input arguments are size of the matrix, not ...

4 månader ago | 0

Answered

Error in port widths or dimensions Error.

If your t=sin(0:0.01:30), which is 1x3001 double, you need to make it a column vector and then use the "From Workspace" block. ...

Error in port widths or dimensions Error.

If your t=sin(0:0.01:30), which is 1x3001 double, you need to make it a column vector and then use the "From Workspace" block. ...

5 månader ago | 0

| accepted

Answered

How to show the Unit parameter in the signal attrbutes of a constant block?

There is no "unit" property at the Constant block. What you can do is to define a Simulink parameter object. A=Simulink.Paramet...

How to show the Unit parameter in the signal attrbutes of a constant block?

There is no "unit" property at the Constant block. What you can do is to define a Simulink parameter object. A=Simulink.Paramet...

5 månader ago | 0

| accepted

Answered

how to rearrage the matrix?

[objectpointsepoch1(:,2); objectpointsepoch1(:,3)]

how to rearrage the matrix?

[objectpointsepoch1(:,2); objectpointsepoch1(:,3)]

5 månader ago | 1

| accepted

Answered

安装waijung第三方工具箱每次打开matlab出现路径警告

I had the same problem and this probem started in R2020a. Every time you started MATLAB R2020a, such a temporary folder is aut...

安装waijung第三方工具箱每次打开matlab出现路径警告

I had the same problem and this probem started in R2020a. Every time you started MATLAB R2020a, such a temporary folder is aut...

5 månader ago | 0

Answered

Programmatically change user defined Library objects in Simulink model

In the first part of your code, add_block() is not used properly. You need to specify the full path of both the source and desti...

Programmatically change user defined Library objects in Simulink model

In the first part of your code, add_block() is not used properly. You need to specify the full path of both the source and desti...

5 månader ago | 1

| accepted

Answered

how to move the currently selected port in s function builder

You have only one port so nowhere to move. The buttons are on the left. Insert one more and the other three buttons will be avai...

how to move the currently selected port in s function builder

You have only one port so nowhere to move. The buttons are on the left. Insert one more and the other three buttons will be avai...

5 månader ago | 1

Answered

Signal Simulink from / to Workspace

The data in the first column of SigData is the time (or time step) info. It must be incremental (or non-descreasing). Based on ...

Signal Simulink from / to Workspace

The data in the first column of SigData is the time (or time step) info. It must be incremental (or non-descreasing). Based on ...

5 månader ago | 0

| accepted

Answered

Syntax Error in Simulink Fcn block

Provide values for every variable in the formula, including nb, Tfault, Tclear Provide an instance value of u Run the formula ...

Syntax Error in Simulink Fcn block

Provide values for every variable in the formula, including nb, Tfault, Tclear Provide an instance value of u Run the formula ...

5 månader ago | 0

| accepted

Answered

Operations with function handles / anonymous functions

function1 = @(x) x(1)^2+5 function2 = @(x) 2*x(2) function3=@(x) function1(x)+function2(x) function1([1 2]) function2([1 2...

Operations with function handles / anonymous functions

function1 = @(x) x(1)^2+5 function2 = @(x) 2*x(2) function3=@(x) function1(x)+function2(x) function1([1 2]) function2([1 2...

5 månader ago | 1

Answered

Ugrade Advisor: Where is the Update button?

Switch back to your Simulink model, press Ctrl+D to update the model. In R2020a, you will find the button in the center of the...

Ugrade Advisor: Where is the Update button?

Switch back to your Simulink model, press Ctrl+D to update the model. In R2020a, you will find the button in the center of the...

5 månader ago | 0

| accepted

Answered

Get full path of referenced models

ModelFile=get_param('ModelBlock','ModelFile'); File=which(ModelFile); There is no full path info saved with the Model block, b...

Get full path of referenced models

ModelFile=get_param('ModelBlock','ModelFile'); File=which(ModelFile); There is no full path info saved with the Model block, b...

5 månader ago | 0

| accepted

Answered

Plotting in a specific range

index=Res(:,1)>=20; plot(Res(index,1),Res(index,3))

Plotting in a specific range

index=Res(:,1)>=20; plot(Res(index,1),Res(index,3))

5 månader ago | 0

| accepted