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

Answered

Simple Matrix Reduction Question. Ones and Zeros.

[rows,cols]=find(A==1); [C,I]=sort(rows); B=cols(I)

Simple Matrix Reduction Question. Ones and Zeros.

[rows,cols]=find(A==1); [C,I]=sort(rows); B=cols(I)

3 hours ago | 0

| accepted

Answered

Integrating using sums(riemann sums)

You may use rsums. It allows you to interactively calculate the riemann sum integral: rsums(f,5,17.688) Riemann Sum Integral

Integrating using sums(riemann sums)

You may use rsums. It allows you to interactively calculate the riemann sum integral: rsums(f,5,17.688) Riemann Sum Integral

4 hours ago | 0

| accepted

Answered

how to solve equation with a function solution matlab

Try this: syms s H2new G1=1/(s-1); G2=s^2-s; H1=s^2-1; H2=-1/s; G=(G1*G2)/(1+G1*H1+G1*G2*H2); H1new=s^2+9*s-10; Gnew=(G1...

how to solve equation with a function solution matlab

Try this: syms s H2new G1=1/(s-1); G2=s^2-s; H1=s^2-1; H2=-1/s; G=(G1*G2)/(1+G1*H1+G1*G2*H2); H1new=s^2+9*s-10; Gnew=(G1...

5 hours ago | 1

Answered

Hi I want to generate a signal as a load follow input signal for 80%-50%-80% at 10% per minute for a nuclear power plant control system on simulink? I would be glad for help because i am stucked at this stage?

Run the attached model. I used Signal Builder block to create the input signal.

Hi I want to generate a signal as a load follow input signal for 80%-50%-80% at 10% per minute for a nuclear power plant control system on simulink? I would be glad for help because i am stucked at this stage?

Run the attached model. I used Signal Builder block to create the input signal.

7 hours ago | 0

| accepted

Answered

Taking data from matrix and using it in a function

As far as I understand, you want to change E1, E2, E3 and E4 respectively with combinations of -1 and 1. So the following code d...

Taking data from matrix and using it in a function

As far as I understand, you want to change E1, E2, E3 and E4 respectively with combinations of -1 and 1. So the following code d...

8 hours ago | 0

Answered

plot the exp function

syms y(t) eq=diff(y,2)+13*diff(y)+40*y==4; Dy=diff(y); Y(t)=dsolve(eq,[y(0)==0 Dy(0)==0]) t=0:0.001:0.9; plot(t,Y(t))

plot the exp function

syms y(t) eq=diff(y,2)+13*diff(y)+40*y==4; Dy=diff(y); Y(t)=dsolve(eq,[y(0)==0 Dy(0)==0]) t=0:0.001:0.9; plot(t,Y(t))

9 hours ago | 0

| accepted

Answered

What is better for differential equations - MATLAB or Simulink?

Simulink works numerically, you can not solve differential equations symbolically in Simulink. If you want to obtain symbolic so...

What is better for differential equations - MATLAB or Simulink?

Simulink works numerically, you can not solve differential equations symbolically in Simulink. If you want to obtain symbolic so...

9 hours ago | 0

Answered

I want to add a 45-degree line on my plot. I tried some ways (including refline) all give me a 38-degree line!

Try the following: figure(1);hold on; MONTHLY=scatter(X,Y); plot(0:600); %45 degree line plot(0:600,0.73*(0:600)+6.47); %tre...

I want to add a 45-degree line on my plot. I tried some ways (including refline) all give me a 38-degree line!

Try the following: figure(1);hold on; MONTHLY=scatter(X,Y); plot(0:600); %45 degree line plot(0:600,0.73*(0:600)+6.47); %tre...

9 hours ago | 1

| accepted

Answered

What is this Simulink Block called in the library browser?

That block seems to be a discretized sine wave. You can find it in Sources library. Also, you can discretize the Sine wave block...

What is this Simulink Block called in the library browser?

That block seems to be a discretized sine wave. You can find it in Sources library. Also, you can discretize the Sine wave block...

10 hours ago | 0

Answered

how do i check if a number is a prime number, a square, and or a factor of 6?

n=4; %check if number is prime isprime(n) %returns logical value %check if number is square mod(numel(factor(n)),2)==0 %retu...

how do i check if a number is a prime number, a square, and or a factor of 6?

n=4; %check if number is prime isprime(n) %returns logical value %check if number is square mod(numel(factor(n)),2)==0 %retu...

11 hours ago | 1

| accepted

Answered

How to solve 2nd order differential equations while variables are coupled?

Try the following code: syms w U1r(x) U1i(x) U2i(x) U2r(x) L m d eq1=(w-1)*U1r-diff(U1i)+L*U2r-m*diff(U1r,2)==0; eq2=(w+1)*U...

How to solve 2nd order differential equations while variables are coupled?

Try the following code: syms w U1r(x) U1i(x) U2i(x) U2r(x) L m d eq1=(w-1)*U1r-diff(U1i)+L*U2r-m*diff(U1r,2)==0; eq2=(w+1)*U...

11 hours ago | 0

| accepted

Answered

Matlab equivalent of in from python

exist command will do. Check its usage: https://www.mathworks.com/help/matlab/ref/exist.html

Matlab equivalent of in from python

exist command will do. Check its usage: https://www.mathworks.com/help/matlab/ref/exist.html

1 day ago | 0

Answered

Flipped numbers (number pyramid)

n=4; for i=1:n A(i)=str2double(string(sprintf('%d',1:i))); end disp(A)

Flipped numbers (number pyramid)

n=4; for i=1:n A(i)=str2double(string(sprintf('%d',1:i))); end disp(A)

1 day ago | 0

Answered

anyone can solve code y” + y’ =0 to find general solution

syms y(t) eq=diff(y,2)+diff(y)==0; y(t)=dsolve(eq)

anyone can solve code y” + y’ =0 to find general solution

syms y(t) eq=diff(y,2)+diff(y)==0; y(t)=dsolve(eq)

2 days ago | 0

Answered

asymptotic magnitude bode plot of fractional order transfer function

The following code should give you what you want: hold off; alpha=0.9;Wcr=2; w1=logspace(-1,log10(Wcr),1000);w2=logspace(log1...

asymptotic magnitude bode plot of fractional order transfer function

The following code should give you what you want: hold off; alpha=0.9;Wcr=2; w1=logspace(-1,log10(Wcr),1000);w2=logspace(log1...

2 days ago | 0

| accepted

Answered

the function of \n

newline For instance: chr = 'Whose woods these are I think I know.'; chr = [chr newline 'His house is in the village though']...

the function of \n

newline For instance: chr = 'Whose woods these are I think I know.'; chr = [chr newline 'His house is in the village though']...

2 days ago | 1

| accepted

Answered

How do I give order or number for "a" with ijk in the following code ? Please help me

What you are trying to do is not recommended in MATLAB since dynamically creating variables is not useful. You have several othe...

How do I give order or number for "a" with ijk in the following code ? Please help me

What you are trying to do is not recommended in MATLAB since dynamically creating variables is not useful. You have several othe...

2 days ago | 0

| accepted

Answered

If i try to write derivative of f in the below code(i pointed here), it doesn't work. why?

You do not have to use Symbolic approach this time. Try the following code: hold off; x1=2.5; f=@(x) x.*sqrt(x)+2*x.^3+1.5; %...

If i try to write derivative of f in the below code(i pointed here), it doesn't work. why?

You do not have to use Symbolic approach this time. Try the following code: hold off; x1=2.5; f=@(x) x.*sqrt(x)+2*x.^3+1.5; %...

3 days ago | 0

Answered

Vectorize for loop with recursion

P1(P4>0)=x; P2(P4<0)=x; P3=P1+P2; P4(2:end)=P3+P4(1:end-1);

Vectorize for loop with recursion

P1(P4>0)=x; P2(P4<0)=x; P3=P1+P2; P4(2:end)=P3+P4(1:end-1);

5 days ago | 0

Answered

How to create a clickable timeline using app designer, with play/pause button?

If I understood it correctly, you want to dynamically change the time limits of an axes property. The attached app may be a star...

How to create a clickable timeline using app designer, with play/pause button?

If I understood it correctly, you want to dynamically change the time limits of an axes property. The attached app may be a star...

5 days ago | 0

Answered

How to replace equations in symbolic function

By using subs function: syms a b x F=3*a*b; Fnew=subs(F,{a,b},{x,1})

How to replace equations in symbolic function

By using subs function: syms a b x F=3*a*b; Fnew=subs(F,{a,b},{x,1})

5 days ago | 0

| accepted

Answered

problem with function sinc

Adapt its formula as follows: x = 0:pi/100:2*pi; y=sin(pi*x)./(pi*x);%sinc function plot(y)

problem with function sinc

Adapt its formula as follows: x = 0:pi/100:2*pi; y=sin(pi*x)./(pi*x);%sinc function plot(y)

5 days ago | 1

| accepted

Answered

Plotting from a for loop- discrete maps

function [x] = logistic(lambda,x0,n) x(1) = x0; for i= 1:n x(i+1) = lambda*x(i)*(1-x(i)); z(i,:) = [i,x(i)]; di...

Plotting from a for loop- discrete maps

function [x] = logistic(lambda,x0,n) x(1) = x0; for i= 1:n x(i+1) = lambda*x(i)*(1-x(i)); z(i,:) = [i,x(i)]; di...

6 days ago | 0

| accepted

Answered

Aiming to solve function and have one of the variables be a minimum value:

The key point here is to define solx as a function of r. Try the following code: syms r x a = 100; Cp = .70; b = .50206; c ...

Aiming to solve function and have one of the variables be a minimum value:

The key point here is to define solx as a function of r. Try the following code: syms r x a = 100; Cp = .70; b = .50206; c ...

6 days ago | 0

| accepted

Answered

How to create this fucntion below

You can try the Symbolic approach: syms y(t) y(t)=piecewise(t<-1,0,t>=-1 & t<0,2,t>=0 & t<=1,-2,t>1,0); %plotting t=-5:0.001...

How to create this fucntion below

You can try the Symbolic approach: syms y(t) y(t)=piecewise(t<-1,0,t>=-1 & t<0,2,t>=0 & t<=1,-2,t>1,0); %plotting t=-5:0.001...

6 days ago | 0

| accepted

Answered

Can I input an m file into a simulink model as a function block? If so, how?

Use MATLAB Function block.

Can I input an m file into a simulink model as a function block? If so, how?

Use MATLAB Function block.

6 days ago | 1

Answered

Force Simulink Embedded Coder to do a simple cast when converting float to uint16?

Why don't you use a MATLAB Function block and write this line inside it? For example: y=uint16(x); This line should go inside ...

Force Simulink Embedded Coder to do a simple cast when converting float to uint16?

Why don't you use a MATLAB Function block and write this line inside it? For example: y=uint16(x); This line should go inside ...

6 days ago | 0