Removing Specific Elements of a Vector

4 Ansichten (letzte 30 Tage)
Jonathan Pinko
Jonathan Pinko am 2 Mär. 2020
Beantwortet: Jonathan Pinko am 3 Mär. 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));

Akzeptierte Antwort

Jonathan Pinko
Jonathan Pinko am 3 Mär. 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)).

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by