Someone who is interested in Mathematics, Control and Engineering. Also, music as a hobby.

Question

Receive Raw Ethernet Packet via Simulink

Hello, My question is simple: I would like to use Simulink, just like Wireshark, to capture and display raw ethernet packets. I...

4 months ago | 1 answer | 0

Answered

Derivate a function with two variable dependent of time

The following might help: syms r(t) theta(t) f(r,theta) f=r^2+0.2*cos(theta)-0.03 To take partial derivative, use functionalD...

Derivate a function with two variable dependent of time

The following might help: syms r(t) theta(t) f(r,theta) f=r^2+0.2*cos(theta)-0.03 To take partial derivative, use functionalD...

6 months ago | 0

Answered

define tau in transfer function

The following might help: syms s t tau Cs=(1/s)*(1/(tau*s+1)); c(t,tau)=ilaplace(Cs) T=0:0.01:1; plot(T,c(T,0.1))

define tau in transfer function

The following might help: syms s t tau Cs=(1/s)*(1/(tau*s+1)); c(t,tau)=ilaplace(Cs) T=0:0.01:1; plot(T,c(T,0.1))

6 months ago | 0

Question

Capabilities of Building Standalone Simulation Applications in App Designer with Simulink Compiler

Hello everyone, For those who do not know, MATLAB released Simulink Compiler with 20a release which helps to build and deploy s...

6 months ago | 0 answers | 0

Answered

How is derivative made in Matlab ?

syms v(t) v(t)=t.^3-6t.^2+7; a(t)=diff(v); result=a(3.5)

How is derivative made in Matlab ?

syms v(t) v(t)=t.^3-6t.^2+7; a(t)=diff(v); result=a(3.5)

6 months ago | 0

| accepted

Answered

Replacing characters in a string

One example(use regexprep): s="Yao Ming"; regexprep(s,{'Y','M'},{'J','Q'})

Replacing characters in a string

One example(use regexprep): s="Yao Ming"; regexprep(s,{'Y','M'},{'J','Q'})

7 months ago | 0

Answered

How to update a variable in a function after every 5 seconds?

Run the attached model and see the results. You can change the Ramp block's Slope value and store different numbers. Output of t...

How to update a variable in a function after every 5 seconds?

Run the attached model and see the results. You can change the Ramp block's Slope value and store different numbers. Output of t...

7 months ago | 0

Answered

Function like "find" but for lines

B=reshape(A.',1,[]); C=(1:numel(A)).*(B~=0); C=C(C~=0)

Function like "find" but for lines

B=reshape(A.',1,[]); C=(1:numel(A)).*(B~=0); C=C(C~=0)

7 months ago | 0

Answered

Matrix with numeric values

N=4 A=1:N; B=char(64+A) 'ABCD' B(1) 'A' B(2) 'B' . . and so on. Change N and observe the results.

Matrix with numeric values

N=4 A=1:N; B=char(64+A) 'ABCD' B(1) 'A' B(2) 'B' . . and so on. Change N and observe the results.

7 months ago | 0

| accepted

Answered

Solving non linear 2nd order differential equation

Try this: clear syms t Y0= input('wave amplitude ') ; %Wave ampli...

Solving non linear 2nd order differential equation

Try this: clear syms t Y0= input('wave amplitude ') ; %Wave ampli...

7 months ago | 0

| accepted

Answered

y[n] = x[n] - x[n-1] x[n-2] I need to find a) Find the transfer function. b) Give the impulse response. d) Sketch the frequency respo

Try this: z=tf('z',0.001); Gz=1-z^-1+z^-2; %%transfer function Gs=d2c(Gz,'tustin') %%impulse response figure(1); impulse(...

y[n] = x[n] - x[n-1] x[n-2] I need to find a) Find the transfer function. b) Give the impulse response. d) Sketch the frequency respo

