Community Profile

photo

Fangjun Jiang


Last seen: Today Active since 2011

What is a model? Professional Interests: Model-Based Development

Programming Languages:
MATLAB
Spoken Languages:
English
Pronouns:
He/him

Statistics

All
  • Master
  • 36 Month Streak
  • Revival Level 3
  • First Review
  • Thankful Level 3
  • Knowledgeable Level 5
  • First Answer
  • Solver

View badges

Content Feed

View by

Answered
variable duty ratio to a switch at different time intervals
I assume this is in Simulink. You can use an AND logic block or Product block to multiply two signals. One is the regular 40% du...

5 hours ago | 0

| accepted

Answered
How to use Workspace Variable value instead Sldd value in Simulink model.
Check the "Enable model access to base workspace" at Model Property, External Data tab? https://www.mathworks.com/help/simulink...

6 hours ago | 0

Answered
Is there a nice way to discretely simulate an LTI system using a function block in Simulink?
Yes. For sys = ss(A,B,C,D,ts), the following equation should be used to advance the simulation step by step. Make sure to use c2...

1 day ago | 0

| accepted

Answered
How can I solve this error??
There is nothing wrong in these commands. The simulation was being started but there is problem in your scenaio. Switch to the...

2 days ago | 0

Answered
Building an array of strings that might be empty
That is because app.XminEditField.Value and etc are char array, not string use string() s=["a","","b","c"] c=['a','','b','ded...

2 days ago | 0

Answered
How computationally intensive are switch case action blocks in Simulink?
Yes. More cases will not increase the computation load. Only the activated cases will be executed. It is called the Condtionally...

3 days ago | 0

| accepted

Answered
How to get variable from Simulink model workspace for use with Multiple Simulations?
I think you are looking for model parameter argument. Follow this Q&A. https://www.mathworks.com/matlabcentral/answers/2101666-...

3 days ago | 0

Answered
How to fix this error? : Error:Index exceeds the number of array elements. Index must not exceed 4.
All the Winding parameters need to have 5 elements (including both the left and right side). You have only 4.

3 days ago | 0

| accepted

Answered
Is it possible to use a parameter within the "To Workspace" block?
I remember answering the same question before. The answer is "No" by value passing, but you could do it using set_param(). For ...

3 days ago | 0

Answered
Any good resources on how to use "Matrix Interpolation" block in simulink?
What you need is the "2-D Lookup Table" block. Drag that from the library and select "Nearest" at the "Algorithm" tab. The Help ...

3 days ago | 0

| accepted

Answered
In GUI, RangeSlider 's Value may have a wrong type
No confusion. You will find X = app. FilterHzSlider.Value; X is returned as [50 1000]. So you would do minFrq=X(1); maxFrq...

4 days ago | 1

| accepted

Answered
Function call failed when calling matlab function inside function block
Okay, fg_chua() is generated by matlabFunction(). You need to specify the size of ux in the MATLAB Function block. Open the MAT...

4 days ago | 0

| accepted

Answered
How to change the parameter value at run time in Matlab Simulink
This is not "change the parameter value at run time". Rather, it is to mimic a dynamic signal. You can use many of the blocks in...

4 days ago | 0

Answered
Loading table from object from .mat file
If the table object in that .mat file is called MyTable, then after ParaDat=load('ParameterDatabase.mat'), you can access it by ...

6 days ago | 1

| accepted

Answered
How to create a string array and access the elements without throwing "COMMAND must be a string scalar or character vector" error?
This error might be particular to the GBMD.loadDumpFile(). Can you try either one of these Make a temp variable, such as tempVa...

6 days ago | 1

| accepted

Answered
change the value of a data structure field
s(3).Val='1'; s.Val [s.Val]=deal('2') s.Val

6 days ago | 0

| accepted

Answered
Global variables in simulink - embedded coder
I think you can try this block. Put it inside the Subsystem and specify the sample time as -1, which inherits the interrupt. ht...

6 days ago | 0

Answered
Is there a way to change my simulink parameters at a pre-set time during the simulation?
There are ways but you are looking for "an easy way". Typically I would implement this in the model using the Step block. For e...

6 days ago | 1

| accepted

Answered
How to determine sets with only unique values across the columns of a large logical array?
Since it is comparing just two columns,I think you have to use loop. Utilize the logical(),all() and any() function. matrix =[0...

7 days ago | 0

| accepted

Answered
problem with matlab function in simulink (inpunt problem)
From the diagram, "Tt" and "Pt" are the 1st and 2nd input From the function code, "Tt" and "Pr" are the 1st and 2nd input, whil...

7 days ago | 0

Answered
How to convert custom simulink blocks (with inports and outports created for accessing hardware interfaces) inside a subsystem into non-virtual blocks?
Select the Subsystem block, right click, select "Block Parameters (Subsystem)", check "Treat as atomic unit". This is one of th...

9 days ago | 0

Answered
Programmatic setting of Argument attribute for parameter in Simulink model workspace
set_param('ModelName','ParameterArgumentNames','a,b,g') where a,b,g are the name of the variables. See also https://www.mathwor...

9 days ago | 0

Answered
how to access internet web browser
Run this in MATLAB Command Window web('mathworks.com')

10 days ago | 1

Answered
How Do I send a variable sized array from simulink to matlab workspace (using continuous time and without altering the sample time) ?
See the "Variable-size signal" example model. https://www.mathworks.com/help/releases/R2021b/simulink/slref/toworkspace.html

10 days ago | 0

Answered
How to select variant within a model reference?
Combine this with model parameter for the model reference? https://www.mathworks.com/help/simulink/ug/mask-a-variant-subsystem....

10 days ago | 0

Answered
How to read To Workspace block signal value to App Designer ?
Likely it is caused by this Signal1 = get_param('mymodel.slx/To Workspace1','VariableName') gives you a char array containing t...

15 days ago | 0

| accepted

Answered
Stateflow while-logic dead loop
When input==1, you do have an infinite loop, right? Connecting the feedback transition to the bottom junction would resolve it....

15 days ago | 0

| accepted

Answered
issues about zero_crossing_types.h during code generate
un-check the "Enable zero-crossing detection for fixed-step simulation" option in the Solver setting? Also, search for "zero-cr...

15 days ago | 0

| accepted

Answered
How to connect Inport Inport or Outport Outport programmatically
Yes. You can! I have done that using the add_line('connect_model','Constant/1','Gain/1') syntax by matching name. You are con...

15 days ago | 0

Answered
what is that blue block in Matlab is that a subsystem? what is the actual name of that block in Matlab?
It is called an "Area". On the left side of your Simulink canvas, click that "square" icon, below the "Image" icon.

15 days ago | 0

Load more