Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

trying to understand one line at the program

1 Ansicht (letzte 30 Tage)
itsik
itsik am 10 Mai 2011
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
hello every ones!!! im trying to understand the last line at this program? clear all b = 2500; a = 52; r = rand(1,b) w = ceil(b/a); q = 2*r - 1; q = [q zeros(1,a*w-b)];
does someone can help me and light my eyes bout this one (i know the zeros__ command but i cant understand the meaning when i right the varable 'q' before it....? thank u very much for your help!

Antworten (1)

Sean de Wolski
Sean de Wolski am 10 Mai 2011
You're concatenating the variable q column-wise with zeros. Break it down:
q = 42;
a = 1;
w = 10;
b = 3;
q = [q zeros(1,a*w-b)]

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by