1xn matrix of variables
Ältere Kommentare anzeigen
I need to create a one column matrix F where for n inputs, there are n F values.
For example:
n = 3:
F = F1
F2
F3
I know that I need to create a for loop this but I'm not sure how to do it.
And then I need an if statement saying that for all F(<n), F(<n) = 0 and F(n) = 1000.
In this example, F1 = 0 and F2 = 0, but F3 = 1000.
2 Kommentare
sergi quintana
am 29 Mär. 2020
How your
are determined? Random? Do they follow any equation?
Rik
am 29 Mär. 2020
Numbered variables are a bad idea. You should be using an array, as the answer below describes.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!