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

Question

TMS320F28379D: Code Generation Error while Using CLA Task Trigger block in Simulink

Hello, I am using Launchpad F28379D in Simulink. I have a problem while generating code for a CLA Task triggered subsystem whic...

2 months ago | 0 answers | 0

Answered

Numerical Integration from -Inf to Inf

Try the symbolic approach and consider the problem as follows: syms x F(x)=x*(x+0.1)^2*exp(2*(x+0.1)^2*3^2)*exp(-x^2); After ...

Numerical Integration from -Inf to Inf

Try the symbolic approach and consider the problem as follows: syms x F(x)=x*(x+0.1)^2*exp(2*(x+0.1)^2*3^2)*exp(-x^2); After ...

3 months ago | 0

Answered

Helping solving two variables in an equation

Try the following: Kt=[12 -1; -1 3]; I=[1 0;0 1]; lambda1=2.8902; w1=1.7001; V1=sym('V1',[2 1]); eqn=((Kt-lambda1*I)*V1)==...

Helping solving two variables in an equation

Try the following: Kt=[12 -1; -1 3]; I=[1 0;0 1]; lambda1=2.8902; w1=1.7001; V1=sym('V1',[2 1]); eqn=((Kt-lambda1*I)*V1)==...

3 months ago | 1

| accepted

Answered

Error when compiling with CLA on TI C2000 MCU in Simulink. Can't find "cla_header.h"

How did you solve this problem?

Error when compiling with CLA on TI C2000 MCU in Simulink. Can't find "cla_header.h"

How did you solve this problem?

3 months ago | 0

Answered

Looping a matrix to find determinant

