Graph with similar axis value with the value given

2 Ansichten (letzte 30 Tage)
Fakhri Alifin
Fakhri Alifin am 3 Feb. 2021
Beantwortet: Daniel Pollard am 3 Feb. 2021
Good Afternoon, I'm a newbie in matlab.
I have these two groups of value
y = [733.3036 723.4694 717.7095 713.5816 711.1634 709.3579 708.2943 707.9351 708.3573 709.3768 711.9425 713.9145 717.3444 722.2313];
x = [0.5 0.6 0.7 0.8 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99];
I want the graph shows me the specific axis range (similar with the x and y value given) that is [0.5 0.6 0.7 0.8 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99] and [733.3036 723.4694 717.7095 713.5816 711.1634 709.3579 708.2943 707.9351 708.3573 709.3768 711.9425 713.9145 717.3444 722.2313].
because whenever plot it directly with plot(x,y), the value appeared was unmatched with the value given (i.e x = 0.5 0.55.....) so the coordinate wouldn't be matched.
Would anyone wanna help me? thank you.

Antworten (1)

Daniel Pollard
Daniel Pollard am 3 Feb. 2021
As a note: you need the vectors to be in ascending order, and your second tickmark vector isn't. sort should help there.

Kategorien

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

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by