Try this: z=tf('z',0.001); Gz=1-z^-1+z^-2; %%transfer function Gs=d2c(Gz,'tustin') %%impulse response figure(1); impulse(...

7 months ago | 0

Answered

How can I remove identical cell entries containing small arrays

The following code should simply do the job for you: unique(cell2mat(connect_group),'rows') After this, you can regroup the ar...

How can I remove identical cell entries containing small arrays

The following code should simply do the job for you: unique(cell2mat(connect_group),'rows') After this, you can regroup the ar...

7 months ago | 0

Answered

Simulink-Sawtooth Decrease Counter

Try the attached model. Note that I didn't use Pulse Generator or Detect Decrease or Sum or Memory block. The model is very simp...

Simulink-Sawtooth Decrease Counter

Try the attached model. Note that I didn't use Pulse Generator or Detect Decrease or Sum or Memory block. The model is very simp...

7 months ago | 0

Answered

how can I do this in mat lab

syms u(t) x(t) h(t) u(t)=piecewise(t>=0,1,0); x(t)=cos(pi*t)*(u(t)-u(t-1)); h(t)=1.5*(u(t)-u(t-1.5)); %%plot t=0:0.001:5; ...

how can I do this in mat lab

syms u(t) x(t) h(t) u(t)=piecewise(t>=0,1,0); x(t)=cos(pi*t)*(u(t)-u(t-1)); h(t)=1.5*(u(t)-u(t-1.5)); %%plot t=0:0.001:5; ...

7 months ago | 0

| accepted

Answered

Plotting the derivative of an "switch-funktion"

You may use Symbolic Toolbox and its beauties for this case :) Here is the code: syms y1(t) y2(t) y3(t) y4(t) y1(t)=piecewise(...

Plotting the derivative of an "switch-funktion"

You may use Symbolic Toolbox and its beauties for this case :) Here is the code: syms y1(t) y2(t) y3(t) y4(t) y1(t)=piecewise(...

7 months ago | 0

| accepted

Answered

How can i fix the error 'Index exceeds the number of array elements (51)'

You need to apply elementwise division: x = [0:0.1:5]; y = sin(x)./x; plot(x, y), xlabel('xi'), ylabel('Theta'), title('Solut...

How can i fix the error 'Index exceeds the number of array elements (51)'

You need to apply elementwise division: x = [0:0.1:5]; y = sin(x)./x; plot(x, y), xlabel('xi'), ylabel('Theta'), title('Solut...

7 months ago | 1

| accepted

Answered

How can I determine which values in vector X are NOT in vector Y?

Z=~ismember(x,y) It will return 0 0 0 which means every element in vector X are also in vector Y.

How can I determine which values in vector X are NOT in vector Y?

Z=~ismember(x,y) It will return 0 0 0 which means every element in vector X are also in vector Y.

7 months ago | 0

Answered

plot signal of time domain

syms x(t) x(t)=sin(2*pi*0.1*t); t=0:0.001:10; plot(t,x(-2*t+3))

plot signal of time domain

syms x(t) x(t)=sin(2*pi*0.1*t); t=0:0.001:10; plot(t,x(-2*t+3))

7 months ago | 0

Answered

how do i plot step response of a system using fourier transform?

If you are dealing with s domain, you need to use ilaplace. Try this: syms t; G = tf([1], [1 0.9 5]); [num,den] = tfdata(G); ...

how do i plot step response of a system using fourier transform?

If you are dealing with s domain, you need to use ilaplace. Try this: syms t; G = tf([1], [1 0.9 5]); [num,den] = tfdata(G); ...

7 months ago | 0

Answered

Matrix Loop Code Question

P_resultant=cumsum([400 -Loss]); P_resultant(1)=[]

Matrix Loop Code Question

P_resultant=cumsum([400 -Loss]); P_resultant(1)=[]

7 months ago | 0

Answered

Covert cell array to array

Something like this? Array=cell2mat(CellArrar.')

Covert cell array to array

Something like this? Array=cell2mat(CellArrar.')

7 months ago | 1

| accepted

Solved

Doubling elements in a vector

Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

7 months ago

Solved

Remove all the words that end with "ain"

Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

7 months ago

Answered

Plotting the solution to a system of second order differential equations

Is there a way I can generate a single plot instead of four plots, for example, the plot of θ(t) vs x(t)? Yes you can, with th...

Plotting the solution to a system of second order differential equations

Is there a way I can generate a single plot instead of four plots, for example, the plot of θ(t) vs x(t)? Yes you can, with th...

7 months ago | 0

| accepted

Answered

Change detection using simulink

I tried to make a model for you, where I tried to build a signal based on your description. Please click on the Signal Builder b...

Change detection using simulink

I tried to make a model for you, where I tried to build a signal based on your description. Please click on the Signal Builder b...

7 months ago | 0

Answered

Typing a long and complicated equation

syms y(t) eq=2*pi*(sqrt((y-44.56)/(-0.16))+1)*sqrt(1+((1)/(-0.32*((sqrt((y-44.56)/(-0.16))+1))+0.32))^2)

Typing a long and complicated equation

syms y(t) eq=2*pi*(sqrt((y-44.56)/(-0.16))+1)*sqrt(1+((1)/(-0.32*((sqrt((y-44.56)/(-0.16))+1))+0.32))^2)

7 months ago | 0

| accepted

Answered

i have a problem with simulink when run simulation it's stop in 2%

Go to Configuration Parameters->Solver section and choose Fixed Step solver and its type as ode5. Then, set the sample time as 0...

i have a problem with simulink when run simulation it's stop in 2%

Go to Configuration Parameters->Solver section and choose Fixed Step solver and its type as ode5. Then, set the sample time as 0...

7 months ago | 0

| accepted

Answered

Maximum and Minimum values of a field structure array

%find max and min population [Cmax,maxIdx]=max(AustralianStates.Population) [Cmin,minIdx]=min(AustralianStates.Population) %f...

Maximum and Minimum values of a field structure array

%find max and min population [Cmax,maxIdx]=max(AustralianStates.Population) [Cmin,minIdx]=min(AustralianStates.Population) %f...

7 months ago | 0

Answered

How to exclude certain rows and columns based on a column value?

Firstly, at your first line of code, you started checking from the beginning of a. Instead, you should be checking the 23rd colu...

How to exclude certain rows and columns based on a column value?

Firstly, at your first line of code, you started checking from the beginning of a. Instead, you should be checking the 23rd colu...

7 months ago | 0

| accepted