Community Profile

# Fangjun Jiang

Last seen: Today Actif depuis 2011

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

All

#### Content Feed

Afficher par

A répondu
How can i create a function block in simulink that takes multiple input vectors as arguments?
Assume the same input, inside the MATLAB Function block, use u(1), u(2) to reference, not u[1], u[2].

environ 5 heures il y a | 0

A répondu
How can we insert a row matrix without altering the rest of the values?
A=magic(3); C=transpose(reshape([A,10*A]',size(A,1),[]))

environ 10 heures il y a | 2

A répondu
Simulink Code Generation: blocks with masks and tunability
Create Tunable Calibration Parameter in the Generated Code

environ 11 heures il y a | 0

A répondu
repeat n times vector with name index
for i=1:n E{i}=trapz(days,D{i}); e{i}=D{i}(1,1); ee{i}=D{i}(5,1); Etotal{i}=E{i}A+570*e{i}+2330*ee{i}; end

1 jour il y a | 0

A répondu
How can I run simulink one sample at a time?
sldebug step top

1 jour il y a | 0

A répondu
How do I have a time based function be the input for revolute joint position in Simulink
The Clock block provides the time line that the simulation runs on. You can use that for your function.

1 jour il y a | 0

A répondu
Specifying values in 2D array when I know the indices
A = [1 1 1 1 100; 100 1 1 1 1 1 1 100 1 1 1 1 1 100 1; 1 100 1 1 1]; [~,idx] = max(A,[],1,'linear') B = [...

2 jours il y a | 0

| A accepté

A répondu
Simulink.BlockDiagram.arrangeSystem does not work inside library
I've tried it. You need to disable the library link first. set_param(gcb,'LinkStatus','inactive') Simulink.BlockDiagram.arrang...

2 jours il y a | 0

A répondu
Combining rows of each field within a structure
s(1).f=1:3; s(2).f=4:6; s(3).f=7:9 vertcat(s.f)

2 jours il y a | 0

A répondu
how to export varied variable to saturation block in Simulink?
Use Saturation Dynamic

2 jours il y a | 0

| A accepté

A répondu
unable to programmatically find lines inside a custom library-block
You forgot 'FollowLinks','On' >> oldLines = find_system(gcb, 'FindAll', 'on', 'LookUnderMasks','all', 'type', 'line') oldLines...

2 jours il y a | 1

| A accepté

A répondu
how to Read Txt file(XML format) in Matlab ?

4 jours il y a | 0

A répondu
How do I run same subsystem for certain number of times in Simulink?
Use the "For Iterator Subsystem" block https://www.mathworks.com/help/simulink/slref/foriteratorsubsystem.html

14 jours il y a | 0

| A accepté

A répondu
setting decimal point precision in handles.object
As you can see, the value for "editable text field" should be string. You can't do "set(handles.triAreaCalcFld,'String', area)"...

14 jours il y a | 0

| A accepté

A répondu
Is there a way to make a persistent variable using the C Caller block?
Your MATLAB release is R2018b so I assume you are referring the "C Caller" block, not the "C Function" block. "C Caller" block ...

15 jours il y a | 0

A répondu
Error Meassage Simulation of model '....' is not allowed because it is a 'subsystem' block diagram
sim() starts the simulation of a "model", not a "block" inside it. To simulate that subsystem block, you have to copy that sub...

16 jours il y a | 0

A répondu
Limit value to a function
y1=sin(0:0.1:10); y2=min(y1,0.8); plot(y2)

16 jours il y a | 0

| A accepté

A répondu
SIMULINK Lookup table for several inputs and outputs
2-D lookup table or n-D lookup table will do. Check the block document for examples.

16 jours il y a | 0

A répondu
How to cut the desired signal?
In general, t=0:0.1:3.5; signal=0:35; index=and(t>=1.5, t<=2.0); new_t=t(index); new_signal=signal(index); plot(new_t, new...

16 jours il y a | 0

| A accepté

A répondu
Cannot use equal operator to test function argumants
a = input('Enter first value: ') "a" is already a numerical value. You don't need all the str2double() calls. when you call s...

17 jours il y a | 0

| A accepté

A répondu
Simulink Local function debug gives "Undefined function 'myFunc' for input arguments of type 'double'"
Don't do "F9". Add a break point in the Editor, press the "Step" and other buttons to debug.

18 jours il y a | 0

A répondu
replace initial matrix with a new one on Simulink
All you need is a "Product" block and a "Unit Delay" block. Use the "Unit Delay" block to get the value of s from previous step....

18 jours il y a | 0

A répondu
In simulink ,a feedback system, how may I use different row in a matrix input every single time?
Use the "From Workspace" block to import A. Read the Help document of the block to understand the needed format. Basically, yo...

18 jours il y a | 0

A répondu
Sort a string array according to equivalent names of another string array
names=["A";"B";"C";"D";"E"]; S1=["d";"c";"e";"a";"b"]; [~,index]=ismember(names, upper(S1)); S2=S1(index)

22 jours il y a | 0

| A accepté

A répondu
Integral in Simulink fcn Block
You need to understand the difference between MATLAB and Simulink. This Simulink block diagram will give you the curve. Set th...

22 jours il y a | 0

A répondu
Is it possible to have tags=signal name in Simulink?
No. I could think of two reasons not to do that. In many models, many signal lines have no label (i.e. the "signal names" are ...

22 jours il y a | 0

A répondu
Cant use Excel names to fprintf?
see this example fname={'abc'}; fprintf('%s',fname) fprintf('%s',fname{1})

28 jours il y a | 0

A répondu
How to replace a single Simulink block with self-modifying mask block with same interface, maintaining all connections
I was able to duplicate your problem. I don't know why. Need more time to figure it out. But I did find an alternative. Basical...

28 jours il y a | 0

A répondu
Change cell object to char
a={'abc'} whos a b=char(a) whos b

29 jours il y a | 0

A répondu
Function with multiple inputs to function with vector input
f=@(z1,z2,z3) z1+z2+z3; f(1,2,3) a=1:3; b=num2cell(a); f(b{:})

29 jours il y a | 0

| A accepté