Finding and saving slopes of individual lines generated using for loop
Ältere Kommentare anzeigen
I have an array T(4753*6), which are (x1,y1,x2,y2,x3,y3). I have plotted three profiles using for loop. Similarly, I want to calculate the slope of the plotted individual profiles and save it in the workspace using for loop. I am using the following code that is not working, Is there any other way to calculate the slope of individual profiles and save it?
hold on
for i=2:2:6
j=i-1
plot(T(:,j),T(:,i))
end
hold on
for i=2:2:6
j=i-1
p=polyfit(T(:,j),T(:,i),1)
end
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!