Community Profile

# J Chen

##### Last seen: 3 dagar ago
42 total contributions since 2019

View details...

Contributions in
View by

Submitted

CRC-16
A function to generate CRC-16 (16-bit Cyclic Redundancy Check)

How do I select only 100 images in a folder of 200 images, according to a list of 100 different names ?
Use the folllwoing command to get a structure that contains file information listing = dir('*.jpg'); Use the folllwoing comman...

21 dagar ago | 0

How to take mean of each row/column of matrix with while loop
You need to update i and j (add 1 to them) at the end of each while loop.

21 dagar ago | 0

| accepted

Help writing this integral
Use integral or trapz to integrate, then take the log. You need to find out the expression for p and the integration limits.

21 dagar ago | 0

I guess that the temperature units are 'K', 'degC', 'degF', etc.

22 dagar ago | 0

Simulink uses block diagram approach. The signal flow is unidirection. Simscape uses physical modeling approach. The signal flow...

22 dagar ago | 0

How do you add physical signal lines programmatically?
use h1 = get_param('mymodel/mySubsystem/C_1','PortHandles'); to get the port handles. Use add_line to draw line between the hand...

26 dagar ago | 0

User-defined MATLAB function block in Simulink/Simscape
use a statement like z = t / k; % don't use x to get the argument for the table lookup. Then use interp1(x,y,z) to find your ...

26 dagar ago | 1

| accepted

modelling in matlab of differential equation
you need an equation for dhw/dt, then use a matlab ode solver to solve the equations. see https://www.mathworks.com/help/matlab/...

26 dagar ago | 0

step response of Linear parameter varying model's response different from the step response of original non linear plant
You probably didn't specify the "State derivative/update offset" correctly. You need to uncheck the "Assume equilibrium operatin...

ungefär 2 månader ago | 0

Offset ticks and gridlines
Use xticks to place the ticks at the left of each group, e,g,, xticks([0.5 1.5 2.5]). You can use xt = xticks to get the coordn...

ungefär 2 månader ago | 0

Vector between vectors in intervals
vec1 = [-0.0345;0.9984;-0.0447]; angle = 5*pi/180; % angle of rotation in rad v = vec1 + tan(angle)*vec2; % length of ve...

| accepted

xlsreaderror: "Unable to resolve the name (filename)"
Change the statement to data_final = xlsread('Raw_data_2.xls');

How to do animation properly
Draw the cylinder first. Use the "rectangle" command in a loop to draw the piston, e.g., rectangle('position',[x,y,w,h],'FaceC...

| accepted

how to subtract/divide corresponding rows and columns of two tables?
put the tables in to two variables of matrices. Use element-wise operation: ./ or .*

coverting fortran to matlab
The following statements are wronng h(i,j) = ( h(i-1,j) + h(i+1,j) + h(i,j-1) + h(i,j+1)/4) ; .. e = abs(h(i,j)) ...

Question

Find the help for sim command in the MPC Toolbox
The sim command can be used to simulate Simulink models or MPC objects. How can I open the Help Browser from the command line fo...

### 1

About the correct connection method of SimscapeMultibody and Simscape block in the calculation of inverse dynamics.
You input torque to the revolute joint block in forward dynamics. Doucle click the block. Expand Actuation and set the Torque to...

Connect multiple joints to one solid
You should use a revolute joint between cylinder C and cyliner A. Use another revolute joint between the other end of cylinder C...

Can anyone please tell me in which release i find this example ?
Probably R2019a and newer. R2018b doesn't have the example.

How to determine if my equation is equal to, less that or more then 0?
The result of sqrt((b^2/(4*a^2))-(c/a)) is a complex number. You can't compare it with 0 (a real number) The formula for dampin...

| accepted

how to solve this ?
use s1 = a1*sin(w1*t+phi1), where w1=2*pi*f1 and t is time vector to generate signal 1. Do the the same for signal 2 and 3 and a...

| accepted

inherit from two classes simscape
Try the following: component MyComponent < MyBaseComponent1 % component implementation here end component MyExtend...

How to simulate a variable load
Nonlinear spring is the way to go if you want the force as a function of displacement.

How to fix an invalid data type
The winedata may contain some strange characters. Carefully exame elements of windata. Command class(A) should return 'double'. ...

Integral Approximation Equation Using Loop
Generate a vector x=[0 1/N 2/N ... 1]. Calculate corresponding y for each element of x. Use the trapezoid rule to add all the y...

Help in finding the matrix
You can use [row,col]=find( ) to get the location and use == to compare numbers

Simscape tablelookup input value
Several options: 1) use the Simscape built-in PS Lookup Table (2D) block instead of a custom block. 2) study the example here. 3...