Value of a variable not changing in the workspace ??
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ramesh Bala
am 18 Feb. 2019
Kommentiert: Ramesh Bala
am 20 Feb. 2019
The value of j goes upto 1025 but i stays at 255 itself ,what's the error in this nested loop??
X = load('x.mat');
Y = load('y.mat');
for i=245:61503
i = i+10;
for j=1:1024
j=j+1;
figure(); hold on
plot(Y.y(1:i,j))
set(0,'DefaultFigureWindowStyle','docked')
end
end
hold off
5 Kommentare
Rik
am 18 Feb. 2019
Why don't you try explaining what you want to do? That way we can try to solve your actual issue, instead of the errors from your solution.
Akzeptierte Antwort
ibabinaca
am 18 Feb. 2019
Bearbeitet: ibabinaca
am 18 Feb. 2019
Why are you putting j = j+1? There is no need to put it with matlab.
X = load('x.mat');
Y = load('y.mat');
for i=245:10:61503
for j=1:1024
figure(); hold on
plot(Y.y(1:i,j))
set(0,'DefaultFigureWindowStyle','docked')
end
end
hold off
By the way, 245+10*n is never going to be 61503
3 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations 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!