Answered
Plotting high frequency EDF data from timetable
I do not have your data, however using the MATLAB sample data, extracting the entire record of each variable may not be difficul...

4 years ago | 1

| accepted

Answered
Laplace Transform of the function : x''(t) - 6x'(t) + 8x(t) = H(t-2); x(0) = 0 , x'(0) = 0. When executed I get 'str2sym error' and errors in line 174, 165 and 154.
In recent MATLAB versions, quoted character array arguments are no loonger supported. That was likely the cause of the reported...

4 years ago | 0

| accepted

Answered
Kindly help to solve this task on getting the last digit of a string.
Another approach — rollnumber=5612 lastDigit = rem(rollnumber, 10) .

4 years ago | 0

Answered
How can I fit a sideways polynomial?
Reverse the usual ‘x’ and ‘y’ assignments for the parabola — y1 = linspace(-0.6, 0.6); x1 = y1.^2 + 0.08; x2 = linspace(0....

4 years ago | 1

Answered
solve unknown constants A, B and C
Define ‘Mxy‘, ‘Mx’, and ‘Qx’ in the syms declaration if no values ared defined for them. %% I try to calculate the three unkn...

4 years ago | 1

| accepted

Answered
Error using cppelt - findchangepts function
Your findchangepts call works correctly when I test it here — t = linspace(0, 10); data = +(t>4.5); ...

4 years ago | 0

Answered
How do I input numerical values to variables stored as symbols?
Assign each subs call to ‘TF’ and it works correctly — syms th ia s Ea X1 X2 Fc syms Jm Bc Kt Kc Kb m1 m2 rg N R L Bm th=(...

4 years ago | 1

| accepted

Answered
my code is getting the sum of all the numbers under the positive numbers and not letting the negative numbers get summed separately.
The if block should be: if num > 0 positive_num = positive_num + num; else negative_num = negative_...

4 years ago | 0

| accepted

Answered
How to save data from a loop as a vector?
There are different ways to do this. This approach simply concatenates them as the third dimension of a (4x4xnumel(B)) array ...

4 years ago | 0

| accepted

Answered
LaPlace transform, magnitude, poles.
I don’t recognise ‘poly2str’ and the only MATLAB function I can find that would be similar is poly2sym. Taking a shortcut, tr...

4 years ago | 1

| accepted

Answered
why dosen't out put as short answer?
Because it is symbolic, not numeric. To get a numeric result use either vpa or double — syms y R1=(nthroot(y-2,3)+2); R2=...

4 years ago | 0

| accepted

Answered
Solving 2nd Order Differential Equation Symbolically
The constants are the initial condition. They must be defined. syms y(x) y0 Dy = diff(y); D2y = diff(y,2); ode = D2y + ...

4 years ago | 0

| accepted

Answered
Colorbar not working as expected
See if: scatter3(x,y,z,50,a,'filled') will do what you want. The fourth argument to scatter3 is the size, and the fifth is...

4 years ago | 0

| accepted

Answered
I am using the least squares method but i have a problem for defining my step input. Please anyone can check my code will be appreciate.
I believe the problem is the definition of ‘u’ so see if my creating it as an anoonymous function works — T0 = 0; Ts = 1; Tf...

4 years ago | 0

Answered
Help with readmatrix function
I’m not certain that I understand what’s actually in the file. If the first line are headers for each column, use readtable i...

4 years ago | 0

| accepted

Answered
Cannot Substitute numeric values to a sym expression due to different number of elements
The easiest way to deal with that is to save it as a cell array, and then sort out the results later — theta_s_t{i} = subs(the...

4 years ago | 0

| accepted

Answered
Find exponent of equation
Try something like this — P = rand(10,1); % Create Data B = rand(10,1); ...

4 years ago | 1

Answered
How can you Convert Sym to Double when the sym has already been numerically solved?
Use the double funciton.

4 years ago | 1

| accepted

Answered
showing contour values on plot
The fcontour function does not have a 'ShowText' property, so overplot it with a normal contour plot and set 'ShowText','on' to ...

4 years ago | 0

| accepted

Answered
Finding the gradient of the function
Symbolically — syms a11 z1 sympref('AbbreviateOutput',false); k1 = atan(((0.02 + a11)./z1)) + atan((0.03 - a11)./z1) grad_...

4 years ago | 0

| accepted

Answered
I have query in graph plotting.
Using fsurf — G = @(a11,z1) atan(((0.03 + a11)./z1)) + atan((0.05 - a11)./z1); G1 = @(a11,z1) atan(((0.03 + a11)./z1)); G2 =...

4 years ago | 0

Answered
Finding the value of the below curve
Using findpeaks — z1 = [0.00008 0.009]'; a11 = -2:0.002:2; k1 = atan(((0.02 + a11)./z1)) + atan((0.03 - a11)./z1); [pk1,loc...

4 years ago | 0

Answered
Solve equation by fzeros
It is straightforward to find all the roots. One approach — N = 6; x = linspace(-N, N); y = x-4*sin(x); zxi = find(dif...

4 years ago | 1

Answered
Genetic Algorithm Plot fval vs. generation
Use: options = optimoptions('ga','PlotFcn', @gaplotbestf); [gax,fval,termination,info]=ga(@three_var,3,[],[],[],[],lb,ub,[],[...

4 years ago | 0

| accepted

Answered
I am trying to use the rectangular pulse function, but I am not sure how to use it correctly to solve a Fourier problem.
It needs to have the beginning and end defined, and an arbitrary argument for the independent variable (here ‘t’) — syms omega...

4 years ago | 0

| accepted

Answered
Discret low-pass-filter for velocity data
That the data are ‘really noisy’ unfortunately says nothing about the nature of the noise. If the noise is band-limited (determ...

4 years ago | 1

| accepted

Answered
What is the output type of coeffs(y)?
Use whos (or related functions) to find out — syms x y=16*x^2+19*x+11; a = flip(coeffs(y)) b = sym2poly(y) whos a who...

4 years ago | 1

| accepted

Answered
Fit 2 parameters with lsqcurvefit including an integral term
Using your posted revised code (lightly edited) — xdata = [10.30, 29.88, 59.64, 99.58, 149.66, 209.96, 280.44, 361.03, 451.87,...

4 years ago | 1

| accepted

Answered
How to fix jump signal?
One approach — Fs = 256; t = linspace(0, Fs*10-1, Fs)/Fs; s1 = randn(size(t))*0.5; ...

4 years ago | 2

| accepted

Answered
What does this error mean: "Assigning to 3 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment." How to remove?
There was a minor problem with indexing into the ‘bcv’ handle. Try something like this — times = [5,20,40,60,120]; ravgdm ...

4 years ago | 2

| accepted

Load more