Answered
Area Under the Curve value from txt file that has two columns
Use either the readtable or readmatrix function to import it, then trapz to do the integration. The integration would go some...

4 years ago | 0

Answered
How do I make custom power trendline plots?
Try something like this — yfcn = @(b,x) b(1).*sqrt(x) + b(2); x = 0:0.5:10; y = rand(size(x)); [B,fval] = fminsearch(@(...

4 years ago | 1

| accepted

Answered
Creating vector in ODE Function to plot graphs
Probably the easiest way to return the derivative is to use a loop to calculate it from the original function using ‘tSol’ and t...

4 years ago | 0

| accepted

Answered
how to calculate duration of peaks
Try this — LD1 = load('t.mat'); ty = LD1.ty.'; LD2 = load('y.mat'); sh1 = LD2.sh1; y = sh1.'; [pks,plocs] = findpeaks...

4 years ago | 1

| accepted

Answered
determine noise amplitude to calculate error of graph
I am not certain what you want to do. Using the information from your previous post I would do something like this — T1 = r...

4 years ago | 0

Answered
Impedance parallel formula in Matlab
It is straightforward to create your own function to calculate it — Zpar = @(z) 1./sum(1./z); % Calculates P...

4 years ago | 0

| accepted

Answered
Find peaks in data without using signal processing tool
The findpeaks function is in the Signal Processing Toolbox, and since you do not have access to it, use the core MATLAB islocalm...

4 years ago | 1

| accepted

Answered
How to use str2num function to extract a specific year from the array?
C = {'2003-09-30T20:32:34Z' '2003-09-30T20:47:34Z' '2003-09-30T21:02:34Z' '2003-09-30T21:17:34Z'...

4 years ago | 1

| accepted

Answered
Find intersection of points in a graph
It would help to have the actual data. Assuming that ‘y2’ is either a constant or a line defined as a function of the same inde...

4 years ago | 2

| accepted

Answered
how to plot 3 different vectors without any relation, in a 3d plot
I am not certain what you want, so my best guess — X=[1 2 3]; Y=[4 5 6]; Z=[11 22 33]; xv = linspace(min(X), max(X), 5); ...

4 years ago | 0

| accepted

Answered
Using the lowpass function
The lowpass function does not display anything unless you leave the trailing seimcolon off of the lowpass call. It will design ...

4 years ago | 0

| accepted

Answered
Can anyone help me to plot jet half width. I have already plotted centerline velocity.
I still have no clue as to what you want, since I have no idea which axis is the velocity since they are only labeled ‘X axis’ a...

4 years ago | 0

Answered
I want to integrate this function but I keep getting errors
Try something like this — [L,I,E,F] = deal(rand,rand,rand,rand); % Use Correct Values func = @(initial) L/...

4 years ago | 0

| accepted

Answered
Help with unstack function on matlab
I am not certain what you want. This is the best I can do with the provided data — T1 = readtable('https://www.mathworks.co...

4 years ago | 0

| accepted

Answered
I want to draw graph between "P" and "x" but it is throwing the following error.
The ‘x’ value is being used as an integration llimit, and integration limits must be scalars. One solution is to devine the ‘...

4 years ago | 0

| accepted

Answered
My code is keep plotting the wrong data
Perhaps — TEST = randn(150,9); M = TEST(:,[8 9 2]); x = M(:,1); y = M(:,2); z = M(:,3); L = size(M,1); xv = linspace(mi...

4 years ago | 1

| accepted

Answered
Fitting a straight line to a specific region of the graph
I suspect the problem is in using‘T’ as a subscript, since subscript values must be integers greater than 0 or logical values. ...

4 years ago | 1

| accepted

Answered
Fft graphs exhibit symmetry on the x axis, but not around 0
It appears that you are plotting part of a two-sided Fourier transform. I generally use this approach to plot a one-sided Fou...

4 years ago | 0

Answered
Finding all possible zeros for a function with 2 independent variables.
The contour and fimplicit funcitons are likely best for this. For contour, create a matrix for ‘v’ and ‘n’ using either ndgri...

4 years ago | 0

| accepted

Answered
i have a vector and i want to convert it in to single cell aray.
I am not certain what result you want. Two options — A = [12 33 44 55 66] B = num2cell(A) B = {A} .

4 years ago | 0

Answered
How can I solve the following error?
Somewhere you have a variable named ‘sum’ and this is throwing the error. The solution is to re-name the variable to somethin...

4 years ago | 1

Answered
Is it possible to create a surface plot from scattered points?
Another approach — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1055560/Datas_xymises.txt', ...

4 years ago | 0

| accepted

Answered
FFT giving undesired answer
‘For reference, the code below currently gives that the vertGridSpacing is 59.94 pixels, while the true vertGridSpacing should b...

4 years ago | 0

| accepted

Answered
how do i read just the header in a csv file and write them into a file
One approach — header='field1,field2,field3,field4,field5' headerstring = string(strsplit(header,',')).' .

4 years ago | 0

| accepted

Answered
extract data from one day from a timetable
Try something like this — LD = load('ask_matlab.mat'); TT1 = LD.ans; RT = TT1.Properties.RowTimes; VN = TT1.Properties.Vari...

4 years ago | 0

| accepted

Answered
Unrecognized function or variable 't'.
Just befor the ‘u’ assignment, insert these assignments: tmax = 10; % Maximum Time t...

4 years ago | 0

Answered
How to select a certain range in the middle of my data?
There are different ways to do this. One approach — ReadDataX = 0:0.5:10 ReadDataY = randi(9,size(ReadDataX)) Lv = ReadDa...

4 years ago | 1

| accepted

Answered
How to take data from multiple variables and store them in one variable?
I am not certain what you want, however one option would be a cell array — v1 = rand(3) v2 = 'This is Variable #2' v3 = exp(...

4 years ago | 0

| accepted

Answered
to build a table with XYZ values
In order to save them to a file, use the (:) operator or the reshape function to create column vectors from the matrices. Conca...

4 years ago | 0

Answered
Interpolating points in a 3D space with one line
Try something like this — rpm = rand(5,1); dosage = rand(5,1)*0.1; mass_of_leaves = rand(5,1); B = [dosage mass_of_leaves...

4 years ago | 0

| accepted

Load more