Answered
plotting shaded area of integral
The function creates a surface, and the integral has only a scalar value, so perhaps something like this — F = @(x,y) y.*sqrt(...

4 years ago | 0

| accepted

Answered
Double Integral using ymax and ymin
Use element-wise operations for the multiplications and divisions in the anonymous functions. Also exp must have an argument. ...

4 years ago | 0

| accepted

Answered
What is the first and second drevitive of the unit step signal?
Do the experiment — syms t u(t) = heaviside(t) dudt = diff(u) d2udu2 = diff(dudt) .

4 years ago | 0

| accepted

Answered
Linear regression : How to take into account the quadratic term only and not the linear term ?
Suppress the intercept term and the linear ‘Var3’ by negating them — newT2 = array2table(rand(7,3)) ...

4 years ago | 0

Answered
Why the responses of the following equations are nothing?
Use solve then vpa — syms ae gama A eq1= (23.4255*(ae^3))+(1.2308e-06*ae)+gama eq2= (A/(6*23.4255))-((2*1.2308e-06)/A)-ae ...

4 years ago | 1

Answered
I am trying to clean a large dataset that contains "Nan" values. I want to delete the array that contains at least one "nan" value.
Use the any function, specifying across rows (dimension 2) — A = [[0, 0.0, nan, nan, nan, nan, nan]; [0, 0.0, nan, nan, nan, n...

4 years ago | 1

| accepted

Answered
how du I construct the following Horizontal graph?
This should get you started — x = datetime(1980,1,1) : calmonths(1) : datetime(2013,12,31); % Create Vector y = sort(ra...

4 years ago | 0

| accepted

Answered
How to vary an element in a matrix?
Use a for loop or arrayfun — % System parameters k1=180 * linspace(0.5, 1.5, 9); % Define 'k1' As...

4 years ago | 1

| accepted

Answered
Incorrect 3d graph of Complex Function (with Singular Matrix Error)
Use element-wise division — f = (exp(z))./(z-2); a = -500:10:500; b = -500:10:500; [A,B] = meshgrid(a,b); z = A + 1i*B; ...

4 years ago | 0

| accepted

Answered
Animated 3D Scatter Plot
Try this slightly augmented version — figure(1) hold on grid minor axis([0 2 0 2 0 2]) for i = 1:nume...

4 years ago | 1

| accepted

Answered
1 hour of ECG signal to be splitted into 10 sec in mat format
Use the buffer function — seclen = 10; % Length = 10 Seconds Fs = 256; ...

4 years ago | 0

Answered
How can i interpolate this data?
If I understand the problem correctly, use the fillmissing function across the rows — A = [0 NaN 0.5 0.3 0.7 ...

4 years ago | 1

| accepted

Answered
Surf or Mesh plot
Since ‘z’ must be a matrix to use surf or mesh, the call must be: t = linspace(0, 5100, 5100); y = linspace(0, 34, 34); z =...

4 years ago | 0

| accepted

Answered
angle and abs function gives me 'Subscript indices must either be real positive integers or logicals.' error
First the code defines: angle= -acosd(app.Power_factor.Value); then later it calls the angle function: I_input_angle= angle...

4 years ago | 0

| accepted

Answered
How to calculate the standard deviation of individual points in a dataset
The standard deviation of a point is 0. The size of ‘sd’ here must be the same size as both ‘x’ and ‘y’ so ( vertically conc...

4 years ago | 1

| accepted

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

Load more