Generate a increasing increment array
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Andy Lau
am 12 Okt. 2018
Beantwortet: Image Analyst
am 13 Okt. 2018
Hi,
I was wondering how to generate array as follow
1 4 9 16 25
As you can see, the differences between them is
3 5 7 9
of increasing order. I was wondering how to do that without using any loop?
Thanks Andy
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 13 Okt. 2018
Not sure what the rule is (actually I guess Walter figured it out since you accepted it), but here's another way:
>> v = (1:5).^2
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!