Community Profile

photo

Fangjun Jiang


Last seen: Today
2.757 total contributions since 2011

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

Contact

Fangjun Jiang's Badges

  • 36 Month Streak
  • Revival Level 3
  • First Review
  • Ace
  • Thankful Level 2
  • Knowledgeable Level 4
  • First Answer
  • Solver

View details...

Contributions in
View by

Answered
how to add singal and its attributes( data type, min, max values to data dictionary programatically?
What you can do is to create the Simulink.Parameter as a temparary object and assign all its properties and then addEntry(). A ...

alrededor de 19 horas ago | 0

| accepted

Answered
all test harness signals are initialized to the wrong values (ZEROS)
Find the source of the signal in the model (the output of a Gain block or could be a root level Inport block, where the signal i...

alrededor de 20 horas ago | 1

Answered
Change Simulink.Parameter ExportedGlobal from inside Simulink model
The reason that the external code can modify that parameter is because You made it ExportedGlobal It is C code The C code bas...

alrededor de 21 horas ago | 0

Answered
Simulink: minimum values in vector segments
Use a MATLAB Function block and code similar like this: y=min(reshape(1:20,4,5)) work out the warnings and errors regarding var...

1 día ago | 1

Answered
Observe the output in Matlab workspace
Assume "y" is "the output". Let's do it properly. In your Simulink model, double click the signal line out of the dy/dt Integrat...

2 días ago | 0

Answered
Optimize Rapid Accelerator and avoid rebuilding
Avoid Scope block. Try Simulink Data Inspector web(fullfile(docroot, 'simulink/slref/simulationdatainspector.html'))

3 días ago | 0

Answered
Error: Unable to resolve the name workbooks.Open.
After excel = actxserver(), you have not defined "workbooks". Need this? workbooks= excel.Workbooks;

3 días ago | 0

| accepted

Answered
Changing image in an algebraic loop
A better way in this case is to use persistent variable. doc persistent But a loop with memory or delay block should also work....

3 días ago | 0

Answered
Remove default block names from auto generated Code using embedded coder
If you want a particular variable name for a signal line in the model, double click the signal line, give it a name "MySignal", ...

5 días ago | 0

| accepted

Answered
couldnt able to use switch statement with string
material=lower(material); without the single quote.

6 días ago | 0

| accepted

Answered
Issue with Lookup Table Code Generation?
Column-Major Layout to Row-Major Layout Conversion of Models with Lookup Table Blocks web(fullfile(docroot, 'ecoder/ug/column-m...

6 días ago | 0

| accepted

Answered
Delete files inside subfolder
use dir('**/*.mat') to find files in subfolders in one shot and then use a for-loop to delete the files.

6 días ago | 0

| accepted

Answered
Fastest way to replace NaNs by empty cells in a table
M=10;N=5; a = rand(1, M)'; a(1:N) = NaN; b = rand(1, M)'; b(1:N) = NaN; c = repelem({'A101'}, M)'; t = table(a, b, c); t....

7 días ago | 0

| accepted

Answered
Why I the data processed by the matlab is wrong, it reports three wrong results,what is the reason?All the data and .m files are included ,who can help me?
This is probably the limitation of the smartness of the importdata() function. If you look at filec.textdata, you will get a cl...

7 días ago | 0

Answered
How to generate non-repeatable random number in simulink in same session
The MATLAB Function block is executed at every simulation step. For this case, I would suggest using rng() and poissrnd(0.52,N,1...

8 días ago | 1

| accepted

Answered
How can I output singular element of an array from workspace to simulink per second simulation time?
Assume your data is data=(1:96).'/100 Create a time vector time=(0:95).' Use a "From Workspace" block, specify the data as [ti...

8 días ago | 0

Answered
Unable to update data tip using custom update function
It must be related to where the custom update function comes from when the figure is saved. I created and saved the figure fir...

8 días ago | 0

| accepted

Answered
How to extract a value from a Row or Column vector?
Is this what you are looking for ? MyVector=rand(100,1); MyData=MyVector(5);

9 días ago | 0

| accepted

Answered
How to copy the content of a model to another model without closing the current model
save_system() and then copyfile() Simulink autosave preference Simulink.BlockDiagram.copyContentsToSubsystem(), Simulink.SubSy...

9 días ago | 0

| accepted

Answered
How can I write a Mask parameter to the workspace in Simulink?
The masked parameters seem to mismatch internal variables. The easiest way is to change the #1 and #2 parameter name in the mask...

10 días ago | 0

| accepted

Answered
strcmp: compare a string with a set of strings
IsSpring=ismember('January',{'January','Feburary','March'})

13 días ago | 0

| accepted

Answered
import an old simulink model from 1995
This .m file is still valid on its concept. It runs M-script or commands to create a Simulink model on-the-fly. If you run "dyna...

15 días ago | 0

Answered
Connect two simulink lines programatically
%% Model='ex_goto_tag_visibility_block'; open_system(Model); Block=[Model,'/GotoGlobal']; PC=get_param(Block,'PortConnectivi...

15 días ago | 0

Answered
structure is pointlessly nested within itself when I save it. How to unnest?
If you use load() without returning a variable, then the structure won't be created, but then you have to know what variables ar...

16 días ago | 0

Answered
What is a 'Code Dictionary'?
For R2019a, here is the document reference web(fullfile(docroot, 'ecoder/ref/embeddedcoderdictionary.html')) Or Embedded Cod...

16 días ago | 0

| accepted

Answered
What's a Simulink.Parameter?
Actually it takes more work (or lines of code) to define a Simulink.Parameter. But it has more capabilities. It can define Min ...

16 días ago | 0

| accepted

Answered
Simulink bug - adding a PID only to scope creates large fluctuations
It is not a bug. Don't claim it is a bug when you have no idea. You need to learn how digital simulation solves an analog proble...

17 días ago | 1

Answered
Change Simulink.Parameter inside Simulink model
It will be hard to "change the value of a Simulink.Parameter from inside of my Simulink model", if not possible. Even if you cou...

21 días ago | 0

| accepted

Answered
Simulink Post Sim Function
Try the PostSaveFcn.

22 días ago | 0

Answered
Data Type Conversion does not convert to boolean when attached to transfer function block
Your filter coefficient 50e-6 makes it respond faster but the output will "creep" for a long time. The boolean conversion or th...

23 días ago | 0

| accepted

Load more