Answered
why I am getting 'array indices must be positive intergers or logical value' error?
Some of the posted code makes no sense, especially the break call in the for loop, since that will result in only the first valu...

5 years ago | 1

| accepted

Answered
Plotting a point in Matlab
One approach — x = pi; y = pi; figure plot(x, y, 'p') grid figure plot(x, y, 'p', 'MarkerSize',50) grid .

5 years ago | 0

Answered
getting error in line 5 please help
The error refers to ‘x2’ not being defined in ‘functin’: functin=@(x) (3*(-1-212*x)^2+(-1-212*x)-4*(4-170*x)-7)^2+(4-170*x-1-2...

5 years ago | 0

Answered
displaying symbolic function without i or j in the denominator
The usual procedure is to multiply the numerator and denominator by the complex conjugate of the denominator: syms omega tau r...

5 years ago | 0

| accepted

Answered
How do I convert descriptor state-space to transfer function?
This seems to work: A = [1 2; 3 4]; B = [5; 6]; C = [7 8; 9 10]; D = 0; E = [11 12; 13 14]; ss_sys = dss(A,B,C,D,E) tf...

5 years ago | 0

| accepted

Answered
have 3 chifre after E
One approach — expstr = @(x) [x(:).*10.^ceil(-log10(abs(x(:)+(x==0)))) floor(log10(abs(x(:)+(x==0))))]; % Updated: 2021 ...

5 years ago | 0

Answered
Save double vector in text file
Change the line that writes the vector to: fprintf(fileID, "%d ", midval); That should work, if you want to write each vector...

5 years ago | 0

Answered
How can i integrate this expression which includes matrices?
Try this — A = [1 2; 3 4]; B = [5; 6]; B_d = integral(@(sigma)expm(A.*sigma), 0, 1, 'ArrayValued',1)*B See the documentat...

5 years ago | 1

| accepted

Answered
data to transfer function (idfrd) error
If you want to see how well the data and identified system match, use the compare function.

5 years ago | 0

| accepted

Answered
s it possible to have double subscript in a figure label
I am not quite certain what you want, however that is possible. Using a LaTeX interpreter with: $A{_B}_C$ produces: So...

5 years ago | 1

| accepted

Answered
Problem using ode23, must return a column vector.
Multiply ‘dy’ by an appropriate vector of ones and it works. You need to determine if it produces the correct result. % K1...

5 years ago | 0

| accepted

Answered
How can I store the value of a variable from a function which is used by ode45?
I don’t see ‘u’, only ‘u1’ and ‘u2’. One solution is to not use numbered variables here (thiat might otherwise be appropriate...

5 years ago | 2

| accepted

Answered
anonymous function w/ accumarray
Naming your function ‘cat’ overshadows the existing MATLAB function by that name, that you inadvertently called when you used th...

5 years ago | 0

| accepted

Answered
How do I solve this problem at the optimization toolbox?
It would llikely be easier to just call ga from a script — lb = [-10 -6]; ub = [ 10 6]; nvars = 2; [Xr,fval,exitflag,outpu...

5 years ago | 0

| accepted

Answered
Command use to convert expression E to numeric form
If ‘E’ is a symbolic expression (we have no idea exactly what it is), then matlabFunction could be appropriate to turn it into a...

5 years ago | 1

Answered
first five natural frequencies
This was something of a challenge! I ended up dokng some of it offline because it took longer than the 55 seconds allowed in ...

5 years ago | 0

| accepted

Answered
I am not getting the meaning of this line k = 1:sze_x, what 1 signifies here? and what is the meaning of sze_x = size(x,2), what 2 signifies here?
The size function returns the maximum dimensions of its argument array, and the ‘2’ refers to the number of columns (second dime...

5 years ago | 0

| accepted

Answered
ODE graph for multiple occurrences
Define the vector (‘gammav’ here), use a loop, and see the documentation section on Passing Extra Parameters. tspan = [0 50]...

5 years ago | 0

Answered
How to draw the tangent line on a curve
Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/668953/Tan.xlsx') I = T1.I; V = ...

5 years ago | 1

| accepted

Answered
Determining heel strike using only kinematic data
I am not certain that I understand the problem. In these plots, it appears that the heel strike (orange lines) correspond to th...

5 years ago | 0

Answered
I am designing a filter for signal processing of the cnc milling machine data but I am unable to receive filtered signal
The filter appears to be stable, and appears to be essentially a highpass filter. See the documentation on buttord to understan...

5 years ago | 0

| accepted

Answered
Extracting data in a range
Try this — format short g A = [0.1, 2, 83, 1000; 0.4, 3, 79, 1001; 0.2, 4, 91, 1018; 0.3, 5, 75, 1095]; ...

5 years ago | 0

| accepted

Answered
filling missing values in column with obtained results
Try this — Order = [1 3 4 5 7 9 11].'; TBFi = [2993 5036 6150 6919 8862 11488 13545].'; Frequence = [6 24 32 41 59 76 94].';...

5 years ago | 0

| accepted

Answered
Non-Overlapping Moving Sum
Try this — Rain = [1,2,3,4,5,6,7,8,9,10]; rRain = reshape(Rain, 2, []) sumRain = sum(rRain) These could be combined into on...

5 years ago | 2

| accepted

Answered
Solve a system of four differential equations
Youor description is essentially correct. However, odeToVectorField does not ‘simplify’ the system, instead it converts it to a...

5 years ago | 1

| accepted

Answered
i wanna to plot the eulars formula on matlab with 3d plot
Try this — t = linspace(0, 3*pi); sig=2; x = cos(sig*t) + sin(sig*t)*1i; z = cos(sig*t); y = sin(sig*t)*i; figure plot...

5 years ago | 1

| accepted

Answered
How can I fix this error Index in position 2 exceeds array bounds (must not exceed 1).
Since ‘y’ is a (10001x1) column vector, there is no second column as referred to: y(floor(leny/n)*(t-1)+1 : floor(leny/n)*t,2)...

5 years ago | 2

| accepted

Answered
How to show axis in 3D
I am not certain what you are asking. If you want to see it in ‘true’ 3D, use the view function, and to change the axes LineW...

5 years ago | 0

| accepted

Answered
I am holding onto a scatter plot and adding data to it through a for loop. For each data set, I would like to label it in the legend but I am running into some problems.
I have no idea what the matrices are or what the different display names would be. One approach would be to get the variable ...

5 years ago | 0

| accepted

Answered
Looking for help on graphing
One approach — syms t uSol(t) = (2*exp(-(5*t)/8)*(39*cos((39^(1/2)*t)/8) + 5*39^(1/2)*sin((39^(1/2)*t)/8)))/39 figure fp...

5 years ago | 2

Load more