
Fangjun Jiang
What is a model? Professional Interests: Model-Based Development
Content Feed
답변 있음
keep getting an error message saying might be missing a closing bracket, causing invalid syntax at y, but the bracket is there. (line 34)
You can paste the text, instead of attaching a snapshot picture. I believe there is a mistake in defining the odeFun. There is ...
keep getting an error message saying might be missing a closing bracket, causing invalid syntax at y, but the bracket is there. (line 34)
You can paste the text, instead of attaching a snapshot picture. I believe there is a mistake in defining the odeFun. There is ...
19일 전 | 0
답변 있음
Simulink Switch doesn't propagate rate transition
Not sure what you exactly mean, but a Signal Specification block can specify any rate you want.
Simulink Switch doesn't propagate rate transition
Not sure what you exactly mean, but a Signal Specification block can specify any rate you want.
19일 전 | 0
답변 있음
Can I link optimization code with Simulink file?
In the most common case, you run the code above, all the variables will be created in the base workspace. If your Simulink model...
Can I link optimization code with Simulink file?
In the most common case, you run the code above, all the variables will be created in the base workspace. If your Simulink model...
20일 전 | 0
답변 있음
How to load the simulink variables and parameters from model workspace to the base workspace
Don't copy. Use the Model block (model reference) to reference models in another model. Do it manually. Open all the models. Op...
How to load the simulink variables and parameters from model workspace to the base workspace
Don't copy. Use the Model block (model reference) to reference models in another model. Do it manually. Open all the models. Op...
22일 전 | 1
답변 있음
How to Hold the sensor values for 10s and update the output value (boolean) using simulink
Use a Unit Delay block to store the previous value. I assume that is what you will use to compare "If the value from sensor is s...
How to Hold the sensor values for 10s and update the output value (boolean) using simulink
Use a Unit Delay block to store the previous value. I assume that is what you will use to compare "If the value from sensor is s...
22일 전 | 0
답변 있음
find_system() for custom library
The blks = find_system() will return 4 block handles. The first one is "sys" itself and the next three are the three customized ...
find_system() for custom library
The blks = find_system() will return 4 block handles. The first one is "sys" itself and the next three are the three customized ...
24일 전 | 0
답변 있음
How do I avoid hardcoding output size when using simulink coder.extrinsic?
I suspect that the "parameter" in your code is not really a parameter-by-definition by the MATLAB Function block. It appears as ...
How do I avoid hardcoding output size when using simulink coder.extrinsic?
I suspect that the "parameter" in your code is not really a parameter-by-definition by the MATLAB Function block. It appears as ...
26일 전 | 0
| 수락됨
답변 있음
why is my code not outputting to an excel file? Can someone fix this? I get Warning: Unable to write to Excel format, attempting to write file to CSV format.
In terms of xlswrite(), your code is fine. I've tried it and it creates the file. You might want to change range='A2:F37'. Try ...
why is my code not outputting to an excel file? Can someone fix this? I get Warning: Unable to write to Excel format, attempting to write file to CSV format.
In terms of xlswrite(), your code is fine. I've tried it and it creates the file. You might want to change range='A2:F37'. Try ...
26일 전 | 0
| 수락됨
답변 있음
Merging cells problem with actxserver
The merge of D1:E1 was impacted by the merge of B1:C1? Try the reverse order, F1:G1, then D1:E1, then B1:C1. Also, variable "e...
Merging cells problem with actxserver
The merge of D1:E1 was impacted by the merge of B1:C1? Try the reverse order, F1:G1, then D1:E1, then B1:C1. Also, variable "e...
26일 전 | 0
| 수락됨
답변 있음
Is it possible to extract data points from what is displayed on the Array Plot block in Simulink into the base MATLAB workspace?
The way you save the data points to the MATLAB base workspace is correct. The Array Plot shows the frequency on x axle from 0 ...
Is it possible to extract data points from what is displayed on the Array Plot block in Simulink into the base MATLAB workspace?
The way you save the data points to the MATLAB base workspace is correct. The Array Plot shows the frequency on x axle from 0 ...
26일 전 | 0
답변 있음
Naming signal in simulink based on workspace variable value.
It can't be done like a numerical parameter, where you can type in e.g. pi, instead of 3.1415926535 But it can be done through ...
Naming signal in simulink based on workspace variable value.
It can't be done like a numerical parameter, where you can type in e.g. pi, instead of 3.1415926535 But it can be done through ...
26일 전 | 0
답변 있음
I face this error every time.
The referred mdlStart.m file must have been accidently modified or over-written. The original file is a M-file function. The mes...
I face this error every time.
The referred mdlStart.m file must have been accidently modified or over-written. The original file is a M-file function. The mes...
27일 전 | 0
답변 있음
How to change the width of the command window?
Apparently, the width won't be big enough even if you could adjust it. Try this: a=1:100; open a
How to change the width of the command window?
Apparently, the width won't be big enough even if you could adjust it. Try this: a=1:100; open a
28일 전 | 0
| 수락됨
답변 있음
Simulink Matlab function block output is inferred as a variable-size matrix, but its size is specified as inherited or fixed
There are issues with the code. The size of "inputStream" is going to grow indifinitely. I suggest using a Buffer block to repl...
Simulink Matlab function block output is inferred as a variable-size matrix, but its size is specified as inherited or fixed
There are issues with the code. The size of "inputStream" is going to grow indifinitely. I suggest using a Buffer block to repl...
29일 전 | 0
| 수락됨
답변 있음
Changing the font size in the mask gives warning
You may not realize, text() used in Simulink Mask doesnot have full functionality as in MATLAB. See this note in the doc. While...
Changing the font size in the mask gives warning
You may not realize, text() used in Simulink Mask doesnot have full functionality as in MATLAB. See this note in the doc. While...
대략 1개월 전 | 0
답변 있음
How to select specific data rows from neighboring column
index=and(T(:,1)>=21, T(:,1)<=30); x=T(index,4); y=T(index,3); z=T(index,2);
How to select specific data rows from neighboring column
index=and(T(:,1)>=21, T(:,1)<=30); x=T(index,4); y=T(index,3); z=T(index,2);
대략 1개월 전 | 1
| 수락됨
답변 있음
loss of data/missing elements in array after a for loop
If you don't pre-allocate idx_matrix_bool_mat_filt, this could happen. Do idx_matrix_bool_mat_filt=TD_32_colon before the loop. ...
loss of data/missing elements in array after a for loop
If you don't pre-allocate idx_matrix_bool_mat_filt, this could happen. Do idx_matrix_bool_mat_filt=TD_32_colon before the loop. ...
대략 1개월 전 | 1
| 수락됨
답변 있음
How to change variable name in MAT file
Save the .mat file as what it is from the source. Use a=load('*.mat') to load it. "a" would be a structure. The variable is in a...
How to change variable name in MAT file
Save the .mat file as what it is from the source. Use a=load('*.mat') to load it. "a" would be a structure. The variable is in a...
대략 1개월 전 | 1
답변 있음
Dialog box in the mask for different equations
A few steps. Change the name of the "Interpreted MATLAB Function" block to be "MyFun", so it's easy to reference it in the code...
Dialog box in the mask for different equations
A few steps. Change the name of the "Interpreted MATLAB Function" block to be "MyFun", so it's easy to reference it in the code...
대략 1개월 전 | 1
| 수락됨
답변 있음
How can I write an array to a txt file such that it looks like MATLAB syntax
use mat2str(), write the string to the text file A = [1 2 3 4; -1 0 1 2; 3 9 5 7; 12 100 1000 1012]; str=mat...
How can I write an array to a txt file such that it looks like MATLAB syntax
use mat2str(), write the string to the text file A = [1 2 3 4; -1 0 1 2; 3 9 5 7; 12 100 1000 1012]; str=mat...
대략 1개월 전 | 0
| 수락됨
답변 있음
mapping between two different matrices
a=[1 2;3 4;5 6]; b=[1 2 3;1 2 3;1 2 3;1 2 3;1 2 3]; c=[1 2]; [~,index]=ismember(c,a,'rows'); b(:,index)
mapping between two different matrices
a=[1 2;3 4;5 6]; b=[1 2 3;1 2 3;1 2 3;1 2 3;1 2 3]; c=[1 2]; [~,index]=ismember(c,a,'rows'); b(:,index)
대략 1개월 전 | 0
| 수락됨
답변 있음
How to store all the sequential signals generated during the Simscape simulation in Simulink and access those signals inside the function block?
The "Buffer" block? https://www.mathworks.com/help/dsp/ref/buffer.html
How to store all the sequential signals generated during the Simscape simulation in Simulink and access those signals inside the function block?
The "Buffer" block? https://www.mathworks.com/help/dsp/ref/buffer.html
대략 1개월 전 | 0
답변 있음
Simlink pulse generator rise/fall time
Use a "Repeating Sequence" block and provide the time-value pairs. If your version of Simulink has the "Signal Builder" block, a...
Simlink pulse generator rise/fall time
Use a "Repeating Sequence" block and provide the time-value pairs. If your version of Simulink has the "Signal Builder" block, a...
대략 1개월 전 | 0
답변 있음
Moving average with a time window 600s but using a variable step modeling setting
Same question? https://www.mathworks.com/matlabcentral/answers/1917080-discrete-average-on-simulink
Moving average with a time window 600s but using a variable step modeling setting
Same question? https://www.mathworks.com/matlabcentral/answers/1917080-discrete-average-on-simulink
대략 1개월 전 | 0
| 수락됨
답변 있음
TO WORKSPACE BLOCK IS NOT CREATING NEW VARIABLE TO WORKSPACE
It is saved in "out.simout", instead of "simout" if your variable name is "simout", if every other setting is by default. You ar...
TO WORKSPACE BLOCK IS NOT CREATING NEW VARIABLE TO WORKSPACE
It is saved in "out.simout", instead of "simout" if your variable name is "simout", if every other setting is by default. You ar...
대략 1개월 전 | 0
답변 있음
How to solve the problem of finding an unconnected output signal line on 'untitled/radar' (output port: 1)
The "Camera" and "Radar" block both have un-connected output signal lines (the red dotted arrow). Connect them to something usef...
How to solve the problem of finding an unconnected output signal line on 'untitled/radar' (output port: 1)
The "Camera" and "Radar" block both have un-connected output signal lines (the red dotted arrow). Connect them to something usef...
대략 1개월 전 | 0
답변 있음
How to create a list of all variable names/block parameter values used in a Simulink model?
This might be it. Model Data Editor
How to create a list of all variable names/block parameter values used in a Simulink model?
This might be it. Model Data Editor
대략 2개월 전 | 0
답변 있음
Where can I find Simulink block element identifier?
get_param(FullBlockPath, 'SID') Please see this Q&A. https://www.mathworks.com/support/search.html/answers/601471-how-can-we-u...
Where can I find Simulink block element identifier?
get_param(FullBlockPath, 'SID') Please see this Q&A. https://www.mathworks.com/support/search.html/answers/601471-how-can-we-u...
대략 2개월 전 | 0
| 수락됨
답변 있음
I have data for each milli second. How can I average the 1000 samples and convert in to 1 sec? I got 322 sec data. 1K samples for each second.
Data=(1:25)'; Ten=10; NofData=floor(length(Data)/Ten)*Ten; temp=reshape(Data(1:NofData),Ten,[]) av=mean(temp)
I have data for each milli second. How can I average the 1000 samples and convert in to 1 sec? I got 322 sec data. 1K samples for each second.
Data=(1:25)'; Ten=10; NofData=floor(length(Data)/Ten)*Ten; temp=reshape(Data(1:NofData),Ten,[]) av=mean(temp)
대략 2개월 전 | 0
답변 있음
Add brake block to simulink
It is a "Switch" block, inside Simulink, Signal Routing.
Add brake block to simulink
It is a "Switch" block, inside Simulink, Signal Routing.
대략 2개월 전 | 0
| 수락됨