Removing Specific Elements of a Vector

4 visualizaciones (últimos 30 días)
Jonathan Pinko
Jonathan Pinko el 2 de Mzo. de 2020
Respondida: Jonathan Pinko el 3 de Mzo. de 2020
Hi all,
I am having a problem trying to remove certain elements from a vector. Here is the situation: for the variables xq and Feyq, I am retrieving specific information regarding the Fo and DeltaFe56 content from a previously defined excel spreadsheet. In the next two lines of my code (illustrated on the attached plot), I am finding the vertical distance from my curve Fo,DeltaFe56 to my plotted points.
I then shortened the column vector Fezq to only contain values with absolute values than .025. After I'd completed this step, Felimit was defined as the vector
-.0162
.0244
So now this is the problem: I would like to add the specific Fevq values that I previously subtracted from these Feyq values that correspond to these two values for Felimit, thus generating a column vector that contains the two points in Feyq that are closest to this curve. I am unsure of how to shorten the Fevq vector to only contain the two points that I would like to add to my Felimit values.
Can anyone help me with this? Please let me know if I can provide more information.
xq = dataset(1:116,1);
Feyq = dataset(1:116,2);
Fevq = interp1(Fo,DeltaFe56,xq);
Fezq = Feyq-Fevq;
Felimit = Fezq(Fezq <= abs(.025));

Respuesta aceptada

Jonathan Pinko
Jonathan Pinko el 3 de Mzo. de 2020
It turns out the answer was really straightforward - I just needed to adjust the line "Felimit = Fezq(Fezq <= abs(.025)) to be Felimit = Feyq(Fezq <= abs(.025)).

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by