Following way can be a starting point: A=randi([1 5],8267,4);%%random data for i=1:max(size(A))-3 DetVal(i)=det(A(i:i+3,1...

Looping a matrix to find determinant

Following way can be a starting point: A=randi([1 5],8267,4);%%random data for i=1:max(size(A))-3 DetVal(i)=det(A(i:i+3,1...

11 months ago | 0

Answered

How to extract two equal maximum values at different index

index=find(A==max(A)) This should give you the indexes.

How to extract two equal maximum values at different index

index=find(A==max(A)) This should give you the indexes.

11 months ago | 0

| accepted

Question

Strange behavior of diff function with symbolic variables

Hello everyone, There is a strange behavior that I encountered while using diff function with symbolic variables, not functions...

1 year ago | 1 answer | 0

Answered

Assign different value of step response to a transfer function at different time intervals

You can do it with a Signal Builder. I attached the Simulink model. Take a look.

Assign different value of step response to a transfer function at different time intervals

You can do it with a Signal Builder. I attached the Simulink model. Take a look.

1 year ago | 0

Answered

how to plot constant gain with bode

To plot Bode of constant, define it as a transfer function but in the following way: Gs=tf(R1/(R1+R2),1); bode(Gs);

how to plot constant gain with bode

To plot Bode of constant, define it as a transfer function but in the following way: Gs=tf(R1/(R1+R2),1); bode(Gs);

1 year ago | 0

| accepted

Answered

How to write time dependent exponential with simple Simulink blocks

Try this attached model.

How to write time dependent exponential with simple Simulink blocks

Try this attached model.

1 year ago | 0

Answered

"solve " function returns inaccurate solutions

Try this: syms x assume(x,'real'); solx=vpasolve(x-sqrt(x+1)-sqrt(x-1)==0,x) or syms x assume(x,'real'); solx=vpa(solve(x...

"solve " function returns inaccurate solutions

Try this: syms x assume(x,'real'); solx=vpasolve(x-sqrt(x+1)-sqrt(x-1)==0,x) or syms x assume(x,'real'); solx=vpa(solve(x...

1 year ago | 0

Answered

matching from multiple arrays

One way: Result=double(ref & (ref==a{1} | ref==a{2} | ref==a{3}))

matching from multiple arrays

One way: Result=double(ref & (ref==a{1} | ref==a{2} | ref==a{3}))

1 year ago | 0

Answered

Just wondering how to I plot these functions into Matlab?

Try this: syms x(t) h(t) x(t)=piecewise(t>=-1 & t<=1,1,t<-1 | t>1,0) h(t)=rectangularPulse((t-1)/4) t=-5:0.01:5; ...

Just wondering how to I plot these functions into Matlab?

Try this: syms x(t) h(t) x(t)=piecewise(t>=-1 & t<=1,1,t<-1 | t>1,0) h(t)=rectangularPulse((t-1)/4) t=-5:0.01:5; ...

1 year ago | 0

Answered

How to construct a vector from specific elements in a matrix

B=[A(1,2);A(2,3);A(3,1)]

How to construct a vector from specific elements in a matrix

B=[A(1,2);A(2,3);A(3,1)]

1 year ago | 1

| accepted

Answered

How to delay a boolean signal by an amount of time?

Simply, use a *Delay* block. See the attached pictures for details.

How to delay a boolean signal by an amount of time?

Simply, use a *Delay* block. See the attached pictures for details.

1 year ago | 0

| accepted

Answered

I can I do logical indexing on a column

Is it possible for a value to be smaller than -8 and greater than 8 at the same time? Check your logical operator. You need _OR_...

I can I do logical indexing on a column

Is it possible for a value to be smaller than -8 and greater than 8 at the same time? Check your logical operator. You need _OR_...

1 year ago | 0

| accepted

Answered

Simulink write to array index

Of course it can be done. Check the attached files.

Simulink write to array index

Of course it can be done. Check the attached files.

1 year ago | 1

Answered

NEED HELP IN MATLAB GUI FOR FOLLOWING CODE

Check the attached zip file. In screenshot, you will see how to enter x and y vectors and you will see that you obtain the resul...

NEED HELP IN MATLAB GUI FOR FOLLOWING CODE

Check the attached zip file. In screenshot, you will see how to enter x and y vectors and you will see that you obtain the resul...

1 year ago | 0

| accepted

Answered

Can I get the formula from the result value?

You may use *Curve Fitting Toolbox* for adapting formula(or function let's say) for your input and output values. There are seve...

Can I get the formula from the result value?

You may use *Curve Fitting Toolbox* for adapting formula(or function let's say) for your input and output values. There are seve...

1 year ago | 0

| accepted

Answered

I have a row vector consisting of 200 engine speeds. I want to feed one value at a time into an alternator block. How do I do it?

Use *From Workspace* block. Define your data at your workspace, and also define a time vector. These two vectors should be nx1, ...

I have a row vector consisting of 200 engine speeds. I want to feed one value at a time into an alternator block. How do I do it?

Use *From Workspace* block. Define your data at your workspace, and also define a time vector. These two vectors should be nx1, ...

1 year ago | 0

| accepted

Answered

Stuck with symbolic variables

You need to also convert your numerical array into *symbolic* so that things will be possible. For instance: c=sym(c) c(...

Stuck with symbolic variables

You need to also convert your numerical array into *symbolic* so that things will be possible. For instance: c=sym(c) c(...

1 year ago | 0

| accepted

Answered

function [CM KG]=STtosi(In,Ib) It is not working

Since you did not mention why the function is not working, it may have two reasons: - Firstly, you need to save your function...

function [CM KG]=STtosi(In,Ib) It is not working

Since you did not mention why the function is not working, it may have two reasons: - Firstly, you need to save your function...

1 year ago | 0

| accepted

Answered

Why do I receive an error message about output arguments for my Embedded MATLAB Function in Simulink?

Simulink wants to know the initial value and size of your output at the very beginning of the simulation. Therefore, add D=0...

Why do I receive an error message about output arguments for my Embedded MATLAB Function in Simulink?

Simulink wants to know the initial value and size of your output at the very beginning of the simulation. Therefore, add D=0...

1 year ago | 0

Answered

Summing the diagonal of a matrix "the other way"?

This can be done as follows: res=[sum(diag(fliplr(A),3)) sum(diag(fliplr(A),2)) sum(diag(fliplr(A),1)) sum(diag(fliplr(A)))]...

Summing the diagonal of a matrix "the other way"?

This can be done as follows: res=[sum(diag(fliplr(A),3)) sum(diag(fliplr(A),2)) sum(diag(fliplr(A),1)) sum(diag(fliplr(A)))]...

1 year ago | 1

| accepted

Answered

Error states 'Subscript indices must either be real positive integers or logicals' when trying to complete this for loop?

You can not subscript *element zero* of an array. Change your for loop to for i = 1:numel(range) Ti_in(i) = Ti_in -((I...

Error states 'Subscript indices must either be real positive integers or logicals' when trying to complete this for loop?

You can not subscript *element zero* of an array. Change your for loop to for i = 1:numel(range) Ti_in(i) = Ti_in -((I...

1 year ago | 0

Answered

can anybody help me with the error?

Make sure that _TrainFeature_ (I assume it is a function) is located in your current working directory.

can anybody help me with the error?

Make sure that _TrainFeature_ (I assume it is a function) is located in your current working directory.

1 year ago | 0

Answered

How to generate values between 5 and 4 with difference 0.1 without subtract symbol?

5:-0.1:4

How to generate values between 5 and 4 with difference 0.1 without subtract symbol?

5:-0.1:4

1 year ago | 1

| accepted

Answered

How do I perform Partial differential equation by Simulink?

You can't. Only numerical derivatives with respect to time can be calculated in Simulink.

How do I perform Partial differential equation by Simulink?

You can't. Only numerical derivatives with respect to time can be calculated in Simulink.

1 year ago | 0

| accepted

Answered

What does 'y:' stand for in plot command?

It means a _dotted yellow line_. For that, you may check the documentation of *plot* command. That third input argument decides ...

What does 'y:' stand for in plot command?

It means a _dotted yellow line_. For that, you may check the documentation of *plot* command. That third input argument decides ...

1 year ago | 0

| accepted