Creating L points with uniform spacing d?
Mostra commenti meno recenti
Hi everyone,
I want to create a vector of L points along the x-axis which have a uniform spacing d. I have done as follows:
L=32;
d = 0.063
px = linspace(-d*L/2,d*L/2,L)';
but when I check the distance among them it result 0.065, why this? Suggestion? Thank you!
EDIT: I've read the documentation and according to it the spacing is (x2-x1)/(n-1), so to obtain a correct spacing I should have 33 points instead of 32, including the zero among the points, but the fact is that I don't want the 0 in my vector, so I think that the problem should be the definition of x1 and x2..how can I resolve?
1 Commento
Ive J
il 13 Dic 2020
Why don't you use colon then?
px = x1:0.065:x2; % no guarantee that x2 will be within px though
Risposta accettata
Più risposte (1)
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!