While Loop Line Plot??
Ältere Kommentare anzeigen
I am running a while loop to take the average value of a selcted portion of a matrix. My loop selects a fixed amount of rows and sweeps through columns via the while loop. I want to plot these points as a line vs my upper bound(yU), but I can only seem to get a scatter plot. Does anyone know how to do this?
function [avg] = sweep(mat,xL,xU,yL,yU,ystep,ymax)
while yU < ymax
selmat = mat(xL:xU,yL:yU);
avg = mean(mean(selmat(~isnan(selmat))));
plot(yU,avg,'-x')
hold on
yL = yL + ystep;
yU = yU + ystep;
end
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Graphics Performance 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!
