Prev: Using ginput along with pushbuttons in Matlab GUI
Next: Please Some Help With My Frenet-Serret Function
From: ImageAnalyst on 7 Jan 2010 12:57 Jan: I think if you run my demo code, you'll see it does exactly do what he's been describing. Same number of points, no resampling, no interpolation, just simple scaling of the time axis (column). He did not say that he wanted to keep the time increment the same so there is still 151 sample points in both situations - it's basically just the x values that need to be scaled. Again, if you read CAREFULLY his admittedly confusing posts, and run my demo, I believe it should resolve any questions.
From: Abdullah on 7 Jan 2010 13:06 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <7cd4e308-d-------------------------------------------------------------------------------------------------------------- > Abdullah : > > t=0:0.01:1.5 > % Generate some sample data > firstPart = linspace(90, 70, 21); > secondPart = linspace(70, 180, 130); > trajectory = [firstPart, secondPart]; > > > > timeScale2 = 2 * t % KEY PART RIGHT Thank you ImageAnalyst, your code worked for me. here's how it worked, t=0:0.01:1.5 timeScale2 = 2 * t % KEY PART RIGHT NewTraj=[timeScale2' trajectory(:,2)] this new reference is for time step 0.02 but i needed for time step 0.01 so i used inpterp1 to change the time steps. t2=0:0.01:3 newTraj=interp1(timeScale2', NewTraj(:,2), t2) and desired trajectory is: newTrajectory=[t2 newTraj] :-) Thank you everyone. Abdullah
From: Abdullah on 7 Jan 2010 13:14 "Abdullah " <abdullahumer(a)yahoo.com> wrote in message <hi57qd$h48$1(a)fred.mathworks.com>... > ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <7cd4e308-d-------------------------------------------------------------------------------------------------------------- > > Abdullah : > > > > > t=0:0.01:1.5 > > % Generate some sample data > > firstPart = linspace(90, 70, 21); > > secondPart = linspace(70, 180, 130); > > trajectory = [firstPart, secondPart]; > > > > > > > > > timeScale2 = 2 * t % KEY PART RIGHT > > > Thank you ImageAnalyst, your code worked for me. > here's how it worked, > > t=0:0.01:1.5 > timeScale2 = 2 * t % KEY PART RIGHT > NewTraj=[timeScale2' trajectory(:,2)] > > this new reference is for time step 0.02 but i needed for time step 0.01 so i used inpterp1 to change the time steps. > t2=0:0.01:3 > newTraj=interp1(timeScale2', NewTraj(:,2), t2) > and desired trajectory is: > newTrajectory=[t2 newTraj] I forgot to write it as newTrajectory=[t2' newTraj'] Thanks.
From: Jan Simon on 7 Jan 2010 19:05 Dear ImageAnalyst! > Jan: > I think if you run my demo code, you'll see it does exactly do what > he's been describing. Same number of points, no resampling, no > interpolation, just simple scaling of the time axis (column). He did > not say that he wanted to keep the time increment the same ... He wrote: > this new reference is for time step 0.02 but i needed for time step 0.01 so i > used inpterp1 to change the time steps. What should I say: I haven't solved the problem, perhaps you (ImageAnalyst) has solved the problem (at least partially), but surely the OP has solved the problem -- with interpolation. Fine. Jan
From: Abdullah on 7 Jan 2010 19:25 "Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <hi5ss0$8u2$1(a)fred.mathworks.com>... > What should I say: I haven't solved the problem, perhaps you (ImageAnalyst) has solved the problem (at least partially), but surely the OP has solved the problem -- with interpolation. > > Fine. Jan Thaks to all of you. I learnt a lot from all of you. I wasn't able to make you guys understand my problem but still got it in the end. Abdullah
First
|
Prev
|
Pages: 1 2 3 4 Prev: Using ginput along with pushbuttons in Matlab GUI Next: Please Some Help With My Frenet-Serret Function |