Community Profile

photo

Fangjun Jiang


Last seen: Today
2,782 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
Splitting Up Large Matrix into n rows x 2 columns
n=100; a=rand(100,4); x=a(:,1:2) y=a(:,3:4)

15 hours ago | 1

Answered
Is it possible to read from file in an enabled subsytem?
Rather than trying to figure this out, why don't you just read it from file, use the enable signal or trig signal to switch betw...

16 hours ago | 0

Answered
How to create a subsystem running at an integer number of sampling rate of its parent's subsystem, which is a function call triggered?
If the parent system is "triggered" at 10ms rate, the child system is never going to be able to run at 4s rate. Without special ...

3 days ago | 0

Answered
Convert Vector into Scalar Simulink
Demux it you will get 1, 2 and 3, then 1*100+2*20+3=123

3 days ago | 1

| accepted

Answered
Index in position 2 exceeds array bounds (must not exceed 68160).
Here is a simple way to duplicate your error. Hope you will get it. When you have a matrix of say 2x3 elements, you can't access...

4 days ago | 0

Answered
How to assign label from one cell array to data inside another cell array?
Don't be obsessed with cellfun(). A simple for-loop will do %% C = {ones(4,5), 2*ones(4,5), 3*ones(4,5); 4*ones(4,5), 5*ones(4...

4 days ago | 0

| accepted

Answered
what is code to call a function ?
The function should be written like this and saved as tri_area.m function [area] = tri_area(b,h) area=1/2*(b)*(h); en...

5 days ago | 0

| accepted

Answered
Connecting a line from the first data point to the last data point
x=1:10; y=rand(size(x)); scatter(x,y); line(x([1 end]),y([1,end]))

5 days ago | 0

| accepted

Answered
simulink simulation data inspector : measurement of delta between data cursor
Right click, data cursors, turn on One and Two, you will see delta x

5 days ago | 1

Answered
Simulink Input Array with Trigger
A simplified example. Make two inputs, one is 5 and one is 10. Inside, Compare output to the first input (5) , if less, pass 5, ...

5 days ago | 0

Answered
Blocks are not shown on simulink page.
Drag and drop the block from library to the canvas of your Simulink model, then double click and set the parameters.

5 days ago | 0

Answered
How to reduce the execution time for Input/Output ports in Simulink?
An atomic subsystem will have to update its Inport and Outport at every simulation step while virtual subsystems don't need to d...

5 days ago | 0

Answered
Find reason for this warning msg: Variable 'hws' originally saved as a handle cannot be instantiated as an object and will be read in as a uint32.
My suspect is that there is a variable also called 'hws' in the .mat file. It was the handle of an object. For example, the hand...

5 days ago | 0

| accepted

Answered
On MATLab app designer, how can i get an editfield text as a variable?
EditFieldText='x(1)^3 + x(2)^2'; F=str2func(['@(x)',EditFieldText]); Then pass the function handle F to another function and u...

6 days ago | 1

Answered
Set signal line label visibility programatically
A signal line in a Simulink model, once it is named, it will always show. There is no property to hide or show it. Unless, in y...

6 days ago | 0

Answered
Can't append two large matrices due to limit in Matlab
Use Tall Arrays

6 days ago | 1

Answered
Updating simulink block parameter as the simulation runs.
setting array value as [time1 value1;time2 value2; time3 value3....] works for signal, not for parameters. Use this approach ins...

8 days ago | 0

| accepted

Answered
Unexpected error when plotting a bar chart
because your data is 4x2, h is an 1x2 array so you can't use h.YLabel. Check the value of h You have to use h(1).YLabel but the...

9 days ago | 0

| accepted

Answered
Insert a function in Simulink
The Clock block gives you time t for simulation. The rest is to use multiplication, sum and Devide.

9 days ago | 0

| accepted

Answered
One variable, two 'To Workspace' blocks simulink
"Res" is the variable created in the based workspace after simulation is done to log your simulation data You can't have two "T...

13 days ago | 0

Answered
Matlab to excel and back! Q about using ActiveX
See if you have this file in your MATLAB release edit ChangeRowHeightInRangeOfSpreadsheetCellsExample.m

13 days ago | 0

Answered
Is there a function that will test if the input is char OR string OR cellstr?
You've made that function. If you look at the "See also" section of "help iscellstr", you don't see any other related functions....

13 days ago | 0

Answered
obtain answer in brackets
mat2str(magic(3))

13 days ago | 1

| accepted

Answered
check referenced models do exist
You can do this. MdlRef=find_system(Model,'BlockType','ModelReference'); for k=1:length(MdlRef) SubModel=get_param(MdlRef{k},...

13 days ago | 0

| accepted

Answered
Accessing Simulink Model using M script
Something like this: Model='MyModel'; open_system(Model); Sys=find_system(Model,'BlockType','SubSystem'); for k=1:length(Sys...

13 days ago | 0

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 ...

14 days 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...

14 days ago | 0

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...

14 days ago | 0

| accepted

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...

15 days 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...

15 days ago | 0

Load more