Answered

how to convert the fraction part into intger?

Use ceil(K) or floor(K) depending on how you want to round off the fractions. or int8(K) or int16(K) or int32(K) ...

how to convert the fraction part into intger?

Use ceil(K) or floor(K) depending on how you want to round off the fractions. or int8(K) or int16(K) or int32(K) ...

ein Tag ago | 0

Answered

Element-wise Complex Magnitude Calculation

Why don't you just put it in a loop like this: A = rand(5,1) + i*rand(5,1); % Assume this is your array B=zeros(length(A),1); ...

Element-wise Complex Magnitude Calculation

Why don't you just put it in a loop like this: A = rand(5,1) + i*rand(5,1); % Assume this is your array B=zeros(length(A),1); ...

2 Tage ago | 0

Answered

Compare two strings present in excel?

Is this what you are looking for? %% Import the data [~, ~, raw] = xlsread('C:\Users\User\Documents\MATLAB\TEST.xls','Sheet1')...

Compare two strings present in excel?

Is this what you are looking for? %% Import the data [~, ~, raw] = xlsread('C:\Users\User\Documents\MATLAB\TEST.xls','Sheet1')...

2 Tage ago | 0

| accepted

Answered

Value of variable after passing one simulation cycle

Ok this is not going to serve your purpose. There is a reason its called simulation Cycle/Cycle time. The whole model (including...

Value of variable after passing one simulation cycle

Ok this is not going to serve your purpose. There is a reason its called simulation Cycle/Cycle time. The whole model (including...

2 Tage ago | 0

| accepted

Answered

Define a matrix in simulink whose elements are evaluated at some other functions in the same model

"to workspace" block updates that workspace after end of simulation. Instead you can use the data store memory block. Use a data...

Define a matrix in simulink whose elements are evaluated at some other functions in the same model

"to workspace" block updates that workspace after end of simulation. Instead you can use the data store memory block. Use a data...

2 Tage ago | 0

Answered

Need Instantaneous PID Value

"The output I am getting is in 3x1 tf format" - This is correct because as per definition 'pid' command creates a continuous-ti...

Need Instantaneous PID Value

"The output I am getting is in 3x1 tf format" - This is correct because as per definition 'pid' command creates a continuous-ti...

6 Tage ago | 0

| accepted

Answered

I'm using the input command, with multiple inputs. I don't want the user to have to re-enter all the inputs if an error occurs.

I would recommend not to use 'error' as program will stop and exit execution everytime an error occurs. Next time it will always...

I'm using the input command, with multiple inputs. I don't want the user to have to re-enter all the inputs if an error occurs.

I would recommend not to use 'error' as program will stop and exit execution everytime an error occurs. Next time it will always...

6 Tage ago | 1

| accepted

Answered

LQR for tracking error minimization

1) Standard discrete cost function is J = Sum {x'Qx + u'Ru + 2*x'Nu}. In your case N=0. 2) "I suppose I have to use u =referen...

LQR for tracking error minimization

1) Standard discrete cost function is J = Sum {x'Qx + u'Ru + 2*x'Nu}. In your case N=0. 2) "I suppose I have to use u =referen...

7 Tage ago | 0

Answered

TO WORKSPACE FROM MATLAB

Create the data as a timeseries. See details here: https://in.mathworks.com/help/matlab/ref/timeseries.html For your case: t=...

TO WORKSPACE FROM MATLAB

Create the data as a timeseries. See details here: https://in.mathworks.com/help/matlab/ref/timeseries.html For your case: t=...

7 Tage ago | 0

| accepted

Answered

how to read lots of file and plot them

You can use this: for ii=1:54 % Number of S set of files for jj=1:3 % Number of sub files for each S index if ...

how to read lots of file and plot them

You can use this: for ii=1:54 % Number of S set of files for jj=1:3 % Number of sub files for each S index if ...

8 Tage ago | 0

| accepted

Answered

Could anyone help me to solve the issue in the following code

May not be the best way but it works: rows_matrix=reshape(unused_rows,[],2) rows_matrix=[rows_matrix(:,1) [sort(rows_matrix(1:...

Could anyone help me to solve the issue in the following code

May not be the best way but it works: rows_matrix=reshape(unused_rows,[],2) rows_matrix=[rows_matrix(:,1) [sort(rows_matrix(1:...

9 Tage ago | 0

| accepted

Answered

how can i separate a matrix into a multiplication of two matrices One of Real Values and the Other for Integer values.

There are infinite combinations possible (atleast by theory) in which you can split a real number to multiplication of a real nu...

how can i separate a matrix into a multiplication of two matrices One of Real Values and the Other for Integer values.

There are infinite combinations possible (atleast by theory) in which you can split a real number to multiplication of a real nu...

9 Tage ago | 0

Answered

Outputting more than one value into Simulink system using Matlab function block

There are two things here. 1) Your function code is wrong at many places. You will have to rewrite it: function D = BAT(P) % S...

Outputting more than one value into Simulink system using Matlab function block

There are two things here. 1) Your function code is wrong at many places. You will have to rewrite it: function D = BAT(P) % S...

9 Tage ago | 0

Answered

c2d convert to discrete time function with derivatives

Ok so your question is lacking a few crucial details and possible something is not right here. From the matrix you have given ...

c2d convert to discrete time function with derivatives

Ok so your question is lacking a few crucial details and possible something is not right here. From the matrix you have given ...

9 Tage ago | 0

| accepted

Answered

Licence Manager Error 15

Error-15 means that the workstation is not able to contact the server. See here: https://in.mathworks.com/help/polyspace_ada/po...

Licence Manager Error 15

Error-15 means that the workstation is not able to contact the server. See here: https://in.mathworks.com/help/polyspace_ada/po...

12 Tage ago | 0

Answered

How to clip a sine wave on both side in SIMULINK?

Use saturation block. Set the saturator limits as the value where you want to chip the sine wave and you are done!!

How to clip a sine wave on both side in SIMULINK?

Use saturation block. Set the saturator limits as the value where you want to chip the sine wave and you are done!!

12 Tage ago | 0

| accepted

Answered

hi every one, can i get help to make this, thank you

You are almost there. What is the problem? Just use: K=[a1 b1 c1; a1 b1 c2; a1 b2 c1; a1 b2 c2; a2 b1 c1; a2 b1 c2;...

hi every one, can i get help to make this, thank you

You are almost there. What is the problem? Just use: K=[a1 b1 c1; a1 b1 c2; a1 b2 c1; a1 b2 c2; a2 b1 c1; a2 b1 c2;...

12 Tage ago | 0

| accepted

Solved

Which values occur exactly three times?

Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

12 Tage ago

Solved

Determine if input is odd

Given the input n, return true if n is odd or false if n is even.

12 Tage ago

Answered

Remove DC offset from input signal

So basically you have an aperiodic set of data with unknown DC bias value. As I had asked, if the offset is a constant value the...

Remove DC offset from input signal

So basically you have an aperiodic set of data with unknown DC bias value. As I had asked, if the offset is a constant value the...

12 Tage ago | 0

Answered

could anyone help me to solve the issue with respect to the following code

Use this: x=[0 1 2 3 4 5 6 7 8 9 10] A = [0 0.62 0.85 0.86 0.87 0.88 0.89 0.90 0.91 0.92 0.93] B = [0 0.32 0.60 0.75 0.86 0.9...

could anyone help me to solve the issue with respect to the following code

Use this: x=[0 1 2 3 4 5 6 7 8 9 10] A = [0 0.62 0.85 0.86 0.87 0.88 0.89 0.90 0.91 0.92 0.93] B = [0 0.32 0.60 0.75 0.86 0.9...

12 Tage ago | 0

| accepted

Answered

Index exceeds matrix dimensions. where is mistake

In line number 17 you have defined size = 4; which you are using in your 'for' loop at line 19. This variable is clashing with...

Index exceeds matrix dimensions. where is mistake

In line number 17 you have defined size = 4; which you are using in your 'for' loop at line 19. This variable is clashing with...

13 Tage ago | 1

Answered

Using generated code in a simulink model

This should help: https://in.mathworks.com/help/simulink/ug/incorporate-c-code-using-a-matlab-function-block.html

Using generated code in a simulink model

This should help: https://in.mathworks.com/help/simulink/ug/incorporate-c-code-using-a-matlab-function-block.html

13 Tage ago | 0

Answered

Code generator in simulink

See if this helps: https://in.mathworks.com/matlabcentral/answers/415603-where-is-the-build-button-in-code-generation?s_tid=ans...

Code generator in simulink

See if this helps: https://in.mathworks.com/matlabcentral/answers/415603-where-is-the-build-button-in-code-generation?s_tid=ans...

14 Tage ago | 0

| accepted

Answered

Transfer Function,fourth-Order

A=rand(4,4) % 4th order system B= rand(4,2) % Assuming you have two inputs C=ones(size(A)) D=zeros(size(B)) system=ss(A,B,C,...

Transfer Function,fourth-Order

A=rand(4,4) % 4th order system B= rand(4,2) % Assuming you have two inputs C=ones(size(A)) D=zeros(size(B)) system=ss(A,B,C,...

14 Tage ago | 1

| accepted

Answered

how to find data?

First of all 2.9377e+03=2937.7 and not 29377 as you are looking for. So relook into that. Secondly, i think its just accuracy e...

how to find data?

First of all 2.9377e+03=2937.7 and not 29377 as you are looking for. So relook into that. Secondly, i think its just accuracy e...

14 Tage ago | 0

Answered

How to delay time-domain signals other than adding zeros at the beginning

You can use delayseq Well, this also adds zeros at the beginning of your signal but you are not doing it manually and not alter...

How to delay time-domain signals other than adding zeros at the beginning

You can use delayseq Well, this also adds zeros at the beginning of your signal but you are not doing it manually and not alter...

14 Tage ago | 0

Answered

Simulink If function to change the out put based on input

Use sign function output = myfunc(input) output=sign(input); end BTW what happens if input is zero? you have not mentioned t...

Simulink If function to change the out put based on input

Use sign function output = myfunc(input) output=sign(input); end BTW what happens if input is zero? you have not mentioned t...

16 Tage ago | 0

| accepted

Answered

In MATLAB we use tf2ss, similarly how can we Implement this in simulink

Why not use the transfer function block directly instead of converting it to state space model? Anyways, you can use 'Matlab fun...

In MATLAB we use tf2ss, similarly how can we Implement this in simulink

Why not use the transfer function block directly instead of converting it to state space model? Anyways, you can use 'Matlab fun...

20 Tage ago | 0

Answered

transfer function using matlab s-function

See here: https://in.mathworks.com/help/simulink/sfg/s-function-examples.html Under the section "C S-Function Examples" you ca...

transfer function using matlab s-function

See here: https://in.mathworks.com/help/simulink/sfg/s-function-examples.html Under the section "C S-Function Examples" you ca...

26 Tage ago | 0