Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

How can i create a large colum variable with continious step?

1 visualizzazione (ultimi 30 giorni)
Hey guys, I'm new to MatLab so this might be a basic question.
I need to make a plot of a blasting vibration. The data i posses to plot on the Y-axis includes 500 000 values. On the X-axis I need to plot the time. It must include 500 000 values with a continious step of 0,005s.
So i'm guessing i need some kind of loop to make a variable with 1 colum that looks like t=[0 0,005 0,010 0,015 0,020....]
Anyone knows how i can create this in Maple?
Thanks in advance!

Risposte (1)

Thorsten
Thorsten il 9 Nov 2016
Modificato: Thorsten il 9 Nov 2016
You don't need a loop, you can use Matlab's colon operator to define a range of values first_value:step_size:last_value. You can also use linspace(first_value, last_value, Npoints).
y = rand(1, 500000); % fake some data
Npoints = numel(y);
delta = 0.005;
x_max = delta*Npoints - delta;
x = 0:delta:x_max;
or
x = linspace(0, x_max, Npoints);

Questa domanda è chiusa.

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by