Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
Etto Himpe
Etto Himpe le 9 Nov 2016
Clôturé : MATLAB Answer Bot le 20 Août 2021
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!

Réponses (1)

Thorsten
Thorsten le 9 Nov 2016
Modifié(e) : Thorsten le 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);

Cette question est clôturée.

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by