Community Profile

photo

Fangjun Jiang


2.417 total contributions since 2011

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

Contact

Fangjun Jiang's Badges

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

View details...

Contributions in
View by

Answered
Possible bug in visdiff - need confirmation and a workaround
I think it is a bug, or at least a defect. I've seen similar issues. Inserting an Inport block in the middle of a subsystem bloc...

2 giorni ago | 0

Answered
errors after update to 2019
It is a function in the Optimization Toolbox. Do you still have this toolbox in new version of MATLAB?

2 giorni ago | 0

Answered
'break' in 'while' loop
From help break In nested loops, break exits from the innermost loop only

2 giorni ago | 0

| accepted

Answered
Combining a function and solver to create a M-function in Simulink
Simulink is the perfect tool to solve this problem (get y output based on input A and B). Why take the awkward long route? In fa...

3 giorni ago | 0

Answered
How to find the variables of simulink non-active variants subsystem
from doc Simulink.findVars Simulink.findVars discovers variable usage in inactive subsystem variants only if you select Analyze...

3 giorni ago | 0

Answered
at which piont i have the minimum value
[t,index]=max(z); value=i(index)

3 giorni ago | 0

Answered
To Workspace Block - Output Array Size Problem
A Simulink simulation runs for a period of time. The output being 51x1 size array probably means the simulation ran for 50 steps...

3 giorni ago | 0

| accepted

Answered
Can you help me fix a faulty self-resetting integrator?
Right now, the reset trig is "falling" edge. Pure negative value won't trig it. You could add a Comparison block to compare ...

3 giorni ago | 0

Answered
Can someone tell me what is wrong with this?
The problem is, vector x is not defined. When you do x1=5, I think you meant x(1)=5. But even with that, when k=1, x(2) is not d...

4 giorni ago | 0

Answered
function rand with variables
a=10;b=20;c=30; mat=[a,b,c]; index=randi([1 3],1,10); out=mat(index)

4 giorni ago | 0

Answered
Find the coordinates of a point chosen on a plot
Use data cursor, set "SnapToDataVertex" to be "on" and then get the position. See example in doc datacursormode

4 giorni ago | 0

Answered
What is u(1:1+int,1)?
Do the following line by line to unerstand it u=magic(6) int=4 1:1+int u(1:1+int,1)

4 giorni ago | 0

Answered
Error when trying to enter in a simple matrix
most likely need to be written as (cos(psi))^2

8 giorni ago | 0

Answered
[Solved] How can I make my output into a 2D char array instead of separate answers?
You have a recursive function which makes it a little complicated. But this modification seems to work. %% out=hanoi(3, 1, 2, ...

8 giorni ago | 1

Answered
Run an external program using matlab
system('$RaD -variable example.txt')

9 giorni ago | 0

Answered
How to add a new field in astruct
setfield(test,'NewField',1)

11 giorni ago | 0

| accepted

Answered
Scope problem in Simulink Desktop Real-Time
Check if you have a "Marker". On the Scope, View, Style, make sure "Marker" is "none".

11 giorni ago | 0

| accepted

Answered
MATLAB syntax (parantheses without intermediate steps)
mean(mean(abs(rand(10)-eye(10))))

12 giorni ago | 1

Answered
audioFeatureExtractor function not found
This function is introduced in R2019b. https://www.mathworks.com/help/releases/R2019b/audio/ref/audiofeatureextractor.html

12 giorni ago | 0

| accepted

Answered
apply initial conditions to a subsystem
Use "Initialize Function" in library Simulink\User-Defined Functions.

12 giorni ago | 0

Answered
How to programmatically rename Stateflow states that are grouped?
To handle this, Box=c.find('Name', 'Heater'); Box.IsGrouped=false; states(1).Name='NewName'; To handle it more generically...

12 giorni ago | 0

| accepted

Answered
Integrate, Load and execute a dll in a Simulink Model
C caller block

14 giorni ago | 0

Answered
Extract Structure element dynamically
%% s.a=1:10; s.b=rand(1,10); EleNames=fieldnames(s); plot(s.(EleNames{1}),s.(EleNames{2}));

16 giorni ago | 0

Answered
How can I count how many numbers are different from '-1'?
start with B=A~=-1

16 giorni ago | 0

Answered
How can I get the full MATLAB Mapping Toolbox? Some functions appear to be missing.
geodensityplot() was introduced in R2018b. https://www.mathworks.com/help/releases/R2019b/matlab/ref/geodensityplot.html

16 giorni ago | 1

| accepted

Answered
Duplicate Each Element in a Matrix without using Repelem or Repmat
a=eye(2); k=3; d=blkdiag(ones(k,1),ones(k,1)); b=d*a*d' %%Or a more generic case a=[1 2 3;4 5 6]; k=3; [m,n]=size(a);...

16 giorni ago | 2

| accepted

Answered
Enclosing Multiple Subplots in a Box
In the figure window, click "Insert", "Rectangle". Or % Create figure figure1 = figure; % Create subplot subplot(4,4,1,'P...

17 giorni ago | 0

Answered
Interweave two arrays in a specific pattern
%% a=(1:32)'; b=(10:10:320)'; %% c=reshape([a,b],16,[]); d=c(:,[1:2:end,2:2:end]); e=d(:) %% better solution from Gui...

18 giorni ago | 0

Answered
How can I save a variable to external harddisk
save(FileName, Variables). Specify the full path of your file, e.g. 'd:\mydoc\file.mat'

19 giorni ago | 0

| accepted

Load more