Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

1 次查看(过去 30 天)
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!

回答(1 个)

Thorsten
Thorsten 2016-11-9
编辑:Thorsten 2016-11-9
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);

此问题已关闭。

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by