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 years ago | 0

| accepted

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 years 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 years ago | 0

| accepted

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

5 years 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 years 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 years 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 years 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 years 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); %...

5 years 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...

5 years 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 ...

5 years 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...

5 years ago | 2

| accepted

Answered
what is the problem
Two problems, actually. Use element-wise muultiplication and exponentian operators: fx=exp(x)*sin^2*(x); ↑ ← HERE...

5 years ago | 0

| accepted

Answered
How to plot graphs with the specific time domain
I am not certain what you want to do. Try this: figure subplot(3,1,1) plot(t((t>=0) & (t<= 2*pi)),f(t((t>=0) & (t<= 2*pi)...

5 years ago | 1

Answered
Error using vertcat Dimensions of arrays being concatenated are not consistent. PLEASE HELP
The problem is in the expression for ‘dydt’, since MATLAB interprets the spaces as delimiters. This will throw the reported err...

5 years ago | 1

| accepted

Answered
finddelay no significant correlation and nan values
The NaN values in the data (note the gaps in the posted plot) are causing problems. Filling them resolves the problems. Try ...

5 years ago | 0

Answered
Adding date and time on x axes in a plot
There are (at least) two options, depending on what the dates and time are, specifically with respect to the type of arrays they...

5 years ago | 0

Answered
Converting matrix multiplication into element-wise multiplication
I am not certain what you are doing, however it appears that using matlabFunction to convert the symbolic code to a form that ca...

5 years ago | 0

| accepted

Answered
shaded confidence interval plotting with shade area (patch)
The data in ‘data-confidence interval.xls’ are read in as column vectors, so fliplr simply flips a column vector, and accomplish...

5 years ago | 0

| accepted

Answered
What is the difference between the plots of the following commands.
The second one draws the complete Bode plot (magnitude spectrum and phase spectrum) and plots it as a function of the angular fr...

5 years ago | 0

Answered
Find the frequency for signals by using FFT
One approach (I recognise my code from some previous Answer, so I’ll supply the rest of it): T1 = readtable('signals.xlsx', 'V...

5 years ago | 1

| accepted

Answered
Mesh plot of the function sqrt(y-x^2)
Try this: x = -3:1:3; y = 0:1:9; [X, Y] = meshgrid(x,y); Y = Y.*(Y>=X.^2); % Select Y ≥ X^2 Z = sqrt...

5 years ago | 1

| accepted

Answered
Legend and scaled plot
The third argument to scatter will vary the circle sizes according to whatever variable vector is specified, and the fourth argu...

5 years ago | 1

| accepted

Answered
Fminsearch in a for loop
The code borders on being indeciperable. Do not use global variables. See Passing Extra Parameters for the correct way to p...

5 years ago | 0

| accepted

Answered
Finding Exact Intersection Points
See Plot a point of intersection between 2 lines or curves for a typical approach to this problem. This will find all the inter...

5 years ago | 1

| accepted

Answered
Idea on how would I solve a nonlinear system ?
I have no idea what you actually want to do, however the correct approach would be something like this: f = @(y,x) x.^4.*y(1) ...

5 years ago | 1

| accepted

Answered
Numerical Output from a Symbolic Expression
‘So why Matlab is doing that?!’ Because the results of symbolic expressions and operations remain symbolilc. Another optio...

5 years ago | 0

| accepted

Answered
Error: Function definitions are not permitted in this context.
That is not possible in R2015a (thank you for specifying the release you are using), however it is in R2016b and later releases....

5 years ago | 1

| accepted

Answered
Finding the difference in timeseries values
This is kludgy, however I can find no other way to do what you want: C = {'15-Nov-2015 00:00:00' 48.9 51.45 ...

5 years ago | 0

Answered
How to draw Phylogenetic Tree of large dataset
Experiment with this (after the figure has been generated): pos = get(gcf,'Position'); set(gcf, 'Position',pos+[-500 -900 500...

5 years ago | 0

| accepted

Load more