Generation of a column with constants values that increases for different RANGE of row
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm trying to generate ONE column of numbers in Matlab as follows:
1) let the value be equal 10 for row 1 to 30,
2) let the value be equal 10 + increment (for example increment=8) for row 31 to 60,
3) let the value increase in increments of 8 for each new sequence of row 1 to 30
until final constant value equals a number, (for example, 82)
I tried a loop like this:
for f =1:30
for g=(10:8:82);
h(f,1) = g;
end;end;
but did not work.
My result is only a column with the constant 82
from row 1 until 30.
I wonder if someone could help me.
Thanks
Emerson
0 Kommentare
Akzeptierte Antwort
Oleg Komarov
am 28 Mär. 2011
1) A( 1:30,1) = 10;
2) A(31:60,1) = 18:8:10+8*30;
3) not clear
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!