Answered
How to format a cell array to different rows
Try this: fidi = fopen('testdata.txt', 'rt'); C = textscan(fidi, '%f', 'Delimiter',' ', 'MultipleDelimsAsOne',1); % Cell Arra...

3 days ago | 0

Answered
How to solve an iteration problem for a formula in which there is the same variable on both sides (LHS and RHS)
The approach is to subtract the LHS from the RHS, and solve for the function equalling 0. Perhaps something like this: F = ...

3 days ago | 0

Answered
How to get only a part of the convhull line?
One approach is to select only those points that are common to an ‘x’ (independent variable) value less than some threshold. ...

3 days ago | 0

Answered
LPF with notches at 50hz and all other harmonics
I am assuming that the sampling frequency is 2 kHz, and the magnitude spectrum in the image goes to the Nyquist frequency of 1 k...

3 days ago | 0

| accepted

Answered
How to Plot for multiple values of a variable
It would likely be easiest to define ‘G’ as a vector: Gv = [1.4,1.66, 1.8]; and then add an additional loop for it: for k =...

4 days ago | 0

Answered
Summing using simspons rule for a given range
Try this: flim = @(f,x) f(x).*(f(x)<10); % For f(x) ≥ 10, Function ‘flim’ = 0 And So Output Will Not Be Summe...

4 days ago | 0

Answered
Differentiating a Symbolic Function
That is the corrct result, since diff is taking the partial derivative with respect to ‘x’ only, and ‘y’ is considered a constan...

4 days ago | 0

| accepted

Answered
Calculation of derivative of a waveform
Use the gradient function. That appears to be relatively noise-free, so gradient should produce a useful result. If noise is...

4 days ago | 0

Answered
Table calculations, annual return
Assuming that you created the table called ‘T1’ correctly and that it contains variables (columns) named ‘AAPL’, ‘AMZN’ and the ...

4 days ago | 0

| accepted

Answered
How can i detect cardiac axis from ECG signal?
Use Standard Lead for the x-axis, Augmented Lead for the y-axis, and go from there. Calculate the angles using atan2d and the...

4 days ago | 0

Answered
I wish to detect heart rates using the Discrete Cosine transform
Note that 0 is not a positive integer. Positive integers are integers greater than 0, since 0 has no sign, either positive or n...

5 days ago | 0

Answered
How to Merge Color using "Area" Command?
With respect to patch, set 'FaceAlpha'; of both to 0.5 (or anything less than 1) to see the two patches overlap, with appropriat...

5 days ago | 0

| accepted

Answered
ODE45 for a System of Second-Order Equations
I didn’t see this earlier. I’m sure you will find the odeToVectorField and matlabFunction functions helpful.

5 days ago | 0

Answered
simple matrix process for some values
Use ‘logical indexing’: M = randi(10,6) Mnew = M+(M<5)*10 producing (in this random instance): M = 8 6 5 ...

5 days ago | 0

| accepted

Answered
Graph Legend not picking up third plot marker
It is likely not possible to determine what the problem is without the actual data and relevant code. In their absence, try t...

5 days ago | 0

Answered
how to colour an area on graph
If I understand correctly what you want to do, the easiest option is likely the fill function.

5 days ago | 0

Answered
Saving Data for for loop into a vector
The loop is likely not necessary. Try this: idx = find(THRUST>=0.43, 1, 'first'); Time = TIME(idx); to get the closest in...

5 days ago | 0

Answered
In a array, finding x for the first instance of y.
Depending on what you want: idx = find(y>=1, 1, 'first'); time = x(idx); or: idx = find(y>=1, 1, 'first'); time = interp1...

5 days ago | 0

| accepted

Answered
Plotting within a nested for loop
There appears to be only one for loop, not nested loops. I would do: x = zeros(1:numel(TempV2)); y = zeros(1:numel(TempV2)...

5 days ago | 1

Answered
"Array indicies must be positive integers" error
Note that 0 is not a positive integer. Positive integers are integers greater than 0. That is likely also going to be a prob...

5 days ago | 0

Answered
computing potential temperature in atmosphere ?
There are functions for it in the Aerospace Toolbox. See the documentation on the atmoslapse function. It should be straight...

5 days ago | 0

| accepted

Answered
Cannot load data to matlab
It may need the extension as well: load ARG1.mat or: load('ARG1.mat') .

5 days ago | 0

| accepted

Answered
How to create a curve fit for my data?
Assuming you have a vector of ‘T’ values that are functions of ‘s’, ‘g’ is given and the parameter to be estimated is ‘x’: Tf...

5 days ago | 0

| accepted

Answered
Plotting error bars on curve from .csv
I am not certain what you want. Try this: x = [1,100,200,300,400,500,600,700,800,900,997]; y = [100.0193,100.218,100.695...

5 days ago | 0

Answered
Matlab integration of numerical data
The cumtrapz funciton will likely do what you want, although I am not certain what result you want.

5 days ago | 0

Answered
Filter PPG signal using FIR filter instead of IIR Filter
Try this: Fs = 960; fcomb = [24.5 25]; mags = [1 0]; dev = [0.8 0.1]; [n,Wn,beta,ftype] = kaiserord(fcomb,mags,dev,Fs); h...

5 days ago | 0

Answered
finding intercept point in the plot
Try this: theta = 50; v0=200; slope= 0.1; vx=v0*cosd(theta); %horizontal component of velocity vector vy=v0*sind(theta); %...

6 days ago | 0

| accepted

Answered
how to convert dates in matlab
I have no idea what file format they currently exist in, or how you are reading them. Creating ‘datefile.txt’ from the posted...

6 days ago | 0

Answered
how to add to previous value in matlab
Adding a value to the first element simply requires: a=[1 2 3 4 5] a(1) = a(1) + 2 The ‘... then I want ...’ part does not ...

6 days ago | 1

| accepted

Answered
How to add numeric values to cell array?
Try this: names = {'A' 'B' 'C' 'D' 'E'}; val = [0;1.5;0.5;0.5;1.5]; C = {[names{:}].' val} C1 = C{:,1} C2 = C{:,2} TC...

6 days ago | 1

| accepted

Load more