help me with this for loop please
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
x = -10:0.1:10;
y = 0:0.005:1;
minNmax1 = 0:.005:1;
upper_1 = 0:.005:1;
y2 = 0:.005:1;
f1 = trapmf(x,[-2 0 0 2].');
minNmax1 = zeros(length(x), 2);
for k = 1 :length(y)
minNmax1(k,:) = [min(x),max(x)];
end
I'm trying to get [min(x),max(x)] for 201 values of y but this will only give me 1 answer [-10 10] which i assume is the first iteration?
help!
6 Kommentare
Antworten (1)
Muhannad
am 24 Jun. 2015
will min(x) always be the same number as x is not changing? you can use repmat(min(x), 201,1)) if that is the case
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!